How to not to keep full size picture ?

Poulou

Joined: 2002-08-24
Posts: 7
Posted: Sun, 2002-08-25 10:11

I explain my wish.
When I upload some photos, I resize them before because I know that a 2048x1024 pic take 1Mo on my server ! But, on my website, a lot of people add new pics and they can't or they don't know how to resize before so I have some bigs photos on my gallery.
That I want to do is delete original file after resizing it and keep only ".thumbnail" and ".size" photo. Is it possible ? Easily ? I think it could be an option in setup.
Thanks for answer.

 
muggles
muggles's picture

Joined: 2002-08-19
Posts: 22
Posted: Sun, 2002-08-25 17:09

Hi,

That feature is not currently implemented, but...
You can remove the click through to the huge image link by editting view_photo.php...
around line 393 change:

if ($gallery->album->isResized($index) && !$do_fullOnly) {

to:

if (false) {

That will stop the image from being a link, then you can do like I do..
copy the *sized* images over your main images.

Also, as an alternative to that, a patch is available for <!-- BBCode Start --><A HREF="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=577284&amp;group_id=7130&amp;atid=307130" TARGET="_blank">download here</A><!-- BBCode End --> that requires a config addtion by you:
$gallery->app->showFull = "no";

and downloading a replacement view_photo.php.

Hope this helps

 
Poulou

Joined: 2002-08-24
Posts: 7
Posted: Sun, 2002-08-25 18:50

Thanks for answer.
In fact, I have done some modifications before you send your message and I have disabled FULL view (and if you click on the pic, you return to the thumbnail of the album).
But after if I remove manually the huge original files, it appears some problems : highlight photo is made with it so you have a wonderful black pic, you have errors with properties,... Moreover, manually delete is not a solution very proper !...
I'll try to implement this and I'll post my contribution (if I find a solution !...)
I you have more informations...

 
muggles
muggles's picture

Joined: 2002-08-19
Posts: 22
Posted: Sun, 2002-08-25 19:08

I can only suggest copying the *sized* images over your main images...

A truly working solution would make for a nice hack for someone to do!
:grin:

 
Poulou

Joined: 2002-08-24
Posts: 7
Posted: Sun, 2002-08-25 20:51

I have an idea...
Do you think it's possible to delete "full file" and to create a symbolic link from the existing ".sized file" with the name of the "full file". Am I clear ?...
I'm going to test this...

 
vallimar

Joined: 2002-08-15
Posts: 487
Posted: Sun, 2002-08-25 22:00

Alternatively, you could set things up so that after Gallery resizes the image
it will copy it over the original full image then delete the sized image. Then
adjust your configuration to bypass the sized images and go straight to the
already resized 'full' image. I can't imagine this would take more then a
few minutes work.

 
kathyvt

Joined: 2002-08-11
Posts: 3
Posted: Sat, 2002-09-14 15:22
Quote:
... Gallery resizes the image it will copy it over the original full image then delete the sized image. --snip --

This is exactly what I am looking for!!! Has anyone submitted a mod for this or will this be a feature of G2???

Quote:
I can't imagine this would take more then a
few minutes work.

Since I know very little about php coding ... minutes would last for weeks! :grin:

- cheers
kv

 
quasidynamic

Joined: 2005-09-13
Posts: 2
Posted: Wed, 2005-09-14 20:37

Well, i tried all of this and didn't get it to work in gallery 1.5 pl1... so here's a real quick fix...

edit view_photo.php

find the line with $href= makeAlbumUrl($gallery->session->albumName, $id, array("full" => 1));
this was line 568 for me.

just change the 1 to a 0.
$href= makeAlbumUrl($gallery->session->albumName, $id, array("full" => 0));

The link will just open the same image. Then you can delete all the large images from album folders...

Devin

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2005-09-15 01:56

G2 offers quotas and size limits. As for G1 you can try a search for "myresize" and you will be able to resize the images on the server.

Dave

Gallery Frames / Mods || G1 Test Gallery