• Resolved dawolfat

    (@dawolfat)


    Hi,

    Great plugin and exactly what I was looking for to display my flickr Albums on my website.

    I have added some flickr albums and they display fine in the “justified random” view. When clicking on the image, they open in the lightbox without a problem. But some images just show the flickr “this image does not exist” placeholder in the lightbox. Thumbnails are all okay, only the 1600px wide images in the lightbox show this instead of the image: https://s.yimg.com/pw/images/en-us/photo_unavailable.png

    Is this a flickr issue? Any help would be appreciated.

    Thanks,
    Daniel

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Sayontan Sinha

    (@sayontan)

    Without a URL I cannot say for sure, but my guess would be that the specific size you are trying to show doesn’t exist in Flickr for that image.

    Thread Starter dawolfat

    (@dawolfat)

    The site in question is: https://danielwolf.photography/

    See photo 10 for example (red dress). It’s the first one that does not work in the lightbox view. Down below a few more have the same problem.

    The link the lightbox is trying to open is: https://farm9.static.flickr.com/8173/7974255288_1ac2f12a62_h.jpg

    If I go to flickr to the photo URL https://www.flickr.com/photos/dawolf/7974255288/sizes/l/ and select 1600px version the working link is different:
    https://c1.staticflickr.com/9/8173/7974255288_086bcfb6a4_h.jpg

    cheers,
    Daniel

    Plugin Author Sayontan Sinha

    (@sayontan)

    This is weird – the URLs don’t align with what Flickr says they should be. According to Flickr’s documentation the format of the URL should be https://farm{farm-id}.staticflickr.com/{server-id}/{id}_{secret}_[mstzb].jpg, and the secret is consistent across all sizes but Original (o). But here it looks like the secret is different.

    While I haven’t come across this in the past, I did some investigation and I found a way to handle this. Unfortunately the fix is non-trivial and will take some time to put in and test out.

    The stopgap I can suggest is to go for one size smaller, while I figure out how to handle this.

    Thread Starter dawolfat

    (@dawolfat)

    Thank you for your fast response and the links. I tried out adding the url_h parameter to the API request and it works. Mostly.

    I put a longer write-up on my findings up on the Flickr Help forums:
    https://www.flickr.com/help/forum/en-us/72157689276350136/

    Turns out it will not be easy and still may fail for older images.

    The code I changed is in Photonic_Flickr_Processor.php and does help with the 1600px sizes.

    Line 84 – extend the $flickr_params
    $flickr_params['extras'] = 'description,url_h';

    around Line 585 – change the way the main_image is returned in build_level_1_objects()

    if(!empty($photo->url_h)) {
      $photo_object['main_image'] = $photo->url_h;
      } else {
      $photo_object['main_image'] = 'https://farm'.$photo->farm.'.static.flickr.com/'.$photo->server.'/'.$photo->id.'_'.$photo->secret.$main_size.'.jpg';
      }
    

    This helps a bit for my site. Thanks for taking the time looking into it ??

    Cheers,
    Daniel

    Plugin Author Sayontan Sinha

    (@sayontan)

    I wasn’t expecting a full solution to be posted – thanks for that! ??

    Strictly speaking, just to be safe I am going to go ahead and add url_k, url_h, url_o and every other size to the extras so as to future-proof the solution. Then, for every type of size (thumbnail, main_image and tile_image) I will perform the type of check that you have in the above and default to what currently exists.

    For good measure I might even throw in a largest option, that will automatically pick the largest size available, to take the guesswork out of this.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘some Flickr images do not display in lightbox’ is closed to new replies.