Board index PBase Feature Requests Adobe Lightroom PBase Export Plugin - PBasic v1.0

Feature Requests

Adobe Lightroom PBase Export Plugin - PBasic v1.0

Request changes or modifications.
ericm1461
 
Posts: 1

Re: Adobe Lightroom PBase Export Plugin - PBasic v1.0

Post Thu Jul 23, 2009 5:50 am


Sorry, but I cannot figure out how this works.

I loaded the plug-in and it shows in the plug-in manager, but I can't see how it is supposed to wrk.

Thanks in advance,
Eric

ac
 
Posts: 240

Re: Adobe Lightroom PBase Export Plugin - PBasic v1.0

Post Sat Aug 08, 2009 7:19 am


Hi lucidity,
PBase Export Plugin has stopped working for me. I sent you an e-mail explaining what happened.
I think that the mistake don't come from me (or my computer) but from PBase. Not sure.
Can you stop your holidays asap and come back to help :)
ac

lucidity
 
Posts: 27

Re: Adobe Lightroom PBase Export Plugin - PBasic v1.0

Post Thu Aug 20, 2009 3:12 am


Hi people, sorry I haven't been active with this - I haven't renewed my Pbase account.

Just to give an overview of the plugin, it was based on the flickr plugin that is floating around somewhere.

The process of the plugin is this:

[*]Logs into PBase with you username and password. NOTE: This is as secure as logging in to PBase with Internet Explorer, as lightroom uses the internet explorer engine i think. At no point is you username or password transmitted any where (you can check the code to see this - its written in plain text), but it is saved wherever lightroom saves settings.
[*]Send a request to PBase asking for your galleries and photos (this is public info)
[*]Display them in the GUI for you to choose.
[*]When you hit export it creates a html POST request the same as what is created if you submit a photo manually. In the post request it writes the final image data, then sends that to PBase. This is repeated for all photos.
[*]The reply from pbase is checked to see that the photos uploaded ok
[*]If you select the option to write metadata it creates a POST request to write this to pbase as well.

I'm not sure why it isn't working now ac.. either lightroom changed or pbase changed. I will have a look asap :)

Oh yea 7 days a week working is not holidays hahaha

lucidity
 
Posts: 27

Re: Adobe Lightroom PBase Export Plugin - PBasic v1.0

Post Sat Aug 22, 2009 1:49 pm


ericm1461 wrote:Sorry, but I cannot figure out how this works.

I loaded the plug-in and it shows in the plug-in manager, but I can't see how it is supposed to wrk.

Thanks in advance,
Eric


Go to File -> Export...

In the export dialog at the top right where it says "Export selected photos to:" underneath that is a title usually saying "Files on disk"
Click "Files on disk" and select "Export to PBase" from the pop up menu
Fill in your username and password and good luck.

lucidity
 
Posts: 27

Re: Adobe Lightroom PBase Export Plugin - PBasic v1.0

Post Sat Aug 22, 2009 1:59 pm


callieian wrote:I installed this in Lightroom on my XP laptop while travelling and it worked great! Everything was perfect ... Now I'm home and transferred everything to my PC and the plugin won't connect to my pbase account. The only thing I can think of is that I am using 64-bit Vista installation of Lightroom. Would this make a difference to how the plugin connects?


I don't have 64-bit windows so that could be the problem. Maybe character strings are done differently on the 64 bit so what I am sending to PBase to log in is not correct. Do it actually say "Login failed" or does it just sit there waiting?

By the way this is the plugin code to login:

response, headers = LrHttp.post(
"http://www.pbase.com/login",
"login_id="..propertyTable.username.."&password="..propertyTable.password.."&view=&r=&submit=login",
{{field = "Content-Type", value = "application/x-www-form-urlencoded"}})

you could try changing the PBasicAPI.lua file (just edit in notepad) to hard code your user name and password in there and see if that works

response, headers = LrHttp.post(
"http://www.pbase.com/login",
"login_id=your_user_name&password=your_password&view=&r=&submit=login",
{{field = "Content-Type", value = "application/x-www-form-urlencoded"}})

dvas
 
Posts: 11

Re: Adobe Lightroom PBase Export Plugin - PBasic v1.0

Post Sun Oct 04, 2009 8:51 pm


I tried today the Lightroom Pbase plugin first time after the pbase was done recently and it is not working any more.
The new folder function is working, but when trying to upload the pics, I am getting the following error message:

Unable to Export:
An internal error has occured: [string "PBasicUploadTask.lua"]:153: bad argument #1 to 'gsub' (string expected, got nil)

is anyone else getting this/

I am using LR2.5 (the latest build).

thanks,
Sasha

ac
 
Posts: 240

Re: Adobe Lightroom PBase Export Plugin - PBasic v1.0

Post Sat Oct 31, 2009 5:14 pm


I have installed your PBasic in Lightroom 3 Beta, and it installed.
But doesn't work.
They suggest another syntax, but it still doesn't work :
LrCatalog:withCatalogDo replaced by LrCatalog:withReadAccessDo
I keep trying.
Thanks again.

