Needs review
Project:
IMCE
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
18 Aug 2012 at 13:06 UTC
Updated:
3 Jul 2020 at 19:11 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
chefnelone commentedComment #2
ufku commentedThere is an inline js in imce-content.tpl.php which allows preview of small images. You can find some other preview options there.
Comment #3
mibfire commentedI tryed this with the following settings:
imce.vars.prvstyle = 'thumbnail';
imce.vars.boxW = 100;
imce.vars.boxH = 100;
but not the all images are created as thumbnail as you can see here: http://screencast.com/t/GzSvhpDNeci
Why doesnt this work for all images? Thx
Comment #4
mibfire commentedhttps://drupal.org/project/image_allow_insecure_derivatives
Comment #4.0
mibfire commentedUpdate: It seems to me that this is bug since some image files show their preview but not all of them.
Comment #5
karol haltenberger commentedThis is not a bug. Already existing images will show up, but new ones will not be generated without the token.
While trying to make the image previews to work with the core security patch, but without modifying the module source I came up with this. The preview style is managed from the settings page.
In the end I had to patch some of the js, because I couldn't manage to override a function. Maybe I'll try again later.
Comment #6
karol haltenberger commentedComment #7
krem commentedHi guys,
I got a workaround overriding the imce-file-list.tpl.php:
1. Place 'modules/imce/tpl/imce-file-list.tpl.php' in your template folder
2. Replace
by
I know it is strange to create an extra column before 'name' column but without it the img tag does not work... I am guessing some javascript treatment is involved.
So far no issues, please confirm ;)
Comment #8
errand commented#7 Works like a charm!
Bravo krem!
Comment #9
volca commentedThank you, Krem. Helps a lot!
Comment #10
Acertijo commentedThank you #7
Comment #11
butterwise commented#7 worked for me. Thank you!
Comment #12
sgdev commentedThe problem with #7 is it's loading every picture at full size and scaling it to be 50 pixels wide. If you have a directory with hundreds of images, it could be a huge performance hit.
The pre-Drupal 7.20 method created a tiny thumbnail image of only a few bytes. This approach is not the same.
Comment #13
sgdev commentedFYI, one other problem with the response in #7: the extra
<td>tag withdisplay:nonecauses the IMCE image preview to break.Comment #14
sgdev commented@Karol Haltenberger, I spent some time looking at your code in #5, and created a patch for IMCE that incorporates a lot of the concepts directly into the module.
The one major issue I found was code in the
MODULE_imce_custom_processfunction. Thedb_selectassumes thatfilenamein thefile_managedtable is unique, and this is not always the case. Theuriwill be unique, and this value needs to be used for checking, notfilename.I also added some logic to break out of the javascript if
itokis undefined. Otherwise there are situations where we will see a broken image in IMCE.Please review the attached patch and let me know if there are any suggestions. Thanks.
(Note: for anyone testing this code, make sure to run update.php and add the image style to be used for the thumbnail in /admin/config/media/imce in the Common settings section at the bottom.)
Comment #15
sgdev commentedPatch #14 no longer applies to the recent version of IMCE. Attached is an updated version for review.
Comment #16
paulocsPatch #15 does not work when images are in root directory so I re-rolled the patch and implemented it.
The problem now is that I couldn't enable thumbnail if the image metadata is disabled.
I create the function imce.getDimensionsImgDataDisable() in imce_extras.js but it is not working to get the image data when the metadata is disabled.
Should I create a message in the config form that is not possible to show images in thumbnail if metadata is disabled or we will wait until we find a solution?
Thanks.