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

How to find full path to active photo or thumbnail of it

$
0
0

Hello,

 

I'm new to the Lightroom SDK, so forgive me, if this question has been asked, but I have been at it for some days and can't figure it out.

 

The scenario which I'm trying to achieve is this:

 

Create a plugin that suggests keywords for an image based on what the image contains. The steps that I'm currently planning on taking are these:

 

1. Have a dialog that opens from the Plug-in Extras menu.

2. When the dialog is opened, I need to send a post multipart request, containing (preferably) a thumbnail of the image, or the original image for processing. When the response is received, keywords are added to the dialog and the user can check/uncheck them and add new keywords if he wishes.

3. When the editing part is done, the user hits a save keywords button to save the keywords as IPTC data to the image.

 

Currently I'm having problems sending the image via the LrHttp.postMultipart function. What I've tried is use the output value of a LrPhoto requestJpegThumbnail call, but it doesn't seem to work the way I think, so the best way I guess is to save the thumbnail somewhere on the file system and retrieve the full path for it, or retrieve the full path of the LrPhoto itself (which I can't seem to find out how to do).

 

In short what I am asking is how do I get the full path of a LrPhoto object, or how to save a thumbnail of it on the filesystem and retrieve the full path for it.


Question about how ExifMeta handles multivalued tags

$
0
0

Hi,

 

I have tested the ExifMeta (Great work, just what I needed!) to read face recognition data written by Picasa to RegionName, RegionType etc. fields in jpg metadata. Everything seems to work fine if there is only one name in the field but Picasa writes several values separated with commas like this:

RegionName     John Doe, Jill Doll

RegionType     Face, Face

etc.

 

In that case, the corresponding fields remain completely empty. So is this convention of writing several values separated by commas "standard" way of doing this? Is there any way to fix this?

 

Additionally, three Region category tags refuse to load giving the following error:

"Not updating due to error getting property, id: XMPmwgrs_RegionAppliedToDimensionsUnit, from: nil, to: pixel, err-msg: Attempt to access property "XMPmwgrs_RegionAppliedToDimensionsUnit" not declared in com.robcole.lightroom.ExifMeta's Info.lua"

 

This is minor problem but it would be nice to know how to handle this kind of error in the future. Do I need to declare these in the lua-code if I need them?

 

Looking forward to replies,

 

Mikko

photo:getRawMetadata( "gpsAltitude") always returns a positive value

$
0
0

I noticed, both on Windows 7 and Apple OS X 10.9 that calling the photo:getRawMetadata( "gpsAltitude") always returns a positive value.

Also when Lightroom in the user interface displays a negative value.

 

The strange thing is that the photo:getFormattedMetadata( "gpsAltitude") returns the right value, however formatted.

 

I reported the bug, see Lightroom 5 SDK photo:getRawMetadata( "gpsAltitude") gives always positive value also when it should be negative

 

I thought to document it also here for those who walk into this also.

How the SDK handles unicode

$
0
0

I spent several painful hours learning the following about how the SDK handles unicode characters -- perhaps I've missed where this is documented?  Here's what I learned:

 

- Lua strings are sequences of 8-bit characters (bytes).

 

- A unicode ZString is represented as a Lua string containing the UTF-8 encoding of the unicode ZString.  For example, the trademark character (TM) is unicode codepoint 2122 (hex), and the ZString LOC "$$$/unicode/tm=^U+2122" is represented as a Lua string of length three, the UTF-8 encoding of that character (decimal bytes 226 132 162).

 

- A posting from Adobe employee "escouten" last year said that all SDK APIs treat all Lua strings as UTF-8 encoding of unicode strings.  I've personally observed that with LrView, LrFileUtils, and LrTasks.execute, but haven't checked other APIs.  In particular, a Windows unicode filename will be returned by LrFilteUtils as a Lua string encoding the the filename in UTF-8.  Passing that filename in a command line to LrTasks.execute works correctly.  (But writing a Windows batch file with a UTF-8 filename won't in general work -- a topic for another day.)

Showing thumbnails of catalog images in export screen

$
0
0

hi there,

I'm working on an export plugin where I'd like the user to be able to select a single image from the photo selection, to use as the cover of an album. I want this to be done right from the export plugin, by displaying a pageable list of photo thumbnails (that were selected for export) and allowing the user to select one. However I can't find any examples or documentation that describe how to do that.

 

Is it possible at all to somehow use the LrView:picture with a Photo object as its source, to display a thumbnail rendition of a photo in the catalog? If not, are there any other techniques available to have the user select one image in the selection during the export process?

 

(I suppose something like this could be done by asking the user to flag or tag the cover image before going in the export dialog, but anything that integrates with the export dialog would be a far better user experience)

 

any suggestions appreciated,

thanks

Peter

LrLogger - any simple way to specify directory for logfile output?

$
0
0

I realize one can rewrite the log function to do whatever, but is there a way to simply specify a different directory for log output than the Lr default (documents), when using default implementation of LrLogger. - maybe config.lua?

LrHttp.get redirect and downloading a file "zip"

$
0
0

I trying to figure if I can use LrHttp.get to download a zip file via a URL that does a redirection can anyone help?

Writing Lightroom module

$
0
0

Has anyone tried to write Lightroom module (*.lrmodule)? I checked SDK API and it's quite limited (but i've seen nice plug-ins based on it).

