Quantcast
Channel: Adobe Community : Popular Discussions - Lightroom SDK
Viewing all 53524 articles
Browse latest View live

ublishServiceProvider.publish_fallbackNameBinding not being picked up in service panel

$
0
0

I'm using publishServiceProvider.publish_fallbackNameBinding to bind the name of the publish service instance to 'fullname' as in the samples, but for some reason it is not being picked up. The text box is empty, as is the synopsis.

 

If I comment out the line and accept the default, it will choose the name of the service for the text box, but there is no synopsis when closing the PublishService section. Furthermore, is is rendered fully, unlike the sample plugin, where the property binding it chooses (or you tell it to choose) is rendered slightly greyed out.

 

I've tried other properties, such as "username", with the same results. I know these properties are non-nil, but I'm starting to suspect this is a timing problem, as my account panel takes a bit to refresh (I am doing at least one more REST call to a remote API to get user quota information.)

 

I can still name and rename the service anything I want to, and when creating the service the panel reflects this name. It is only if I open the service again and view/edit it that the text box is empty.

 

Mostly this is an annoyance, but I'd like to resolve it. Are there any techniques for getting into the Publish Service execution where it sets this stuff up, perhaps to debug or query values?

 

While writing this, I just realized the sample actually iterates through the script where this is defined to something not nil, so I can probably debug into that loop to see what is going on a little. I'll still post this in case someone wants to point out something obviously wrong I'm doing.


How to pass parameters to a Mac app?

$
0
0

The open -a command will open a mac app, but when I try to pass it parameters, it's interpreted as a file for that app to open instead of parameters to the app.

 

If I try to open the app without using the open command, it fails.

 

Any ideas?

Using startAsyncTask and getting a return value

$
0
0

Hello,

 

I'm just starting to try and learn LUA and the whole Lightroom SDK.  Here is a sample of my code:

 

local lrApplication = import 'LrApplication'

local LrTasks = import 'LrTasks'

 

local activeCatalog = lrApplication.activeCatalog()

local currentPhotos = activeCatalog:getMultipleSelectedOrAllPhotos()

local y = LrTasks.startAsyncTask(function() return currentPhotos[1]:getFormattedMetadata('fileName') end)

 

wheneven I check or try to use y it is nil.

 

Please someone tell me the stupid thing I'm doing wrong so I don't lose any more of my dwindling hair. 

 

I know that currentPhotos has 5 photos in it's collections because later on I do this:

     for i, onePhoto in ipairs(currentPhotos) do

and it loops through 5 times, which matches up to the number of photos in the folder I have selected in Lightroom.

 

 

Thanks.

Functions for multi-phase catalog access, with retries...

$
0
0

See Catalog:action & Catalog:privateAction below.

 

These functions support iterative catalog access, to divide catalog updates into chunks...

 

Also, they support retries to deal with contention in case another plugin task is already accessing the catalog.

 

 

-- private method:

function Catalog:_isAccessContention( qual )

    local found = qual:find( "LrCatalog:with", 1, true ) or 0 -- return position or zero, instead of position or nil.

    if found == 1 then -- problem reported by with-catalog-do method.

        local found2 = qual:find( "already inside", 15, true )

        if found2 == nil then

            found2 = qual:find( "was blocked", 15, true ) -- Lr4b

        end

        if found2 then

            -- problem is due to catalog access contention.

            Debug.logn( 'catalog contention:', str:to( qual ) )

            return true

        else

            return false

        end

    else

        return false

    end

end

 

 

 

-- private method:

function Catalog:_action( catFunc, tmo, name, func, ... )

    local t = { ... }

    local tries = math.max( math.ceil( tmo * 2 ), 1 )

    local sts, msg

    local function _func( context )

        sts, msg = func( unpack( t ) )

    end

    local count = 10000000 -- ten million max, for sanity.

    repeat

        local s, other

        if name then

            s, other = LrTasks.pcall( catFunc, catalog, name, _func )

        else

            s, other = LrTasks.pcall( catFunc, catalog, _func )

        end

        if s then -- no error thrown

            if sts then

                return true -- all done.

            elseif str:is( msg ) then

                return false, "Unable to complete catalog update - " .. msg

            else

                -- continue

                count = count - 1                       

            end

        else

            if self:_isAccessContention( other ) then

                tries = tries - 1

                if tries == 0 then

                    return nil, "Unable to access catalog for " .. str:to( tmo ) .. " seconds."

                else

                    LrTasks.sleep( math.random( .1, 1 ) ) -- sleep for half second, plus or minus.

                end

            else

                return nil, "Catalog access function error: " .. str:to( other )

            end

        end

    until count == 0

    return nil, "Program failure"

