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

Binding problem in LrPluginInfoProvider.sectionsForBottomOfDialog

$
0
0

Hi,

 

I have a binding problem in my LrPluginInfoProvider.sectionsForBottomOfDialog function, and i cannot make it work; i've read all the docs, view all the samples, but i just can´t see where the problem is ...

 

I have this code in my Info.lua

 

return {

     ...

     LrPluginInfoProvider = 'PluginInfoProvider.lua',

     ...

}

 

PluginInfoProvider.lua has this code:

 

require 'PluginManager'

 

return {
    sectionsForBottomOfDialog = PluginManager.sectionsForBottomOfDialog,
}

 

And this is PluginManager.lua:

 

local LrView = import 'LrView'
local LrDialogs = import 'LrDialogs'
local LrLogger = import 'LrLogger'

 

local myLogger = LrLogger('logger')
myLogger:enable("logfile")

 

PluginManager = {}

 

function PluginManager.sectionsForBottomOfDialog(viewFactory, propertyTable)

 

    propertyTable.text = ""
    propertyTable.buttonEnabled = false

 

    return {
        {
            title = "Test",
            viewFactory:row {
                spacing = viewFactory:control_spacing(),
                viewFactory:static_text {
                    title = LOC "Text",
                },
                viewFactory:edit_field {
                    value = LrView.bind "text",
                    validate = function( view, value )
                        if #value > 0 then -- check length of entered text
                            propertyTable.buttonEnabled = true
                        else
                            propertyTable.buttonEnabled = false
                        end
                        return true, value
                    end,
                },                   
                viewFactory:push_button {
                    enabled = LrView.bind 'buttonEnabled',
                    action = function(button)
                            myLogger:trace("Test value")
                            myLogger:trace(propertyTable.text)
                    end,
                },
            }
        },
    }
end

 

As far as i know, the button should enable only when there is some info in the text field and log file should show the text field value, but it only displays "Test value" and the button is always enabled.

 

Any idea? i'm really with this ... (i don't know if matters, but i'm testing this in a WinXP machine with LR 2.3)

 

Thanks in advance,


LrHttp.post and HTTP redirect

$
0
0

Hi,

 

I am writing a plugin that uses HTTP to upload images to a site. The site uses cookies to maintain a user's session. It works like this:

 

1. Browser:POST to a sigin script sending username and password

2. Server: Respond with HTTP 303 (redirect) including Set-Cookie header for session cookie and URL to redirect to

3. Browser: GET redirected URL, including sending cookie header as part of the GET request

4. Server: Respond HTTP 200 with redirected URL contents (no Set-Cookie header)

 

To allow my plugin to grab the session cookie, I need to be able to see the 303 response from step 2.

 

However, the way LrHttp.post works is to hide steps 2 and 3 from me, and return the html from the successful re-direct.

 

I understand that this is nice and correct behaviour from Lr.Http to automatically interpret the redirect, but this prevents me from seeing the Set-Cookie header and hence I cannot establish a session with the server from Lightroom.

 

Any ideas?

 

James

List exported images as text and send as email

$
0
0

Hi, I have a problem that I hope you can help me with as it would greatly ease my workflow:

 

After shooting newly hired staff each month, I usually have a large amount of images that needs to be edited by other employees that have indirect access to the same folder that I export my images to (in order to make ID-cards ect.). By indirect I mean that they use a specific program to access the folder.

 

I would like to be able export these images directly from Lightroom to the specified folder and at the same time make a list of the filenames that I can send as an email to the HR-department.

 

Is there a simple solution to this? - Is it possible for instance to make a Lightroom export action open up my email program and produce a list of exported images (just the filenames as text) which then can be inserted into the email?

Closing a Dialog

$
0
0

How do I, if it is possible to, close a dialog automatically (like if a condition is met)?  A quick example?  Thanks!

Looking for tutorial on how to see LrLogger logs

$
0
0

Hi

im new to Lightroom sdk , i wad reading the documents about he LrLogger , and its says i need to get MS debug tools to watch logs

is it the only way ? if it is , where i can find short tutrial on how to see logs ?

Thanks

Exclusive use of a postProcessRenderedPhotos()?

$
0
0

Hello

 

I have a specific postProcessRenderedPhotos() on an export filter which only makes sense for a specific export service.

 

Is it possible to have a uniquely tied export filter for an export service? It is possible to hide the export filter in the “Post-Process Actions:” list from the user or is it possible to make sure the required export filter is always enabled?

 

Thanks

Daniel

