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

Exceeding limit of searchable field

$
0
0

Recently I changed metadata field entries by setting "searchable" (and "browsable") to "true" as described at Lightroom SDK guide chapter "Defining metadata fields", "Metadata field entries", page 74. As a result I got this error message:

Could not upgrade your catalog for plug-in metadata.

An internal error has occurred: Searchable strings must be less than 512 bytes; this value is 513 bytes

So, the plugin can't update the catalog and as a result the plugin is disabled.

The error message fits to the SDK description, stating "Strings stored in this field must not exceed 511 bytes."

The error message states not, which image of my catalog (and which metadata field) causes the error. So I don't have an idea how to identify the image and its field which has exceeded the limit. Without identification of the image(s) I'm not able to shorten the field entry/entries.
Any idea how I could deal with this situation?


Internal error aString!-nil

$
0
0

A plug-in that works correctly on PC is generating an error on the Mac. The plug-in adds a menu command and launches a dialog box, but running it on the Mac produces this error dialog:

 

Internal error has occurred - Invalid parameter not satisfying :  aString!-nil .

 

After that error occurs, the PlugIn Manager is unavailable (similar error message) and only becomes accessible after a restart. The plugin is shown to be running, but any subsequent attempt to run the menu item causes the error.

 

To eliminate the menu command's code, I have removed almost all the code, but the same problem happened. I have also replaced its code with code from another plug-in that does work on the Mac. Again no solution. I have also changed the LrToolkitIdentifier and plug-in name.

 

By now, I recognise enough of the messages to suspect that this is an odd one. Any thoughts?

 

John

Preferences for non-export plugins

$
0
0

Hi All,

 

I'm working on a plugin that will have an LrExportMenuItems entry, but is not an export service or filter.  As such the typical exportPresetFields entry that would allow me to automatically load and save plugin preferences doesn't seem to be an option for me.  But I do need to maintain state informatoin (preferences) across invocations of the plugin.

 

I've tried using "import 'LrPrefs'.prefsForPlugin()" to access preferences and then write changes back to the variable I save that value in (including rewriting some values to trigger the save).  LrPrefs doco in the SDK implies you can save preferences using this approach.  In most languages that wouldn't work but given the nature of LUA there was a chance.  Unfortunately this hasn't worked so far and I think it is because there is no export service or filter defined in this plugin.

 

Has anyone managed to easily save preferences for non-export plugins into the lightroom preferences file?  If not, what alternative approaches have people used to save state across invocations of your plugins?

 

Thanks,

Matt

 

PS Sean, John, in case your wondering a firewall was stopping the WYSIWIG editor from loading.  Killed the firewall and now I can post here and create new threads.  Stupid corporate laptop SOEs...

Protecting plugins

$
0
0

How does one go about compiling a Lightroom plugin so that the source scripts are at least 'obfuscated' into byte codes?  A simple invocation of luac doesn't seem to be the answer.

Feature Request: Alpha or Beta Document Of New Functions

$
0
0

Although I would like a working beta SDK, I'd settle for a rough document of at least some of the functions to be present, even if they change considerably before completion. A rough document would at least allow us plugin developers to start thinking about possibilities, even if we can't start coding / testing yet. I know it takes time for you to get stuff done - same here. Even a tiny cheat sheet that just lists the general areas where functionality will be added would be of great benefit.

?:0: attempt to call upvalue '?' (a nil value)

$
0
0

I can't seem to get rid of this error (' ?:0: attempt to call upvalue '?' (a nil value) ').  What is "?:0:" ?

 

Thanks in advance for any help!

 

script:

 

local LrApplication = import 'LrApplication'
local LrDialogs = import 'LrDialogs'
local LrFileUtils = import 'LrFileUtils'
local catalog = LrApplication.activeCatalog()
local LrTasks = import 'LrTasks'

 


    function searchNtag()
        local targPhotos = catalog.getAllPhotos()
        for _, photo in ipairs(targPhotos) do
            local status = photo:getPropertyForPlugin('com.jonathonlefaive.tagstatus', 'tagboolean')
            if status then
                if status == nil then
                    local location = photo:getRawMetadata('path')
                    if LrFileUtils.isDeletable(location) == true then
                        photo:setPropertyForPlugin('com.jonathonlefaive.tagstatus', 'tagboolean', false, 2)
                    else
                        photo:setPropertyForPlugin('com.jonathonlefaive.tagstatus', 'tagboolean', true, 2)
                    end
                end
            end
        end
    end

 

function task()
    catalog.withPrivateWriteAccessDo(searchNtag)
end

 

LrTasks.startAsyncTask(task)

propertytable in Plugin info provider

$
0
0