I believe that module can have bigger possibilites than plug-in. I'm also interested if it breaks EULA.


Modifying Metadata with an Export Filter

$
0
0

I have managed to create an export filter that modifies exportSettings shown below but is there a way to set metadata on the image, preferably on a per image basis (renditionOptions only being evaluated once), I would like to set the metadata on the generated image but on the lightroom master copy is ok. Ideally will not have to rely on external tools like exiftool.

 

I think the commad would go in the for sourceRendition section, but not sure how you access or change the photos metadata.

 

Thanks

 

local function sectionForFilterInDialog( f, propertyTable )

  return {

    title = LOC "$$$/SDK/MetaExportFilter/SectionTitle=400x400 Filter",

  }

end

 

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

local function postProcessRenderedPhotos( functionContext, filterContext )

 

  local renditionOptions = {

    filterSettings = function( renditionToSatisfy, exportSettings )

      logger:info('renditionOptions'  ) 

      exportSettings.LR_size_maxHeight = 400

      exportSettings.LR_size_maxWidth  = 400

      exportSettings.LR_size_doConstrain = true

    end

  }

 

  for sourceRendition, renditionToSatisfy in filterContext:renditions( renditionOptions ) do

    -- Wait for the upstream task to finish its work on this photo.

    local success, pathOrMessage = sourceRendition:waitForRender()

  end

end

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

 

return {

  sectionForFilterInDialog  = sectionForFilterInDialog,

  postProcessRenderedPhotos = postProcessRenderedPhotos,

}

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

Problem with startAsyncTask to fill value into popup_menu items

$
0
0

Hi everybody,

 

I encountered a problem to fill the popup_menu items with a startAsyncTask function.

 

This is my function:

 

function getLabelColor(propertyTable)          local catalog = LrApplication:activeCatalog()          local labelColor = catalog:getLabelMapToColorName()          propertyTable.label_red = getKeyForValue(labelColor, "red") -- getKeyForValue return the key for the value          propertyTable.label_green = getKeyForValue(labelColor, "green")          propertyTable.label_yellow = getKeyForValue(labelColor, "yellow")          propertyTable.label_blue = getKeyForValue(labelColor, "blue")          propertyTable.label_purple = getKeyForValue(labelColor, "purple")
end

 

I run the async task on sectionsForTopOfDialog:

 

function exportServiceProvider.sectionsForTopOfDialog(f, propertyTable)          LrTasks.startAsyncTask(function ()                    getLabelColor(propertyTable)          end)          return MLDialogs.settings(f, propertyTable)

end

 

On my MLDialogs.settings function I've this:

 

f:popup_menu {     title = LOC "$$$/ML/ExportManager/ASLabel=Color label for Dual ISO file :",     items = {           { title = "", value = "" },           { title = propertyTable.label_red, value = "red" }             { title = propertyTable.label_yellow, value = "yellow" },          { title = propertyTable.label_green, value = "green" },          { title = propertyTable.label_blue, value = "blue" },          { title = propertyTable.label_purple, value = "purple" },     },     value = bind "label",     size = 'small'
},

 

When I run the plugin, it display the value from the color label, but if I change the values for the color, when I run the plugin, the display values is the old (but on the log I've the new, so the title isn't refreshed).

 

I found that the async function return value after sectionsForTopOfDialog is displayed.

I try to change title = propertyTable.label_red to title = bind 'label_red' but I've an error:

 

Invalid parameter not satisfying: aString != nil

 

you can found the source here https://bitbucket.org/kichetof/lr_cr2hdr/src

 

I hope you can help me!

Cheers

Tof

function publishServiceProvider.metadataThatTriggersRepublish( publishSettings ) issue in Mac

$
0
0

This is the function where I am trying to set custom metadata tagset for my plugin to true so that when user will update those metadata then it would be marked for Re-publish. However this only works for Lightroom in Windows and not for Lightroom in Mac. Below is the snippet of this function.

 