Skipping Lightroom’s built-in render engine?

$
0
0

Hello

 

I have an export plugin which needs to do its work on the original files.

 

Is it possible to skip Lightroom’s built-in render engine and let the rendering work completely do in a export filters postProcessRenderedPhotos() by an external tool as described in the Lightroom SDK 4 Programmers Guide in chapter “Defining post-processing of rendered photos”?

 

At the moment Lightroom’s built-in render creates the images which then are thrown away from my export filter and that leads to bad performance.

 

Thanks

Daniel

how to get the full path to a web-gallery image once it's uploaded.

$
0
0

I'm attempting to create social media links (like PInterest) on each of the images in my web galleries.

I'm creating my webgallery using my own version of the default web gallery template

 

PInterest seems to need the full URL of the image (and the parent webpage) and I'm unsure how I can obtain this.

 

I DO have the main website URL (of course) and I can get the image name, and it's relative path but i just cant find how to get the destination folder i specified in the upload.

 

 

I have to admit, I'm just a beginner so there may be some concepts I've not grasped yet.

 

Hope you can help!

 

Thanks

Rob


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...

LrHttp communications

$
0
0

I'm experimenting with opening a remote website in a window using LrHttp. I am curious what kind of communication potential exists between a plugin and a web page opened in this way.  Obviously, that page could be opened with a URL generated by the plugin, which provides a good form of communication in that direction. And, based on the documentation, it seems as if a lightroom plugin can read cookies written by the website that it opened (is this really true??). So that seems to provide at least one avenue of communication the other way. I just add an observer to whatever form that cookie becomes in the plugin and do things based on changes to that.  But what other forms of communication are possible? How might a Javascript routine send the plugin information?  Does the plugin have a psuedourl that can receive posted data?  There's nothing about this in the documentation, so I'm hoping someone knows something about this.

Entering newlines in edit_fields and custom metadata tagsets

$
0
0

I finally discovered how to allow the user to enter newlines directly into edit_fields without having to type CTRL+J:

 

f:edit_field {height_in_lines = 5, allow_newlines = true}

 

Similarly, in custom metadata tagsets, you can duplicate the functionality of the "Large Caption" preset:

 

{'com.adobe.caption', height_in_lines = 15, allow_newlines = true,         topLabel = true}

 

This undocumented feature hasn't been posted in these forums (according to Google), but after the fact I see that a number of others discovered this years ago, at least with respect to metadata tagsets:

 

http://regex.info/Lightroom/Meta/JustPeek=Jeffrey/Jeffrey

Customising Adobe Lightroom metadata field names | Malc Raggett's Photo Blog

Happy Amateur: Lightroom 5 Metadata Tag Set

Retrieve 'Use as Cover Photo' from SDK

$
0
0

Hi All,

 

Does anyone know if it's possible to retrieve the photo that has been marked as the 'Use as Cover Photo' via the SDK?

 

I've written a Publish Service plugin, and would love to be able to retrieve this value, whether from LRPhoto or LRCollection or LRPublishedCollection.

 

Thoughts?

 

Screen Shot 2014-08-04 at 5.55.57 PM.png

Lightroom catalogue issues

$
0
0

Have just upgraded both computer and software from 3.6 to 5 but the new computer and 5 version will not recognise all previous edits in the catalogue? I also cant delete files as it tells me other application using them while all other applications closed? I have 2 computers one running the 3.6 and the new one running the 5 version but both share the same external hard drives,not at the same time. I also have purchased metamachine and it will not recognise some folders from the hard drive plus will not transfer the keywords in to lightroom with the one click command any advice appreciated

Problem with autofill Export standard fields

$
0
0

Hi,

 

I'm trying to write primitive export action: I want to export photo to some folder and put it to autonaming subfolder. Basic idea is to use the same name, as photo folder:

 

local LrApplication = import 'LrApplication'

local LrPathUtils = import 'LrPathUtils'

 

local activeCatalog = LrApplication.activeCatalog()

local filmstrip = activeCatalog.targetPhotos

local parentfolder

activeCatalog:withReadAccessDo( function()

     local photo = activeCatalog.targetPhoto

     parentfolder = LrPathUtils.leafName(LrPathUtils.parent(photo.path))

end )

 

First, I tried to get .lrtemplate file, and modify it

      export_destinationPathSuffix = ...,

But it fails on either import!

 