Can anyone tell me how the propertytable of the plugin info provider is shared with the rest of the plugin?

 

infoProvider.sectionsForTopOfDialog = function( f, propertyTable )
    propertyTable:addObserver('mySetting', myObserver)

 

    return {

      .. create a radio button that binds its value to 'mySetting'

    }

}

 

 

I'm running into two problems with this:

1. the observer doesn't seem to work, at least for a radio button. My function myObserver never gets called if I change the radio button settings

2. any value set into propertyTable isn't visible in the propertyTable passed into the exportServiceProvider's startDialog function.

 

These two issues prevent me from being able to do anything useful with selection elements in the PluginManager. I can't see them in the ExportServiceProvicer class, and I also can't find a way to persist them (ie in the plugin prefs) within the PluginManager dialog.

 

Am I doing something wrong? does anyone know of a way to use selection elements in the PluginManager and persist them and/or bind to them?

thanks

Peter

exportServiceProvider.allowFileFormats

$
0
0

I am trying to write a publish service provider that works with originals only. When I set the allowFileFormats to { 'ORIGINAL' }, the File Settings section in the configuration dialog is grayed out with Original selected. This is what I expect. But when I publish photos, they are always rendered as jpgs. If I remove the allowFileFormats setting from my plugin and explicitly choose Original in the File Settings section, then the photos are rendered in their original form. This sounds like a bug to me. Is there anything I can do to work around this?

 

Thanks!

Andy


Bug Report: LrPrefs.prefsForPlugin()

$
0
0

Had a strange bug:

 

Was working on a plugin, when suddenly got error:

 

     "Table is excessively nested" (dunno which "Table")

 

Finally traced it to the line with:

 

LrPrefs.prefsForPlugin().

 

Changed it to:

 

LrPrefs.prefsForPlugin( _PLUGIN )

 

And all is well.

 

Note: this is repeatable for one plugin ( i.e. delete the _PLUGIN parameter and the problem recurs ), but the other plugins aren't having the problem nor did this one until all of a sudden after making seemingly innocuous change.

 

PS - Passing _PLUGIN.id does not solve the problem, it has to be the plugin object proper - contrary to documentation.

 

Rob

Specifying ExportServiceProvider when Invoking Export

$
0
0

I am trying to programatically kick off an export and I have looked all over but cannot figure out how to specify which export service provider to use in the export. exportSettings covers lots of stuff but not which ExportServiceProvider. This seems like it should be obvious.

Problems with persistant properties in export plugin.

$
0
0

This is driving me mad. I'm trying to ensure that two properties in my Export plugin SectionsFOrTopOfDialog remain persistent. I'm using:

 

 

exportServiceProvider.exportPresetFields = {

  {

  {key = 'ScriptPath', default = ''},

  {key = 'KeyWords', default = '' }

  }

}

 

and I have value = LrView.bind(  'KeyWords' ) and value = LrView( 'ScriptPath' ) defined in each of two edit_fields. They are persistant to a point; if I add to the preset list on the left with values in each of the edit fields, pick another preset then pick the one I've just saved, the values are there. However, if I hit export or quit the export dialog then return to it the values are no longer there.

 

What's the blindingly obvious thing, if any, that I'm missing?

Working with LRSocket, receiving

$
0
0

I'm trying to set up a communication between Lightroom and another process using LRSocket. I've worked out an LrSocket.bind with mode = "send" and that's all working fine but I cannot for the life of me get a receive working. Here's my Lua code:

 

 

Connection = {

}

function Connection.Listen( self, context )

 

        local running = true

 

        self.Listener = LrSocket.bind {

 

       functionContext = context,

            port = 4242,

            plugin = _PLUGIN,

            mode = "receive",

 

            onConnected = function( socket, port )

                 Debug.logn( "Listener connected on port " .. port )

            end,

 

            onMessage = function( socket, message )

                 Debug.logn( "Listener Got: " .. message );

            end,

 

            onClosed = function( socket )

                 Debug.logn( "Listener Closed on Port: " .. myPort )

                 running = false

            end,

 

            onError = function( socket, err )

                 if err == "timeout" then

                 end

            end,

 

  } -- bind

 

  while running do

  LrTasks.sleep( 1/2 ) -- seconds

  end

 

  self.Listener:close()

 

 

end

 

I've been testing with both telnet and a short python snippet shown below. Telnet fails to connect at all, the Python code connects and the onConnected callback is called but, although text is being sent, the onMessage callback doesn't get called. I wondered if anyone had managed to make this work at all or if anyone has any pointers on what might be going wrong.

 

import socket, select, sys, time

 

