Module: downloadsizes (provides a sidebar block that allows user to download the image in different sizes)

ctagoona

Joined: 2013-01-09
Posts: 2
Posted: Thu, 2013-05-16 14:49

Hello Everyone,

I have a user who is running Gallery 3, and they would like the ability to have their images set up to be downloadable at different sizes, so for example maybe each image will have a Small And Large size to download. with a download button linking to each size.

Is there a module that can take care of this?If so, do you know if it is also possible to have the resizing done automatically?

Should I suggest moving to gallery 2 if I want these features?

Thank You
Ctagoona

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2013-05-16 21:29

There is no module to this yet.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Fri, 2013-05-17 02:35

Sure there is @floridave! (well I just threw this simple module together)

Once installed and activated, it provides a block that you can put in to your sidebar (via Admin->Appearance->Manage Sidebar)
This block will allow a logged in user to select a dynamically resized image to download.

*NOTE* This version 1, and is very simple, no configuration options... I may add to it if anyone desires...

Link: downloadsizes module

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2013-05-17 03:23

That is why I said "yet". :-)
Just a little over 5 hours! Cool.

Dave
___________________________________________
Blog & G2 || floridave - Gallery Team

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Fri, 2013-05-17 13:02

Did you give it a shot? It was late for me, so little testing on my part.

If it works out for v1, we can throw up a new codex page for it.

(This is one of those modules that will need to be re-done once 3.1 comes out however...)

James

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2013-05-19 18:19

Works great!
I think it should check to see if the size is big enough for the available original.
you have:
$size = array("320","480","640","800","1024","1200","1600");
but if I only upload 1200 images the 1600 should not be available.
Also I think that the 'original size' should be the default of the dropdown.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2013-05-19 18:32

Users; feel free to contribute back to the community by helping out with some documentation:
http://codex.galleryproject.org/Gallery3:Modules:downloadsizes
feel free to edit as needed.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Mon, 2013-05-20 00:24

I'll make the changes soon - great suggestions!

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Mon, 2013-05-20 01:39

v2 with changes:

* moved Original to top of select
* only display sizes up to max height/width of original image

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2013-05-30 15:57

Minor bug: the code should not be displayed on search result pages. I guess there is a few ways around that.

  static function get($block_id, $theme) {
    if($theme->item() && $theme->item->is_photo()) {

Also, was it designed to not show to guest users or is that some future feature?

Dave

Edit: now I see you did that in version 3.
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Thu, 2013-05-30 20:36

As designed... I suspect that I should make that an admin option... future version will have it

 
ramack
ramack's picture

Joined: 2011-09-27
Posts: 3
Posted: Fri, 2013-08-09 19:42

Thanks for this plugin I just installed it and it is very cool.
I also have some suggestions:
- allow translation of "Original Size" in helpers/downloadsizes_block.php
- make the sizes configurable
- use the filename of the original image
- return the original file when original size was chosen
- copy all meta data into the resized image (EXIF, IPTC, GPS coordinates)

Cheers,
Rapha

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Mon, 2013-08-12 14:54

V4 Uploaded to Codex

ramack wrote:
Thanks for this plugin I just installed it and it is very cool.
I also have some suggestions:
DONE - allow translation of "Original Size" in helpers/downloadsizes_block.php
Maybe in the future - make the sizes configurable
DONE- use the filename of the original image
DONE - return the original file when original size was chosen
Too much effort - requires non-standard PHP libraries - copy all meta data into the resized image (EXIF, IPTC, GPS coordinates)

Cheers,
Rapha

 
ramack
ramack's picture

Joined: 2011-09-27
Posts: 3
Posted: Mon, 2013-08-12 19:27

Oh, this was fast. Thanks. And you implemented all the important points.
For the meta data topic it may be possible to reuse the approaches of the other moduls already supporting the meta data.

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Mon, 2013-08-12 20:13

Unfortunately, without creating another image and 'importing' the exif/iptc data, (again requiring a third party app) it would be too tedious in my opinion for a module. With that being said, anyone is free to add on!

Enjoy!

 
w91803
w91803's picture

Joined: 2009-08-29
Posts: 67
Posted: Sun, 2013-10-27 17:08

Gallery 網址 = http://hktaitung.org/gallery309
Gallery 版本 = 2.3.1 核心 1.3.0.1
API = 核心 7.54,模組 3.9,佈景主題 2.6,內嵌 1.5
PHP版本 = 5.2.12 cgi
伺服器 = Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/

I installed downloadsizes, but it is not showed on the right side. Where is it?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2013-10-27 22:36

photo page?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
w91803
w91803's picture

Joined: 2009-08-29
Posts: 67
Posted: Mon, 2013-10-28 05:25
Quote:
photo page?

Dave

Oh, I see it..... Thank Dave......

 
teoball

Joined: 2013-11-27
Posts: 1
Posted: Mon, 2013-12-02 13:28

Hello jnash, and thank you for a greate module!
I would also like the possibility tol configurate the sizes of the image files downloaded.
F.ex download for web and download for print. (72 dpi and 300 dpi?)

Best regards,

Teoball

ramack wrote:
Thanks for this plugin I just installed it and it is very cool.
I also have some suggestions:
- allow translation of "Original Size" in helpers/downloadsizes_block.php
- make the sizes configurable
- use the filename of the original image
- return the original file when original size was chosen
- copy all meta data into the resized image (EXIF, IPTC, GPS coordinates)

Cheers,
Rapha

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Mon, 2013-12-02 15:27

Probably not for this module. That would require converting the image, and I just don't see a reasonable way to incorporate this smoothly without potentially bogging down someone's server.

Sorry.

 
MahmoudXG

Joined: 2013-12-24
Posts: 1
Posted: Tue, 2013-12-31 12:08

I finally found the module that I want thank you jnash Great job ^_^