Closed (fixed)
Project:
Image Picker
Version:
7.x-1.7
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
11 Sep 2014 at 21:23 UTC
Updated:
15 Sep 2014 at 09:50 UTC
Jump to comment: Most recent
Comments
Comment #1
hutch commentedImage presets are handled by the image module which creates the presets on the fly in the files/styles folder. If they are not created on demand then there is either a problem in the image module setup or the file permissions in files/styles/ does not allow the creation of images. All Imagepicker does is leverage the features provided by the Image module.
Comment #2
fras42 commentedI have the same issue. Check the watchdog for the last messages, I've found access denied inspite off all the file permissions were correct. After some googling (access denied + image_style_url) , It started working after I put $conf['image_allow_insecure_derivatives'] = TRUE; in settings.php, however I don't understand too much what it does.
Comment #3
hutch commentedThere are some comments in /modules/image.module around line 811 and on, these explain the need for a token.
I have just tested a copy of imagepicker, enabled the use of presets and inserted a preset "medium" and it has a token in the url, eg something like
The image exists (once I access it in the browser) and displays correctly.
So check that Imagepicker is providing a token when inserting the image URL (it probably is) and if the token is still there when viewing the image in the saved content. If the token has disappeared then someting is filtering so you need to check your html filters and/or content filters.
Comment #4
brianlp commentedThanks both for the hints. Tokens are being generated and are in the image url when viewing the content, that doesn't seem to be the problem.
Adding
$conf['image_allow_insecure_derivatives'] = TRUE;to settings.php makes everything work as expected. However, in the comments of image.module around line 811 it says "this will increase the site's vulnerability to denial-of-service attacks" due to bypassing the tokens.– Before setting TRUE, no images existed in files folder like for example: /sites/default/files/styles/large/public/imagepicker/1/my_image.jpg
– After setting TRUE, those images do exist and are displayed properly.
Once the images are generated, I can remove that line of code from settings.php and it will remain working. So essentially this is only needed for the process of generating the images and placing them in the respective folder.
Also, if you apply that line of code to settings.php, all images of previously saved content with the blue question mark will be generated then.
I don't know much about what's going on under the hood here so atm I have not idea how to solve that. I would be happy if there was a way without using that snippet in settings.php.
Comment #5
fras42 commentedI installed the dev version of Imagepicker and it works with image style presets without allowing insecure derivatives in settings.php.
Comment #6
hutch commentedYes, I checked the CHANGELOG and there was a fix for presets, this was to allow for the enhanced security measures mentioned in image.module.
I have issued a new stable version, imagepicker-7.x-1.8, this brings stable up to dev.
Comment #7
brianlp commentedWorks fine, thanks!
Comment #8
brianlp commented