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

Cvbge - May 18, 2005 - 11:54

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].

AttachmentSize
image-original_as_download.diff1.41 KB

#2

bradlis7 - February 8, 2006 - 21:41
Title:Option to *download* oryginal image, not show it as part of the page» Option to "download" original image, not show it as part of the page
Priority:normal» critical

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

bradlis7 - April 23, 2006 - 06:35

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.

<?php
function 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

bradlis7 - April 24, 2006 - 22:18
Assigned to:Anonymous» bradlis7

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.

AttachmentSize
imagecvs.patch.txt1.76 KB

#5

bradlis7 - May 19, 2006 - 04:07

Keeping up with head

AttachmentSize
image_download_0.patch1.89 KB

#6

bradlis7 - May 26, 2006 - 16:47
Title:Option to "download" original image, not show it as part of the page» Option to "download" original image

[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

RayZ - May 28, 2006 - 01:49

+1 from me on the concept. Didn't have time to review the patch yet.

#8

stanbroughl - August 14, 2006 - 17:22

i want this! any movement on it - i've been searching for something like this all day!

Lucy

#9

piotrdesign - September 10, 2006 - 14:12

Has this been already implemented in the Image module? Or is it an addon?

#10

hickory - September 11, 2006 - 16:04

This is really useful, thanks.

#11

bradlis7 - November 28, 2006 - 17:29

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

bradlis7 - December 8, 2006 - 00:37

Updating the patch against head. I'd appreciate some kind of feedback from the maintainer if possible.

AttachmentSize
download_patch.module2.11 KB

#13

bradlis7 - December 19, 2006 - 16:38

*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

bradlis7 - February 11, 2007 - 06:24
Category:feature request» bug report

Does anyone care anymore?

#15

hickory - February 12, 2007 - 07:57

Yes, but it's up to the module owner to add it, unfortunately.

#16

hickory - February 12, 2007 - 07:58
Version:6.x-1.x-dev» 5.x-1.x-dev
Category:bug report» feature request
Priority:critical» normal

#17

drewish - March 1, 2007 - 17:36

i don't think it should be a specific permission but rather an options to show the link.

#18

Emil Bjorklund - May 30, 2007 - 10:04

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

grendzy - June 19, 2007 - 18:37

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!

AttachmentSize
image_download_1.patch2.53 KB

#20

drewish - August 8, 2007 - 16:06
Version:5.x-1.x-dev» 6.x-1.x-dev
Status:patch (code needs review)» patch (code needs work)

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

webiedesign - August 19, 2007 - 16:38

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

drewish - August 19, 2007 - 19:26

webiedesign, see: http://drupal.org/patch/apply

#23

merrillie - August 23, 2007 - 08:55

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

doclalor - February 4, 2008 - 21:00

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

merrillie - February 13, 2008 - 11:59

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

daniboy - April 22, 2008 - 12:50

Patch against 5.x-2.0-alpha1

AttachmentSize
image_download_5.x_2.0_alpha1.patch2.59 KB
 
 

Drupal is a registered trademark of Dries Buytaert.