Option to "download" original image
Cvbge - May 12, 2005 - 20:51
| Project: | Image |
| Version: | 6.x-1.x-dev |
| Component: | image.module |
| Category: | feature request |
| Priority: | normal |
| Assigned: | bradlis7 |
| Status: | patch (code needs work) |
Description
You can enable users to view original (usually high resolution) images, instead of only thumbnails and previews.
When user clicks 'view original' link new page opens with image.
I'd like to have an option to make that link a direct link to the image - so that when user clicks on the 'view original' link he sees only image (either new page opens or in the same page - that could be a setting too).
Rationale: original images are usually big and a page with them inside looks very bad - image covers some menus, or the page does not fit in screen (if template is well written).

#1
This patch implements something like what I've described. It adds a checkbox "Present original image as a link to download". When enabled clicking on the "view original" link show only image on the page, without anything else [implemented as image/view//_original].
#2
I concur. I use the image gallery for backgrounds, and many non-technical users do not know how to get the image downloaded.
There's also a method of using a PHP file to "force download" an image (http://elouai.com/force-download.php). This could also be an option.
Again, please consider this.
#3
After doing some further research, I've figured out how to force a download of the image. This could be made as an option, but I've only done hard coding as of now. (This could probably be a seperate issue, but it depends on this module). This may break something else, so please double check it multiple times. I've only added the "Content-Disposition.." line. I think it also causes the size of the file to be unknown for the user agent, so, if there was any way to pass a file size in a header, that would be a good idea as well.
<?phpfunction image_file_download($file) {
$size = image_get_info(file_create_path($file));
if ($size) {
$headers = array('Content-Type: ' . $size['mime_type'],
'Content-Disposition: attachment; filename="'.$file.'"'); //changed
return $headers;
}
}
?>
#4
Updated to patch to head, and I also added in the forced download. I added a new item to the access controls, "download images", to show the link to the correct users. I tested it somewhat, and it seems to be working.
I don't think a developer for the image.module has commented, so it would be nice to hear what you think about the idea.
#5
Keeping up with head
#6
[bump]
Sure would be nice to have some feedback. If nobody wants this, I'll stop messing with it, but I personally think it's needed.
#7
+1 from me on the concept. Didn't have time to review the patch yet.
#8
i want this! any movement on it - i've been searching for something like this all day!
Lucy
#9
Has this been already implemented in the Image module? Or is it an addon?
#10
This is really useful, thanks.
#11
I don't think it's been implemented yet, but I gave up on it since I really didn't get any response from the developer. I don't think he's been doing much with the module lately anyways.
#12
Updating the patch against head. I'd appreciate some kind of feedback from the maintainer if possible.
#13
*bump*
Would this be better as an add on module? Is there a better way to implement this? Any feedback is better than no feedback.
#14
Does anyone care anymore?
#15
Yes, but it's up to the module owner to add it, unfortunately.
#16
#17
i don't think it should be a specific permission but rather an options to show the link.
#18
I can't get any of these patches working with the latest 5.1 image module... Last one is the closest, but the first chunk (on line 38 if i remember correctly) fails. I can't find any other good solutions to this, so... *bump*
#19
This is a nice feature. I've updated the patch against the DRUPAL-5--1-2 version. I also added the Content-Length header, so the browser will know the file size and display the progress bar appropriately.
thanks!
#20
i really don't like that patch... and it won't apply to HEAD any more. i'd rather this be added to the $link_options in the image_admin_settings() so the admin can select which sizes the want downloaded.
#21
I would love to try this, but am confused on where exactly I put this patch- I am assuming it either overwrites the image.module file or appends it. Additional tips for newbies would be helpfull.
#22
webiedesign, see: http://drupal.org/patch/apply
#23
Been searching and searching to solve this issue. After much fiddling I have the my Image Collections working the way I need them to except for an automatic link to download the original. If I edit each image separetly I can get the link in by selecting the File attachements - List _original.
But for thousands of images that is kind of a nightmare.
Can anyone tell me how to make this option automatic in the code somewhere?
#24
Did anyone ever respond to merrillie? I would sure like to be able to permit the "download original" link as an option while importing or something (so it doesn't have to be done image-by-image)! Maybe there is a solution to this by now, but I haven't seen it yet.
#25
No response, I am still having to edit each image seperately and tick the list _original file attachment.
I haven't had a chance to play with the newest version that also includes the view module but I suspect it might be possible to find a solution there. I get scared to update anything to do with my image galleries as I sometimes get these horrible derivative messages which now only come when I attempt upgrades.
On a last note I am loving the image module for displaying my image collections.
#26
Patch against 5.x-2.0-alpha1