fimkap
 
Posts: 1

Re: Adobe Lightroom PBase Export Plugin - PBasic v1.0

Post Thu Dec 24, 2009 12:40 pm


It works in LR 3 Beta on XP 32-bit. I have just used withReadAccessDo in PBasicUploadTask.lua and reenabled the plugin from plugin manager. Thank you very much for this plugin. I will give it a try on my home LR 2.4 on Win7 64-bit.

reneg
 
Posts: 29

Re: Adobe Lightroom PBase Export Plugin - PBasic v1.0

Post Fri Jul 23, 2010 1:01 am


HI Lucidity,

Will you update your plug-in for Lightroom 3, Macintosh.

Your plug-in was faster than pBase interface.

Let us know.

Thanks a lot.

stephanedenis
 
Posts: 5

Re: Adobe Lightroom PBase Export Plugin - PBasic v1.0

Post Sun Jul 25, 2010 7:27 pm


Hi Lucudity,

fimkap wrote:It works in LR 3 Beta on XP 32-bit. I have just used withReadAccessDo in PBasicUploadTask.lua and reenabled the plugin from plugin manager. Thank you very much for this plugin. I will give it a try on my home LR 2.4 on Win7 64-bit.


Also works with LR3 final version on Windows 7 64bit.
Are you planning to change your module with the correction and adding new features?

Thank you

hkruse
 
Posts: 7
Location: Denmark

Re: Adobe Lightroom PBase Export Plugin - PBasic v1.0

Post Mon Nov 08, 2010 12:52 pm


The plugin does not work with Lightroom 3 on the Mac (I have not tried under Windows). I can logon but not export. An error occurs in that case is the following:

Image

I would be really great have one that works in Lightroom 3 and even better if it could be a publish service.

dbdors
 
Posts: 2

Re: Adobe Lightroom PBase Export Plugin - PBasic v1.0

Post Wed Jan 05, 2011 8:46 pm


Image

I'm using a PC and LR3 and I get a very similar error message, does not work with LR3.

stephanedenis
 
Posts: 5

Re: Adobe Lightroom PBase Export Plugin - PBasic v1.0

Post Fri Feb 04, 2011 2:12 am


Hello,
We must change the file "PBasicUploadTask.lua. I found all the information on the web and on the forum.
Below is a copy of the file:

Code: Select all
--[[

PBasicUploadTask.lua
Uploads the rendered photos

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

Copyright Ross Marchant 2008

Based on the Adobe Flickr plugin example

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

]]

--Lightroom API
local LrDialogs = import 'LrDialogs'
local LrErrors = import 'LrErrors'
local LrFileUtils = import 'LrFileUtils'
local LrHttp = import 'LrHttp'
local LrPathUtils = import 'LrPathUtils'
local LrTasks = import 'LrTasks'

local prefs = import 'LrPrefs'.prefsForPlugin()

local logger = import 'LrLogger'( 'PBaseAPI' )
local debug, info, warn, err = logger:quick( 'debug', 'info', 'warn', 'err' )

--Constructor
PBasicUploadTask = {}


