6 Replies Latest reply on Mar 16, 2011 2:09 AM by DawMatt

    Is this line of code a bug in the example Flickr Publish Service in the SDK?

    AlanUniqueName Level 2

      I am a Lua newbie and I’m struggling to understand one line of code within the Flickr Publish Service sample code line 995 from the file FlickrExportServiceProvider …

       

           local hidden = exportSettings.hideFromPublic and 2 or 1

       

      where earlier in the file (line 698) the hideFromPublic is bound to a checkbox which appears to simply have default settings (no set values) so I presume should return either false or true into hideFromPublic?

       

            f:checkbox {

                    title = LOC "$$$/Flickr/ExportDialog/HideFromPublicSite=Hide from public site areas",

                    value = bind 'hideFromPublic',

                    },

       

      Am I correct that the above assignment is equivalent to this?   ….

       

      local hidden

      If exportSettings.hideFromPublic then

          hidden = 2

      else

         hidden = 1

      end

       

      If the above is correct I also have some additional confusion because if a photo is re-published, this “hidden” value is passed (line 1019) to the Flickr function flickr.photos.setSafetyLevel

       

             FlickrAPI.callRestMethod( exportSettings, {

                                        method = 'flickr.photos.setSafetyLevel',

                                        photo_id = flickrPhotoId,

                                        safety_level = safety_level,

                                        hidden = hidden,

                                 } )

       

      And the Flickr API definition

       

      http://www.flickr.com/services/api/flickr.photos.setSafetyLevel.html

       

      for this function seems to suggest that hidden should be 0 or 1.    Reinforcing again that I do not understand the assignment to hidden shown above, or perhaps it is an Adobe bug or Flickr API mistake or change?   Or perhaps I simply do not know how the Flickr API works!

       

      Any help in understanding this would be appreciated … and again I apologise if I have missed the obvious.

      Alan.

       

      PS – I am trying to investigate a bug (I’ve already reported) where on republishing a photo from LR it gets hidden from public searches.
      See ….   
      http://forums.adobe.com/thread/796350?tstart=0

        • 1. Re: Is this line of code a bug in the example Flickr Publish Service in the SDK?
          DawMatt Level 3

          Hi Alan,

          AlanUniqueName wrote:

           

          I am a Lua newbie and I’m struggling to understand one line of code within the Flickr Publish Service sample code line 995 from the file FlickrExportServiceProvider …

           

               local hidden = exportSettings.hideFromPublic and 2 or 1

          ...

          Am I correct that the above assignment is equivalent to this?   ….

           

          local hidden

          If exportSettings.hideFromPublic then

              hidden = 2

          else

             hidden = 1

          end

           

          That is correct.  It is a Lua shortcut for translating true and false to different values.

           

           

          AlanUniqueName wrote:

           

          If the above is correct I also have some additional confusion because if a photo is re-published, this “hidden” value is passed (line 1019) to the Flickr function flickr.photos.setSafetyLevel

          ...

          And the Flickr API definition

          http://www.flickr.com/services/api/flickr.photos.setSafetyLevel.html

           

          for this function seems to suggest that hidden should be 0 or 1.    Reinforcing again that I do not understand the assignment to hidden shown above, or perhaps it is an Adobe bug or Flickr API mistake or change?   Or perhaps I simply do not know how the Flickr API works!

           

          Any help in understanding this would be appreciated … and again I apologise if I have missed the obvious.

          Alan.

           

          PS – I am trying to investigate a bug (I’ve already reported) where on republishing a photo from LR it gets hidden from public searches.
          See ….   
          http://forums.adobe.com/thread/796350?tstart=0

          It could be a bug in the Flickr plugin and your observations above do make it sound that way.  Or it could be a Flickr API change.  Have you tried the LR 3.4 RC?  It is possible this bug (if it is a plugin bug) has been resolved.  The sample code isn't updated when a minor Lightroom version is released so what you are reviewing might not be 100% up to date.

           

          Matt

          • 2. Re: Is this line of code a bug in the example Flickr Publish Service in the SDK?
            AlanUniqueName Level 2

            Hi Matt,

            Thanks for your reply.   I am already using the latest 3.4 RC but noticed this problem on 3.3 as well.


            There is also a second bug (not reported yet) in republishing photos in a Flickr publish service when the service is genuinely set to publish the photos hidden from public, the republish simply fails with …

             

            Flickr API returned an error message (function flickr.photos.setSafetyLevel, message Invalid argument)

             

            … could this be related?

             

            When problems arise with the Flickr Service some of the experts in the forum sometimes claim that despite it being high up the marketing feature sheet that the Flickr publish is only a “prototype” and not production quality …  I have heard this more than once …

            Clvrmnky ….

             

            “Now, the FB, Flickr service plugins are freely available to look at, so someone just needs to take the time to debug into it and find out where the communication is breaking down. Adobe is clearly shipping these more as proofs of concept, which is understandable from an enterprise dev standpoint -- when you have a public API it ends up being a full-time job for people to maintain the various examples. And those man-hours are just needed elsewhere”.      http://forums.adobe.com/message/3546511#3546511

             

            It is a shame that the code for these plugins are not made “open”, complete and up to date so that some of the experts in here can fix it or report exact bugs in it for a rapid turn round, and this is not helped by the SDK example not being up to date and the SDK documentation saying …

             

            This is more than a sample; it is most of the source code to the plug-in that Lightroom uses to implement its built-in Flickr support”

             

            I’m not complaining merely trying to get of my A…, learn Lua first and then do something about it as Clvrmnky suggested, but there’s not much point if the code is incomplete and out of date.

             

            Anyway, enough griping … do you think there is any value in me following up my previous bug report with another with this technical information?   I.e. the Line of code in question?

             

            I would also appreciate someone telling me if they too consider this code to be a bug.

             

            Alan.

            • 3. Re: Is this line of code a bug in the example Flickr Publish Service in the SDK?
              DawMatt Level 3

              Hi Alan,

              AlanUniqueName wrote:

               

              There is also a second bug (not reported yet) in republishing photos in a Flickr publish service when the service is genuinely set to publish the photos hidden from public, the republish simply fails with …

               

              Flickr API returned an error message (function flickr.photos.setSafetyLevel, message Invalid argument)

               

              … could this be related?

               

              Well based upon your earlier post, and once again assuming this is a bug with the plugin, it looks like this is a different symptom of the same bug. Looks like the hidden argument for one function takes 1 or 2 as the values, and another function takes 0 and 1 instead.  So if you select public (1) for one function it becomes hidden when republishing, and if you select hidden (2) it passes an invalid value when republishing.  Sounds like poor API design on behalf of Flickr (not that there aren't oddities in the LR SDK) and a testing oversight lead to a bug in the publish plugin.

               

              AlanUniqueName wrote:

               

              When problems arise with the Flickr Service some of the experts in the forum sometimes claim that despite it being high up the marketing feature sheet that the Flickr publish is only a “prototype” and not production quality …  I have heard this more than once …

              Clvrmnky ….

               

              “Now, the FB, Flickr service plugins are freely available to look at, so someone just needs to take the time to debug into it and find out where the communication is breaking down. Adobe is clearly shipping these more as proofs of concept, which is understandable from an enterprise dev standpoint -- when you have a public API it ends up being a full-time job for people to maintain the various examples. And those man-hours are just needed elsewhere”.      http://forums.adobe.com/message/3546511#3546511

               

              It is a shame that the code for these plugins are not made “open”, complete and up to date so that some of the experts in here can fix it or report exact bugs in it for a rapid turn round, and this is not helped by the SDK example not being up to date and the SDK documentation saying …

               

              This is more than a sample; it is most of the source code to the plug-in that Lightroom uses to implement its built-in Flickr support”

               

              I think this is mixing two points here. 

               

              Firstly I don't know whether I'd say the Flickr (etc) plugins provided by Lightroom are prototypes.  They are probably sufficient for many users and I'm sure Adobe will fix the bugs when they are reported and can reproduce them.  The issue is that the APIs provided by the websites (especially Facebook) keep changing and Lightroom updates tend to come out in lockstep with Camera Raw.  That can mean there will be a period of time when the plugin will have (known) issues because the website changes and Adobe they won't release a Lightroom dot release just to fix a plugin issue.  This is one of the reasons I personally use Jeffrey Friedl's plugins instead of the inbuilt ones. Jeffrey can turn around fixes much more quickly than a large commercial vendor can.

               

              Secondly is the issue of the Flickr plugin sample/SDK not being re-released with each Lightroom dot release. While it would be nice if they did this I don't think it is necessary.  The point of the SDK (and samples) are to educate developers on how to write plugins using the SDK and not how to use the Flickr API.  The Flickr plugin sample doesn't need to be 100% working and up-to-date to achieve this. Yes, it would be helpful if it was up to date to assist with debugging of the plugin but that is a "side effect" rather than the main purpose for providing the sample.

               

               


              AlanUniqueName wrote:

               

              I’m not complaining merely trying to get of my A…, learn Lua first and then do something about it as Clvrmnky suggested, but there’s not much point if the code is incomplete and out of date.

               

              Anyway, enough griping … do you think there is any value in me following up my previous bug report with another with this technical information?   I.e. the Line of code in question?

               

              I would also appreciate someone telling me if they too consider this code to be a bug.

               

              I think it makes sense to provide the additional information to go with your earlier bug report.  The symptoms you are describing sound like a bug, but as I'm not using Flickr I can't test this myself right now.

               

              The source code you have in front of you will be close to what is in the product now.  The only differences are likely to be internal code (maybe some UI "candy") they don't want to share, and any updates to the plugin since the release of 3.0.  The chances of them touching the part of the code you are reviewing are low, and as long as you include the source code text (not just the line number) it will help them work out what is going wrong.

               

              Matt

              • 4. Re: Is this line of code a bug in the example Flickr Publish Service in the SDK?
                AlanUniqueName Level 2

                Matt,

                 

                Thank you for your time and advice and I understand and sympathetic to your comments about the lack of consistency in the Flickr API… however it is what it is, and it is still an Adobe bug on a fully fledged and important feature of the product,

                 

                so I have raised three bug reports

                 

                1)      The incorrect change of hidden status on a republished photo and information about the suspect line (area) of code.

                2)      The inability to republish photo when in a service deliberately marked to hide from public searches and again reference to the suspect code.

                3)      A specific bug report saying that the Lua code in the publish service may be in error.

                 

                With hope, something there will eventually result in some action.

                Also, thank you for your reference to Friedl’s plugin and I find it interesting that his change log also discusses being caught out by this specific Flickr API peculiarity – still an Adobe bug though!


                Although tempting to use his plugin to replace the faulty Adobe one I’m slightly reluctant to because I have already paid for this functionality in LR and I don’t particularly like relying long term on 3rd parties especially when only one person, despite the outstanding reputation he has.      I will consider my options but will possibly spend my time writing some external software to talk to Flickr to correct the errors created by LR.

                 

                Thanks again,

                Alan

                 

                PS – It is a shame Adobe doesn’t come to some commercial relationship with Friedl – Licence, employment or otherwise.   A Win, Win and customer Win relationship perhaps?

                 

                PPS – I assume updated plugin releases will be tied to LR releases but if this policy is true, it will be interesting to see what happens when one of Flickr, SmugMug etc make a breaking change in their APIs.   Food for thought?

                 

                 

                • 5. Re: Is this line of code a bug in the example Flickr Publish Service in the SDK?
                  clvrmnky Level 4

                  I recall that line in the Flickr example code is a bug. Either it never worked as written, or the Flickr API changed and it broke later. I recall looking at the safety stuff trying to make sense of it, but since my app doesn't support that part of the Flickr API I ended up tearing it all out.

                   

                  My comments regarding plugins was intended more to suggest that plugin development is probably at a lower priority than other development. I did not mean to suggest that the example plugins are actually the basis for the shipping plugins. They probably share some pedigree (which is why they can be used as a way to test the plugins, in a pinch) but the shipping plugins are obviously more complete.

                  • 6. Re: Is this line of code a bug in the example Flickr Publish Service in the SDK?
                    DawMatt Level 3

                    Hi Alan,

                     

                    AlanUniqueName wrote:

                     

                    ... however it is what it is, and it is still an Adobe bug on a fully fledged and important feature of the product,

                     

                    so I have raised three bug reports

                    ...

                    PPS – I assume updated plugin releases will be tied to LR releases but if this policy is true, it will be interesting to see what happens when one of Flickr, SmugMug etc make a breaking change in their APIs.   Food for thought?

                     

                    Thanks for taking the time to raise these bug reports.  I wasn't trying to dissuade you from raising them because if it is a bug it needs to be fixed, but was trying to set expectations around the timeframe it would be resolved in.  And this "breaking change" issue is one of the reasons I use Jeffrey's plugins even if an equivalent is included with Lightroom.  He will respond quicker to these issues because he doesn't need to work within the constraints of large company development processes and schedules.

                     

                    AlanUniqueName wrote:

                     

                    Although tempting to use his plugin to replace the faulty Adobe one I’m slightly reluctant to because I have already paid for this functionality in LR and I don’t particularly like relying long term on 3rd parties especially when only one person, despite the outstanding reputation he has.      I will consider my options but will possibly spend my time writing some external software to talk to Flickr to correct the errors created by LR.

                     

                    You can choose to take a moral or a pragmatic standpoint on this issue. I've gone with the pragmatic approach and Jeffrey's donation model is quite flexible so that shouldn't really influence the decision. Spending my own time to code a workaround when a plugin with ~3 years pedigree and better functionality is available is not a call I would make.

                     

                    Clvrmnky, thanks for your contributions to this discussion as well.

                     

                    Matt