Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Even if multiple images are available, only the last one (so the smallest one!) is included. This is because of a minor bug in which the image counter isn't incremented. Patch attached.
Comment | File | Size | Author |
---|---|---|---|
#5 | feeds_imagegrabber-import_correct_image-1366390-5.patch | 3.34 KB | acrollet |
0002-Incrementing-the-image-counter-so-we-don-t-always-on.patch | 707 bytes | mcboof |
Comments
Comment #1
MrNeko CreditAttribution: MrNeko commentedHi I tried applying the patch but it doesn't let me. Tried on latest 7.x-1.x-dev using netbean. Can anyone help me with this? Thanks.
Comment #2
rooby CreditAttribution: rooby commentedThanks, that should fix it (just looking at the code, haven't tried to apply yet).
Better would be an option to choose what to do when there are multiple images but that can be another feature added later (#1793998: Give options for what to do if multiple images are found).
Comment #3
rooby CreditAttribution: rooby commented@MrNeko,
When I get a chance I'll try it and re-roll it if necessary.
If you are feeling adventurous you could also apply it manually seeing as it is so small.
All you have to do it put the
$image_count++;
line in where it goes.Comment #4
acrollet CreditAttribution: acrollet commentedThe patch in the summary applies cleanly to 7.x-1.x-dev for me - works great, it would be good to get this in since it greatly affects the central functionality of this module.
Comment #5
acrollet CreditAttribution: acrollet commentedI spoke a bit too soon, the attached patch increments the image counter before checking to see if it is equal to the cardinality setting. This prevents an additional image from being downloaded and cluttering up the files directory. There is also a bit of whitespace cleanup for the function in this patch.
Comment #6
rooby CreditAttribution: rooby commentedThanks, I will do a run of review / commits tonight.
Comment #7
rooby CreditAttribution: rooby commentedGood catch.
I have committed this minus the whitespace fixes. I will fix those in a separate commit. Best to keep them separate.
I also also added a change so that it only sets the field once instead of overwriting it every new image.
http://drupalcode.org/project/feeds_imagegrabber.git/commit/5cbea2b