def Send( msg ):

 

    TCP_IP = 'localhost'

    TCP_PORT = 4242

    BUFFER_SIZE = 1024

    MESSAGE = "Hello, World!"

 

    print "Sending on port ",  TCP_PORT

 

    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

    s.settimeout(2)

    s.connect((TCP_IP, TCP_PORT))

    s.send(MESSAGE)

    print "Sent"

    s.close()

 

    time.sleep( 5 )

    print "Closed"

 

Send( "Test")

 

Many thanks.

Is XPath supported in LrXml?

$
0
0

Maybe it's not cause I cannot find anything about it. Can I use modules written for standard Lua 5.1 like LuaXPath?

Writing to external files

$
0
0

Is there any documentation in addition to the standard SDK documet?

 

I have to challenges:

 

1. What LUA code do i use inside a typical "grid" to write seomthing to an external file ?

 

2. How can I change settings for the stahdard image files. For example, I like to output the large files with a different JPEG compression than the thumbnails.

Strange nil value problem

$
0
0

Hi everyone,

 

I've been working on a Lightroom plugin for and I have an interesting problem, where values that should be not nil prior to export (ie they must be true for the export button to be enabled) are then nil afterwards. It happens for some users of the plugin, but not all, and the tricky thing is I can't reproduce it myself.

 

The user selects an event for their photos etc via a dialog and then exports.

There is an observer function on several variables to check if the chosen parameters are correct/sane etc.

 

After checking several variables the last one is :

 

function DialogSections.updateCantExportStatus( propertyTable )

 

..

.

 

if propertyTable.loggedIn and propertyTable.finishedLoading and propertyTable.chosenEvent and (propertyTable.category or propertyTable.auto_create) then

                         propertyTable.LR_cantExportBecause = nil

                         propertyTable.LR_canExport = true

        return

end

 

The problem occurs later in the processRenderedPhotos function.

I get a copy of propertyTable via:

 

function FTPUploader.processRenderedPhotos(functionContext, exportContext)

          local exportSession = exportContext.exportSession

          local exportParams = exportContext.propertyTable

and then immediately afterwards in the code, for some users the following error is triggered:

if not exportParams.chosenEvent then

                              LrErrors.throwUserError( LOC "$$$/Upload/Errors/InvalidParameters=Please choose an event from the dialog before exporting." )

                              return

          end

 

So it seems the chosenEvent variable is nil, when it had to be not nil in order for the export button to be able pressed in the first place. The button enabled/disabled state is working correctly.

 

Is it right to assume that propertyTable variables are visible between the dialog being displayed and the export taking place?

 

The fact that it only happens to some people makes me think some kind of race condition, but that last if-clause is the only place where the export button is set to be enabled.

 

If anyone has seen this kind of thing happening before, I'd really appreciate any help!

 

Best regards,

 

Chris.


Is there a way to conditionally enable/disable library menu (plugin extras) options?

$
0
0

Either there is a way, or I dreamt there is a way to disable / conditionally enable items on the library menu (plugin extras). - or export/file menu...

 

My imagination? (I could find nothing in the Pgmr's Guide)

How to remove entries from LrPrefs

$
0
0

Hi,

 

how can I remove entries (key/value) from the table returned by LrPrefs.prefsForPlugin()?

I tried several things (like setting value to nil, removing the plugin) but the entries are still present. Now the prefs-table is poluted with entries from testing.

 

Kind regards,

Tim

lua, split string

$
0
0

This is almost embarrassing to ask about but I'm stuck. I'm trying to split a string at whitespace. I'm broadly assuming that string.gmatch() returns an array, which it appears to do in the loop example below. However if I try and grab an element from the return value it throws up an error, telling me it's a function. Can anyone help:?

 

local example = "an example string"

-- works as expected.
 for i in string.gmatch(example, "%S+") do
  Debug.logn(i)
end

-- tells me s is a function
Debug.logn( string.gmatch( example, "%S+" ) )

-- tells me I'm trying to index a function value
Debug.logn( s[1] )

Open Images in PS CC as layers and start action from LR plugin

$
0
0

Hi,

 

I want to write a LR plugin which opens the selected pictures in PS CC and execute an action in  PS, save the image and add it to the catalog. Any idea how to proceed?

Windows new line in text-input

$
0
0

Hi all,

 

I'm working on a plugin and I have a problem on Windows


I have a text field :

f:edit_field {

      fill_horizontal = 1,

      value = bind 'description',

      alignment= 'center',

      height_in_lines = 8,

    }

 

where I allow new lines. On Mac it works simply with ctrl + Enter
But on Windows I didn't find any solution. It launch other actions and there is no way to have a new line on the text (except copy and paste from other text editor)
Do you have any idea?

 

Thank you
Martin

Viewing all 53524 articles
Browse latest View live


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