Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When an image is pulled in from Flickr and saved locally, the code comments say it's downloading the original size, but in my experience it doesn't. It tends to download a medium-size image from Flickr instead.
This can cause problems with image styles that expect a large image to work with.
I think the code should be changed to always use the largest available size.
Comment | File | Size | Author |
---|---|---|---|
#1 | media-flickr-original-size-2066485-1.patch | 1.57 KB | David_Rothstein |
Comments
Comment #1
David_Rothstein CreditAttribution: David_Rothstein commentedHere is a patch.
As mentioned above, the existing code comments imply that "5" is always the original size, but this isn't true. I wonder if the code dates back from a time when the Flickr API returned a smaller number of sizes than it currently does? If so, the _media_flickr_guess_size() function probably has other issue too, since it's assuming a particular mapping between image dimensions and size number.
Comment #2
steinmb CreditAttribution: steinmb commentedHow would this work if the original is a RAW-photo? Have not read through the Flickr API yet.
Comment #3
steinmb CreditAttribution: steinmb commentedTake that back about RAW image. Found this in the FAQ:
I'll have a look at the submitted patch.
Comment #4
kobb CreditAttribution: kobb commentedTested the patch.
It works for me.
Thanks @David_Rothstein
Comment #5
steinmb CreditAttribution: steinmb commentedThis code addresses the problem by picking the latest value in the array. Prob. a more robust way would be to pick the nested array that is labeled 'Original', though I think this is OK for now. Cannot see that _media_flickr_guess_size() ever get the max width settings passed so we might revisit this code when addressing that problem in a separate issue. RTBC as far as I see it.
Comment #8
steinmb CreditAttribution: steinmb commentedWe should also make it into 6.x-1.x. #1480326: Images suddenly fuzzy / blurry / blurred prob. should be closed as a duplicate.
Comment #9
steinmb CreditAttribution: steinmb as a volunteer commented6.x is outdated but we should make sure this is OK in 7.x
Comment #10
steinmb CreditAttribution: steinmb as a volunteer commentedRe-tested. It is correct.
Comment #11
steinmb CreditAttribution: steinmb as a volunteer commented