function publishServiceProvider.metadataThatTriggersRepublish( publishSettings )

  return {

  default = false,

  title = false,

  caption = true,

  keywords = true,

  [ "com.custom.publisher.category" ] = true,

  }

end

 

 

I am using Lightroom 5.

4000. + a question re external files.

$
0
0

Hey folks, seeing as I hang here most, I figure it's the best place for my 4000th post on Adobe Forums (get a life!).

 

Does anyone have a little tutorial on passing the rendered photos to an external file? I want it inside a normal plugin, not as a post process action.

 

It's for an entirely personal project, passing images to ffmpeg to have my timelapse movies created with an export from Lightroom.

Schema Error on Mac

$
0
0

I am trying to fix a problem with my plugin, but it works fine under windows. I get the following error on OSX when Lightroom is opened.

 

An error occurred while reading the schema for the plug-in "PluginName". The plug-in will be disabled.

 

 

It disables the plugin but I can enable in plugin manager and view all the custom metadata in Lightroom.

 

Why is this happening on the Mac and not PC?

 

I am also getting something about access to a undefined global in in mac, but this gobal has nothing to do with the schema?

create glugin in 1 file

$
0
0

How to create glugin in 1 file the same facebook glugin .

 

Thanks,

Dung


Obtaining the value of the Temp and Tint sliders?

$
0
0

photo:getDevelopSettings() provides two fields, "IncrementalTemperture" and "IncrementalTint", which are non-nil only if the Temp and Tint sliders have been explicitly changed from their default settings.

 

Does anyone know if it's possible to get the value of the Temp and Tint sliders, regardless of whether they've been changed?  An Any Filter user wants to find all photos with a given temperature, regardless of whether he's changed the sliders or not.

creating tables (or other persistent data structures) in Lightroom Lua

$
0
0

I have a complex data structure I want to be able to add to a Lightroom plugin.  I know Lightroom uses a SQLite database. Can I add tables to that database from either inside a Lightroom plugin or externally?  I see no documentation of any API capabilities granting direct queries of the SQLite database and as of now it's looking like the only technique I have at my disposal is to create my own homebrewed database system using the file system. I would like that not to be the case.  Does anyone have any guidance for me?

Any samples of the combination lightroom:// and Java

$
0
0

Due to limitations in the UI capabilities of the Lightroom SDK I would like to create a front-end in Java and have it communicate with Lightroom via a HTTP manner with lightroom://.

So sending a HTTP request with <scheme>://<authority><path>?<query>#<fragment>and then have Lightroom send the requested information.

 

With great interest I have looked at the LRCookmark plug-in of Rob Cole.

He uses for example "lightroom://com.robcole.lightroom.Cookmarks/iBlacks2012=-10&iShadows2012=-10&iHighlights 2012=10"

 

I know I can connect via JDBC directly from Java to the Lightroom SQLite database, but my conviction is that this is not the way to go.

In my opinion all (write, update and delete) access to the Lightroom database should be done via the Lua API in order to use the business logic in the API.

 

Question: has anyone experience with this would like a very basic sample.

A very small working sample would help me getting started.

How do I remove spaces and special characters from the file name during rendering?

$
0
0

I understand that I can set LR_renamingTokensOn to true, but I would like to replace all spaces in the file name with an underscore and remove characters not in the range A-Z and 0-9. What's the easiest way to achieve this?

User Scripting (not plugins) in Lightroom?

$
0
0
Hi,

I don't know if any of you have been following the Export Keywords problem, but a KB article including a fix has been published about it. http://kb.adobe.com/selfservice/viewContent.do?externalId=kb405074&sliceId=2

This wouldn't normally be a subject for this forum, but the fix (an SQL update) is delivered via a .lua file that is:
* installed into a Scripts directory in the Lightroom presets directory (it wasn't present on my system prior to this)
* Enables a Scripts menu (to the right of the Window menu) and the first item is "Open User Scripts Folder"
* presents a dialog box (with a few options) that runs the SQL then restarts the product

Why I'm interested is it appears the Lightroom team has already baked a User Scripting mechanism into the product, beyond the plugin SDKs that have officially been announced. This hints at wider capability for us to extend the product - that certainly grabs my attention.

This is the first time I've seen any form of scripting (beyond that included in the Plugin SDK) publicly acknowledged albiet indirectly. Does anyone know where to find documentation about User Scripting capabilities/SDK/etc? Can anyone glean additional information from the fix that was published? I'm hoping one of you more experienced development types may be able to shed more light on this.

Thanks,
Matt
Viewing all 53524 articles
Browse latest View live


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