Closed (fixed)
Project:
PDF to ImageField
Version:
7.x-3.2
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Feb 2013 at 00:36 UTC
Updated:
1 Apr 2014 at 19:01 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
rkeppner commentedLuckily, there is a workaround. However, it essentially rolls back the security fix.
Also from the notes:
Comment #2
guillaumev commentedPlease try the following patch. It should fix it without having to use $conf['image_allow_insecure_derivatives'] = TRUE.
Comment #3
dman commentedIs this actually still a problem? I've not been replicating it for a while.
The image_allow_insecure_derivatives was a pain all 'round, but wasn't it more about upgrade pain than anything that affects new sites?
As I can no longer reproduce the problem on clean working sites, I'll put it to cannot reproduce.
If there are steps that can be described to see this issue still in action, please re-open.
Comment #4
morbus iffReopening, as I'm still seeing this.
Running 3.2 against Drupal 7.26. Whenever PDF to Imagefield creates new images, it saves them into the database as
public:///filename.jpg, which then causes image derivatives (thumbnails, etc.) to fail. A similar (recent) report is at https://drupal.org/node/1822050. The cause lies inpdf_to_image_generate_page(). Funnily, the attached patch (which has been mainlined) is causing the issue (likely because it was against 7.20, and then fixed in Drupal 7.22 so that it wouldn't happen, according to https://drupal.org/drupal-7.20-release-notes - search for "extra slash").If I change:
to:
Everything is magical. For debugging purposes:
$params['image']['instance']['settings']['file_directory']was empty.$image_dir_uriwaspublic://.Comment #5
dman commentedThanks for the diagnosis and explanation! Understanding the exact problem really helps.
As you've noted, it matters if the $params['image']['instance']['settings']['file_directory'] is empty or not - simply dropping the '/' would then cause misbehavior if there WAS a file_directory set. So everything is not magical yet. And I recommend the use of a file directory most of the time. Which is likely why I could not replicate.
So yes, this patch is indeed cool.
Tested this with both the image field set to have a subdir, and without a subdir - derivatives appear OK.
Putting this in now.
As there have been a few other significant fixes since 7.x-3.2, I'll do a version roll also.
Thanks!