--[[
   Process to upload the photos (is run as a task)
]]
function PBasicUploadTask.processRenderedPhotos( functionContext, exportContext )
   
   local exportSession = exportContext.exportSession
   local exportParams = exportContext.propertyTable
   
   --Check if gallery needs to be created
   if PBasicAPI.galleryList[exportParams.galleryName] and exportParams.createNew == "existing"
   then
      --Gallery exists... just upload there
   else
      --Check gallery isn't already created
      if PBasicAPI.galleryList[exportParams.galleryNameNew]
      then
         LrDialogs.message("A gallery with that name already exists!")
         return
      else
      --Gallery doesn't exist, create new
      
      --Strip punctuation
      exportParams.galleryName = string.gsub(exportParams.galleryName, "(%p)", "")
      exportParams.galleryName = string.gsub(exportParams.galleryName, "(%s)", "_")
      exportParams.galleryName = string.lower(exportParams.galleryName)
      
      --Show progress
      local progressScope = exportContext:configureProgress{
         title = LOC( "$$$/PBasic/Upload/Progress=Creating gallery ^1 on PBase", exportParams.galleryName )
      }
      --Create new gallery
      local response = LrHttp.post("http://upload.pbase.com/edit_gallery/"..prefs.username.."/"..exportParams.galleryName,
         "parent_gid="..PBasicAPI.galleryList[exportParams.galleryName].."&gallery_name="..exportParams.galleryNameNew.."&submit=New+Gallery",
         {{field = "Content-Type", value = "application/x-www-form-urlencoded"}})
      --Set to place uploaded images at end
      local response = LrHttp.post("http://upload.pbase.com/edit_gallery/"..prefs.username.."/"..exportParams.galleryNameNew.."&view=sequence",
         "gallery_placement=L&image_placement=L&submit=Update+Placement+Settings",
         {{field = "Content-Type", value = "application/x-www-form-urlencoded"}})
      progressScope:done()
      end
      --Save gallery name
      exportParams.galleryName = exportParams.galleryNameNew
      prefs.galleryName = exportParams.galleryNameNew
      prefs.galleryNameNew = ''
      --Set option to existing
      prefs.createNew = "existing"
   end
   
   
   --Set progress title.
   local nPhotos = exportSession:countRenditions()
   local progressScope = exportContext:configureProgress {
                  title = nPhotos > 1
                           and LOC( "$$$/PBasic/Upload/Progress=Uploading ^1 photos to PBase", nPhotos )
                           or LOC "$$$/PBasic/Upload/Progress/One=Uploading one photo to PBase",
               }

   --Save off uploaded photo IDs so we can take user to those photos later.
   --local uploadedPhotoIds = {}
   local nuploadedPhotos = 0;

   --Iterate through photo renditions.
   for i, rendition in exportContext:renditions{ stopIfCanceled = true } do
   
      --Get next photo.
      local photo = rendition.photo
      local success, pathOrMessage = rendition:waitForRender()
      
      --Check for cancellation again after photo has been rendered.
      if progressScope:isCanceled() then break end
      
      if success then

         --Build up common metadata for this photo.
         local title, description
         photo.catalog:withReadAccessDo( function()

            --Title
            title = photo:getFormattedMetadata 'title'
            if not title or #title == 0 then
               title = LrPathUtils.leafName( pathOrMessage )
            end
            
            --Description
            description = photo:getFormattedMetadata 'caption'
            
            --Post data to PBase
            local postUrl = "http://upload.pbase.com/edit_gallery/"..exportParams.username.."/"..exportParams.galleryName
            
            local mimeChunks = {}
            
            --File
            mimeChunks[ #mimeChunks + 1 ] = {
               name = 'fname',
               fileName = PBasicAPI.htmlEscapeString(title),
               filePath = rendition.destinationPath,
               contentType = 'image/pjpeg' }
               
            --Button
            mimeChunks[ #mimeChunks + 1 ] = { name = "submit", value = "Upload Image" }
   
            local result = ""
            --Post it and wait for confirmation.
            if LrTasks.pcall( function ()
               result = LrHttp.postMultipart( postUrl, mimeChunks )
               end   )
            then
               if exportParams.saveMetadata == "yes"
               then
                  --Set the gallery stuff
                  local imageId = string.match(result, [[update_image/(%d+)">]])
               
                  --local caption = photo:getFormattedMetadata 'caption'
                  local pString = { submit = "Update Image",
                                title = title,
                                caption = description,
                                artist = photo:getFormattedMetadata('creator'),
                                location = photo:getFormattedMetadata('location'),
                                shot_date = photo:getFormattedMetadata('dateTime'),
                                camera_body = photo:getFormattedMetadata('cameraModel'),
                                description = string.gsub(photo:getFormattedMetadata('exposure'), string.char(198,146), "f").." at "..photo:getFormattedMetadata('focalLength'),
                                keywords = photo:getFormattedMetadata('keywordTags'),
                                public_flag = "Y",
                              }
                  --LrDialogs.message("post: "..PBasicAPI.postString(pString))
                        
                  --Update image data
                  result = LrHttp.post("http://www.pbase.com/update_image/"..imageId,
                                  PBasicAPI.postString(pString),
                                  {{field = "Content-Type", value = "application/x-www-form-urlencoded"}})
               end
               nuploadedPhotos = nuploadedPhotos + 1
               --LrDialogs.message("Failure!!!")
            end         
         end )      
      end      
   end
   
   --Open gallery in browser for checking
   --LrDialogs.message( LOC ("$$$/PBasic/Upload/ProgressComplete=^1 of ^2 photos uploaded successfully", nuploadedPhotos, nPhotos) )
   if exportParams.openGallery == "yes"
   then
      LrHttp.openUrlInBrowser ("http://www.pbase.com/"..exportParams.username.."/"..exportParams.galleryName.."&page=all")
   end
end


Copy / paste the text found in the code section (with notepad), call PBasicUploadTask.lua and place it in the folder PBasic.lrdevplugin with other files.
For me it works well.
Bonne chance,
Stef

itemsis
 
Posts: 1

Re: Adobe Lightroom PBase Export Plugin - PBasic v1.0

Post Fri May 20, 2011 7:16 pm


There i can download the plugin? The link does not work anymore :(

bclee123
 
Posts: 46

Re: Adobe Lightroom PBase Export Plugin - PBasic v1.0

Post Sat May 28, 2011 3:04 pm


Anyone have a link that actually points to a file for downloading? All I get is a web page with not much on it.

thanks,
Brian Cook

PreviousNext

Board index PBase Feature Requests Adobe Lightroom PBase Export Plugin - PBasic v1.0

Who is online

Users browsing this forum: No registered users and 2 guests

cron