Closed (fixed)
Project:
Thickbox
Version:
5.x-1.1
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
28 Sep 2007 at 13:20 UTC
Updated:
29 Apr 2009 at 06:00 UTC
Hi,
My problem is that my client insists in uploading big pictures, for thumbnail display is no problem, i set a preset in imagecache and its done, but when someone whant to see the picture bigger and click on the thumbnail it try to open the original (default behavior), but they are too big and never are show.
So, there is any way to, when the user click on the thickbox thumbnail image, instead off open the original .jpg it point to/ open a imagecache image?
regards
Comments
Comment #1
frjo commentedThickbox will open any image URL that you point it to. So what you need to to is change the address in the link.
Another way to deal with the problem that users refuse to scale down there images is to let Drupal do it for them.
Go to "admin/settings/uploads" and set the "Maximum resolution for uploaded images". If users upload images bigger then this Drupal with scale them down automatically.
If you are using the image module it may have its own settings for this.
Comment #2
diegohermes commentedThanks for the answer, i will try alter the upload configs, this should fix the problem.
regards
Comment #3
mathieu commentedI just did that, works like a charm. Needed to create the following function in template.php, in my theme directory (you will need to replace "YOURTHEMENAME" and "YOURPRESETNAME") :
Maybe add this snippet to the documentation?
Mathieu
Comment #4
lias commentedThanks for the snippet
Comment #5
jjjames commentedI can't get either of these methods to work. The jpg dimensions were larger than I specified as MAX and it didn't get resized. Could this be because I was logged in as user1? Also, the code snippet didn't work for me.
Any suggestions?
thanks
Comment #6
jomtois commentedFrom this post : http://drupal.org/node/128080
This worked for me. You need to have the CCK module loaded.
You can create an imagefield for any content you define that will contain an option to specify maximum resolution. When you upload the picture into that field, it will be scaled on the server. Then Thickbox will point to that version automatically. Read the post by konsumer in the above link, it is probably clearer than I am describing, although having to do with galleries (good tutorial for that).
Comment #7
frjo commented