Then I tried to create LrExportServiceProvider with preset and startDialog method: skip export_destinationPathSuffix in preset and setup propertyTable.LR_export_destinationPathSuffix in startDialog. But when I'm chosing my preset: it sets up correct value, and the blinks and sets up "Untitled Export" value! I can add an observer to LR_export_destinationPathSuffix, but it will update field, not view.

 

To reproduce:

- import attached plugin

- select export

- choose any other preset

- choose "Folder->MakeFolder" preset

You will see Subfolder name blinking, and the new value is "Untitled Export"

 

Can anybody help me with this stuff?

 

Victor.

Extracting JPEG files from Adobe Lightroom previews

$
0
0

I need to figure out how to extract previews from Adobe Lightroom as JPEG files.  I am trying to develop an external app that will read Lightroom's plugins - I need to do it in either C++, C# or Java.  So far all examples I found were in Lua.  Any help/code examples would be greatly appreciated.


Some thoughts / questions on createVirtualCopies() LR5

$
0
0

I've been playing a little with the createVirtualCopies funciton in LR5.

 

First adding the createVirtualCopies() function is great!

Thought / wise: could there be a similar function in the LrPhoto class, so that based on a photo a Virtual copy is created?

Then I'm not dependant upon any active selection.

 

Some questions:

  1. Why is it a catalog namespace?
    Now as a plug-in developer I have to deal with selected photos and I would love to create a Virtual copy on a particular photo object as I like.
  2. And what happens if the user selects a different photo when the plug-in is running?
  3. What is the return value?
    At least it is not a properly LrPhoto object.

I did a little test:

 

 

local LrDialogs = import 'LrDialogs'
local LrTasks = import 'LrTasks'
local LrFunctionContext = import 'LrFunctionContext'
local LrApplication = import 'LrApplication'

--[[--------------------------------------------------------------------------
Name          inspect
Purpose          module for listing a table
Source          https://github.com/kikito/inspect.lua
----------------------------------------------------------------------------]]
local inspect = require 'inspect'

LrFunctionContext.postAsyncTaskWithContext( "CreateVirtualCopyTest", function( context )

    LrDialogs.attachErrorDialogToFunctionContext( context )    local catalog = LrApplication.activeCatalog()
 local activePhoto = catalog:getTargetPhoto()
 LrDialogs.message( inspect (activePhoto:getDevelopSettings()) )

 if activePhoto ~= nil then
 local virtualCopy = catalog:createVirtualCopies( "CreateVirtualCopyTest" )
 LrDialogs.message( inspect (virtualCopy:getDevelopSettings()) )
 else
 LrDialogs.message( "No photo selected! Please select a photo" )
 return
 end
end )

 

Any thoughts?

 

(Example based on code of Rob Cole.)

folder:getPhotos

$
0
0

My preliminary testing of the folder:getPhotos function indicated it was working as documented - attending to the "include-children" parameter as expected (and returning all photos in a folder, and subfolders if include-children parameter true. whether filtered or stacked...).

 

Now, it seems to be ignoring the include-children parameter and returning just the portion of photos that are contributing to the filmstrip, regardless of what I pass for the include-children parameter - its excluding those that are not top of stack, or are being excluded by lib filter...

 

This latter behavior is exactly what I want, but its really bugging me that I concluded it was working differently before. And of course I fear it will revert to the previous (documented) behavior if I turn my back on it...

 

Am I losing my mind?

 