end

 

 

 

--- Wrapper for named/undoable catalog:withWriteAccessDo method - divide to conquor func.

--

--  @param tmo (number) max seconds to get in.

--  @param name (string) undo title.

--  @param func (function) divided catalog writing function: returns sts, msg = true when done; false if to be continued; nil, error message if trouble.

--  @param ... (any) passed to func - often a table containing photo start index.

--

--  @usage example:<br>

--           local function catalogAction( t )<br>

--               if t.i > #photos then<br>

--                   return true -- done, no errors (although should pre-check for photos to process).<br>

--               else<br>

--                   local k = math.min( t.i + 1000, #photos )<br>

--                   while ( t.i <= k ) do<br>

--                       -- do something to photos[t.i]<br>

--                       -- if trouble, return nil, msg.<br>

--                       t.i = t.i + 1

--                   end<br>

--                   if t.i > #photos then<br>

--                       return true -- done, no errors.<br>

--                   else<br>

--                       return false -- continue, no errors.<br>

--                   end<br>

--               end<br>

--           end<br>

--           local sts, msg = cat:action( 10, "Test", catalogAction, { i=1 } )<br>

--           if sts then<br>

--               -- log successful message.<br>

--           else<br>

--               -- print error message...<br>

--           end<br>

--

function Catalog:action( tmo, name, func, ... )

    return self:_action( catalog.withWriteAccessDo, tmo, name, func, ... )

end

 

 

 

--- Wrapper for un-named catalog:withPrivateWriteAccessDo method - divide to conquor func.

--

--

--  @param tmo (number) max seconds to get in.

--  @param func (function) divided catalog writing function: returns sts, msg = true when done; false if to be continued; nil, error message if trouble.

--  @param ... (any) passed to func.

--

function Catalog:privateAction( tmo, func, ... )

    return self:_action( catalog.withPrivateWriteAccessDo, tmo, nil, func, ... ) -- no name.

end

 

 

Note: These functions were changed a bit after further testing and integration - consider them for example purposes only. The released version of these functions will be available shortly as part of the Elare Plugin Framework:

 

https://www.assembla.com/spaces/lrdevplugin/

 

PS - After some mods, the final version allows me to write code like this which I find convenient (still not released yet at assembla.com):

 

local coll

local s, m = cat:update( 10, "Assure Folder Collection", function( context, phase )

    if phase == 1 then

        coll = catalog:createCollection( folder:getName(), parent, true )

        return false -- keep going.

    elseif phase == 2 then

        coll:removeAllPhotos()

        return false -- keep going.

    elseif phase == 3 then

        coll:addPhotos( folder:getPhotos() )

        return true -- done (same as returning nil).

    else

        app:error( "bad phase" )

    end

end )

if s then

    app:logVerbose( "Assured collection: ^1", coll:getName() )

    return coll

else

    return nil, m

end

 

or

 

local photos = catalog:getAllPhotos()

local s, m = cat:update( 10, "Update Photos", function( context, phase )

     local i1 = (phase - 1) * 1000 + 1

     local i2 = math.min( phase * 1000, #photos )

     for i = i1, i2 do

        local photo = photos[i]

        -- do something with photo that writes catalog.

    end

    if i2 < #photos then

        return false -- keep going

    end

end )

if s then

    app:logVerbose( "Photos updated..." )

    return true

else

    return false, m

end

How to define smart collection rules to match a folder's path?

$
0
0

I was hoping to define a tree of (smart) collections to match my folders tree, but coming up with a search criteria to match the folder path is proving difficult at best, impossible at worst.

 

Any ideas?

Lightroom 4.1 SDK: What's new...

$
0
0

The download link is presently broken but it looks like SDK will be out with Lr4.1:

 

http://www.adobe.com/devnet/photoshoplightroom.html

 

The pdf guide is there (link not broken).

 

Once officially released (and/or download link fixed), I will try to do a thorough comparison of what's been added or changed and post here.

 

For now, just from briefly skimming the pdf guide & api doc, I gleaned:

 

1. Pretty lean release - keep expectations low...

 

That said, here are some enhancements I noticed:

 

* Plugin startup / shutdown.

* Video

* Scrolled View - this is probably the most exciting enhancement, to me.

* Simple LIst - supporting multiple selection, my #2 choice, excitement-wise, so far.

* Also note the timeout params on with-do methods of catalog.

 

* Plus there are the other things mentioned in another thread: e.g. catalog_photo component is official now.

 

My #1 feature request was denied: numeric and date types for plugin metadata.

 

Do standby...

Rob

Joomla Publish plugin

$
0
0

I am looking in to writing a publish plugin for a gallery component running under the Joomla CMS (1.5).

 

I don't know lua, so I'm going to have some learning to do, but my question is has anybody done something similar?

 

If so, was xmlrpc or another authentication/protocol system used? Although I undrstand PHP and C++ I'm unsure of the best method to use for remote user authentication and everything else!!!

 

I realise I am going to have to write the api for the component (Joomgallery - http://www.en.joomgallery.net ) because none exists, but before I embark on this I need to know the best way to go about this.

 

I realise this is a big ask, but if someone has done something similar it will give me a starting point to research, I have never used xmlrpc either so maybe more stuff to research.

 

My ultimate goal, to create a plugin that will handle publishing of categories as well as images, the ability to retrieve comments and rankings and ultimately the ability to link to the cart system i.e. retrieve orders to create collections with sub collections of print sizes/finishes of selected images.

 

Any insight of where to start, what to research etc would be much appreciated.

The new Adobe Exchange and Lightroom?

$
0
0

Will the new Adobe Exchange support Lightroom plugins?  Has anyone checked it out yet?

 

Dear Adobe Partner,

We wrote to you recently as you have one or more products on the Adobe Exchange website: http://www.adobe.com/cfusion/exchange/index.cfm

In late September we intend to rebrand this site as ‘Adobe Exchange Classic’ in order to differentiate it from our new offering at https://www.adobeexchange.com

As well as being available on the web, the new Adobe Exchange is available as a panel in various Creative Suite 6 applications, it offers numerous benefits over Exchange Classic.

If you would like to try out the new Adobe Exchange, simply complete this short form to register for the prerelease program. This will allow you to submit unlimited public (both free and paid-for) or private products while the prerelease program is running. It's a great opportunity to try it out, ask questions on the forums and help us tune the offering to match your needs.

http://tinyurl.com/exchangeprerelease

What is the new Adobe Exchange?

Adobe Exchange is a new service we are launching alongside Creative Suite 6 and soon Creative Cloud. It is designed to overcome issues that many Adobe partners have identified. While we provide tools to help you create Extensions with products like CS Extension Builder, the sale, distribution and tracking of those products was left down to you and that also made it difficult for customers to find and potentially purchase your products. We have created a panel that works inside most of the Creative Suite 6 applications allowing users to browse, search and buy directly from within the CS application. We also have public Web pages and are currently working on the ability to purchase products via the Web, in addition to the panel. We invite you to create CS6 compatible content and products that can be made available on Adobe Exchange. Over time the products available and the capabilities will grow substantially but this is your chance to be there from the beginning.

What you need to do

  1. 1. Simply complete the short form here in order to be signed up for the Adobe Exchange (codename Agora) prerelease program:

http://tinyurl.com/exchangeprerelease

  1. 2. Submit your products to the new Adobe Exchange.

We look forward to welcoming you to the Adobe Agora Prerelease Program.


How can I apply one xmp file on an other raw/dng file?

$
0
0

The result I'm looking for is just like doing -copy settings- from picture A, and -paste setting- on picture B. but I want to do that to a whole gallery, so I figured that the best way to do so is using the xmp files somehow ... all suorce file A and destenation file B has the same name.

 

Why I want to do that?

I want to edit big amount of raw files(36MP each) , in a very fast way.

The idea- first, convert them to 1MP files, then edit those very small files working very fast, and then apply or copy the edit of each 1MP pic to the original raw/dng file.

 

the last stage might involve some code writing, but I still didnt figured how to apply the xmp file into the original raw/dng

 

So, what do u think?

What is root-pixels.db used for?

$
0
0

I mostly understand previews.db, but root-pixels.db is still a mystery - any ideas?

 

I mean it seems like redundent info from previews.db, plus jpegData which only has like 10 bytes of data - hmm...

Documentation differences between LR 4 and 5 SDKs

$
0
0

Here's what the Readme says:

 

------------------------------------------------------------------------------------------ -------------

     For this release (5.0) the SDK highlights the following:

 

1. Create Floating Windows: With the addition of LrDialogs.presentFloatingDialog(...)

          SDK developers are now able to create separate, floating, non-modal windows that

          allow more robust interactions between the plug-in and Lightroom.

2.          Access Smart Previews: Smart Previews can be built and deleted via

          photo:buildSmartPreview() and photo:deleteSmartPreview() respectively.  In addition,

          SDK developers can access the Smart Preview path on disk and file size via

          photo:getRawMetadata(...)

3.          Create Virtual Copies: Virtual copies for one or more images can now be created via

          catalog:createVirtualCopies(...)

4.          Retrieve Smart Collection Search Descriptions: The search description for a Smart

          Collection can now be accessed via collection:getSearchDescription()

5.          Create Bezel Overlays: LrDialogs.showBezel(...) will show a message in a window that

          will display and fade away after a short duration.

6.          Request Jpeg Previews: LrPhoto:requestJpegThumbnail(...) retrieves a  jpeg preview

          of the photo of the requested size

7.          Key Bug Fixes and JDI’s:

          -          LrView:catalog_photo(...)’s "photo" argument can now be set to "nil" in

                    order to specify no photo is to be displayed

          -          LrCatalog:getActiveSources(...) now returns defined constants for special

                    sources (e.g. "All Photographs", "Previous Import", etc.)

          -          LR_LiveName propery now available to smart collections

          -          Horizontal and Vertical scrollbars can now be disabled on a

                    LrView:scrolled_view

          -          LrView:simple_list now properly supports enabled and visible properties

------------------------------------------------------------------------------------------ -------------

 

I can't determine what is meant by "LR_LiveName property now available to smart collections".

 

I did a "diff" between the documentation for LR 4 SDK and LR 5 SDK.  Here's what I found:

 

LrCatalog

catalog:buildSmartPreviews() [new]

catalog:createVirtualCopies() [new]

catalog:findPhotos() [can’t determine the exact difference]

catalog:getActiveSources() [corrected documentation]

 

LrCollection

collection:getSearchDescription() [new]

 

LrDialogs

LrDialogs.presentFloatingDialog() [new]

LrDialogs.showBezel() [new]

 

LrHttp

LrHttp.post() [corrected documentation]

LrHttp.postMultipart() [new parameter, suppressFormData]

 

LrPhoto

photo:buildSmartPreview() [new]

photo:deleteSmartPreview() [new]

photo:getRawMetadata() [new key “smartPreviewInfo”]

photo:requestJpegThumbnail() [new]

photo:setRawMetadata () [can’t determine the exact difference]

 

LrPublishedCollection

pubCollection:getSearchDescription() [new]

 

LrTasks

LrTasks.execute() [explanation of Mac OS sandbox restrictions]

 

LrView

[explanation that a factory object can only be used in one place at a time]

viewFactory:catalog_photo() [can’t determine the exact difference]

viewFactory:scrolled_view() [new parameters background_color, horizontal_scroller, vertical_scroller]

trouble with withWriteAccessDo

$
0
0

I'm trying to create and add a keyword and I'm consistently getting

 

LrCatalog:withWriteAccessDo: could not execute action 'SetKeywords'. It was blocked by another write access call, and no timeout parameters were provided.

 

my code looks like this

 

 

     import 'LrTasks'.startAsyncTask(                                                                                                        LrCatalog:withWriteAccessDo('SetKeywords',                                                                                         function(context)                                                            local myKeyword = catalog:createKeyword( 'XYZA: test', {}, true, nil  )                                                            photo:addKeyword(myKeyword )                                                       end                                                  )     

 

 

 


How would I even provide a timeout parameter or is that a red herring? (apologies for the way this code looks but i cannot figure out this wysiwyg editor and  i just want to insert code)

Restarting Lightroom - how to do it *and* have preferences saved (& start up with specified catalog)

$
0
0

I know one way to restart Lightroom (with specified catalog), however preferences are not saved:

 

Win: lightroom.exe -restart {catalog}

Mac: open {catalog}

 

However sometimes (usually) it would be better if preferences were saved on the way out.

 

PS - I can exit Lightroom with preferences saved by stuffing the keyboard (Alt/Cmd-FX), but how to get it to startup again (with specified catalog).

 

Any ideas?

 

Rob

How to send lightroom data to arduino?

$
0
0

Has anyone done this?

 

I'm an industrial design student working on a project in school and I want a two way communication with lightroom. I want to have physical output (LED's, turning knobs) that sits on your desk next to your computer. Send commands from arduino is not a problem, i've done that already but i want output as well

has anyone any advice where to begin, or anyone could help me out?

I can program in arduino pretty good, and have some basics in python

 

 

THANKS!

Can I export. Tiff file from Lightroom Mobile to camera roll on iPad or to another app

$
0
0

I Snyc from Lightoom 5.4 to LM on my ipad. They are tif files .  I edit and want to either send to Camera roll on iPad or copy to another app for further editing.  I can't seem to do it.  It becomes a jpeg.

THanks


Context Menu for Collection in Publish Service

$
0
0

Hi All,

 

I'm working through the Flickr example and SDK 5 - creating my own Publish Service plugin. So far so good.

 

I'm wondering though, how can I add an item to the context menu (right click) of a collection that has been created in my publish service.

 

I'l like to add a Show Info option (under the same menu that is used to Edit Collection or Rename), and I'd like to store a Name, Description, and display the Remote ID for the collection in the Edit Collection context item, and show all of this in a Show Info context menu item.

 

Thoughts?

 

Any tips or suggestions greatly appreciated.

FTP Plugin keeps asking for password

$
0
0

Hi everyone,

 

I tried to build a simple ftp upload plugin by altering the sample plugin from the sdk kit but I've constantly been asked to type in the ftp password. What's wrong?

 

I'm pretty new to lua so the error might be pretty obvious.

 

I build a local preset:

 

local ftpPreset = {

    passive = "none",

    password = "password",

    path = "",

    port = 21,

    protocol = "ftp",

    server = "server.com",

    username = "username"

    }

 

After that I build the ftp connection:

   

    if not LrFtp.queryForPasswordIfNeeded( ftpPreset ) then

        return

    end

   

    local ftpInstance = LrFtp.create( ftpPreset, true )

 

But when I start the plugin I'm prompted to retype username and password (username is pretyped).

 

Would be great, if someone could help me build my own ftp plugin.

 

Thanks everyone!

 

Flo

why is my web gallery not previewing inside Lightroom web module

$
0
0

I've created a webgallery which uses a set of centralised javascript files (I dont want them uploaded for each gallery I create)

The gallery works fine once uploaded but I'm seeing nothing in the web-module inside Lightroom.

 

I've based my gallery on the default html although I'm now creating a .shtml file on my server.

 

Is there anything I need to look out for? Do I need my javascript files locally even though their URLs are hard-coded?

 

Thanks in advance

Rob

The photo:requestJpegThumbnail callback is called more than once

$
0
0

Hello,

 

I am running into an issue where photo:requestJpegThumbnail  is called more than once.

 

Basically, inside a LrTask, I am looping through a selection of photos and I am calling photo:requestJpegThumbnail for each of them. Since it seems there is no way I can pause my task during the callback is executed, I have a look with a sleep. I would prefer to use a promise for this if possible but I didn't find a way to do it. It actually works without any problem but... the callback of photo:requestJpegThumbnail is sometimes called more than once. I can use a isFirstTry variable in there and then it works but I want to avoid using any hack. Here is what my (pseudo) code looks like.

 

(LrTask)

-- 'photos' is a selection of photos from the catalog

-- 'total' is the total number of photos and 'current' starts at 1

while not current < total do

     local isRunning = true

     current = current + 1

     photo = photos[current]

    

     thumbnail = photo:requestJpegThumbnail( 400, 400, function ( thumbnail )

               -- hello! I am sometimes called more than once for the same photo

               isRunning = false

     end )

    

     while isRunning do

          LrTasks.sleep( 1 / 5 )

     end

end

(/LrTask)

 

Any ideas?

ftp settings file

$
0
0

Is it possible to customize the

Ftp Upload service provider plugin for lightroom to have directly the user, pass ftp.

So one can provide the plugin to customers without giving them too much work to do?

Viewing all 53524 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>