This function is presently working perfectly!? (but it seems like it shouldn't!!!):

UPDATE: *** THIS FUNCTION NO LONGER WORKING (SEE BELOW), OR SHOULD I SAY IS WORKING HOW I EXPECT WHICH IS TO NOT WORK!!!

(my presently conclusion is that folder:getPhotos is flaky - behavior shifts between returning all photos in folder (subject to include-children parameter), and just those contributing to filmstrip, ignoring include-children parameter)

 

Am I losing my mind?

 

--- Get list of photos in filmstrip.

--

--  @usage this function *may* not be perfect, and may return photos even if excluded by lib filter or buried in stack.

--      <br>    presently its working perfectly, but I don't trust it, and neither should you!?

--      <br>    *** originally: function Catalog:getFilmstripPhotos( assumeSubfoldersToo, bottomFeedersToo )

--

--  @return      array of photos - may be empty, but never nil (should not throw any errors).

--

function Catalog:getFilmstripPhotos()

    --local subfolders

    --if assumeSubfoldersToo == nil then

    --    subfolders = false -- nil means true otherwise.

    --end

    local targetPhoto = catalog:getTargetPhoto()

    if targetPhoto == nil then

        return catalog:getTargetPhotos()

    end

    local sources = catalog:getActiveSources()

    if sources == nil or #sources == 0 then

        return {}

    end

    local photoDict = {} -- lookup

    local filmstrip = {} -- array

    local function addToDict( photos )

        for i, photo in ipairs( photos ) do

            --if not bottomFeedersToo then

            --    local isBuried = cat:isBuriedInStack( photo )

            --    if isBuried then

            --        --

            --    else

            --        photoDict[photo] = true

            --    end

            --else

                photoDict[photo] = true

            --end

        end

    end

    local function getPhotosFromSource( source )

        if source.getPhotos then

            -- local photos = source:getPhotos( subfolders ) -- reminder: nil parameter behaves as true, not false.

            local photos = source:getPhotos() -- At the moment, this function is doing exactly what I want: returning the photos as they contribute to filmstrip,

            -- and excluding bottom feeders - its ignoring the "include-children" parameter. I could have sworn it was previously attending to said parameter as documented.

            -- Although I'm glad it is behaving as it is, I fear problems that go away by themselves will return by themselves. ###3 - good for now I guess...

            addToDict( photos ) -- assure no duplication, in case overlapping sources.

            return

        elseif source.getChildren then

            local children = source:getChildren()

            for i, child in ipairs( children ) do

                getPhotosFromSource( child )

            end

        elseif source.type then

            app:logWarning( "Unrecognized source type: " .. source:type() )

        else

            app:logWarning( "Unrecognized source: " .. str:to( source ) )

        end

    end

    local sources = catalog:getActiveSources()

    --local sc = 0

    for i, source in ipairs( sources ) do

        --sc = sc + 1

        getPhotosFromSource( source )                           

    end   

    for k, v in pairs( photoDict ) do

        filmstrip[#filmstrip + 1] = k

    end

    return filmstrip

end

 

Thanks for any light you can shed,

Rob

How to package ImageMagick binaries?

$
0
0

My plugin uses ImageMagick's convert and, rather than hassle users with downloading it themselves, I'd like to package it with the plugin. This seems straightforward for Windows since IM provides builds of convert.exe. OSX is not so clear since IM suggests building that from source. I'm not going to ask users to use Homebrew if I can avoid it and I don't want to provide my own build. Any tips from people here about what they've done to package IM tools?

 

db

Dynamically updating UI (binding, maybe?)

$
0
0

So I am writing an export plugin for lightroom. I need to update the export UI dynamically after getting a result from Lrhttp.post. The code is underlined below. Basically, how can I display to the user that their login is successful by dynamically updating the export UI after they click the submit button (I want the last row to display whether the login was a success or not)? I could not find a UI refresh function in the LR API.

 

I tried looking at Lr.Binding to try to bind resultlogin but that did not work as intended. Any suggestions? Thanks!

 

 

 

 

 

ExportDialogSections = {}

function ExportDialogSections.sectionsForTopOfDialog(f, propertyTable)
           return {                    {                              title = "...",                              --                              f:row {                                        spacing = f:control_spacing(),                                        f:static_text {                                                  title =  "Username",                                                  width = share 'labelWidth',                                                  alignment = 'right',                                        },                                        f:edit_field {                                                  value = bind 'Username',                                                  width_in_chars = 40                                        },                              },                              --                              f:row {                                        spacing = f:control_spacing(),                                        f:static_text {                                                  title = "Password",                                                  width = share 'labelWidth',                                                  alignment = 'right',                                        },                                        f:password_field {                                                  value = bind 'Password',                                                  width_in_chars = 40                                        },                              },                              --                              f:push_button{                                        title="Submit",                                        action = function( button )                                                  import "LrTasks".startAsyncTask( function()                                                            resultlogin = LrHttp.post(...)                                                  end )                                                  if resultlogin == "success" then                                                            --send username to exporttask and display username is valid                                                            sendUsername(...)                                                  else                                                            sendUsername(...)                                                  end                                        end,                              },                              f:row {                                        spacing = f:control_spacing(),                                        f:static_text {                                                  title = resultlogin,                                                  width = share 'labelWidth',                                                  alignment = 'right',                                        },                              },                    --                    }          }
end




return ExportDialogSections

LrView.osFactory:picture clickable?

$
0
0

I'm generating a filmstrip of pictures in my lightroom plugin and I would like to make them clickable. Is this doable, or do I have to put a button next to each one?  It would be acceptable to have a bunch of buttons with pictures on them, but that doesn't appear to be possible in the SDK.

Viewing all 53524 articles
Browse latest View live