dont keep Original Picture

sbec
sbec's picture

Joined: 2002-09-10
Posts: 3
Posted: Wed, 2002-09-25 15:12

Is there a nice way, that i don't have my Original Pics on my HomePage ( they take a lot of Storage..... ???
Ideas i have would be to keep the Originals at Home using DSL & DynDNS
or to have the Original replaced by the resized... but then i would loose the EXIF Informations...

Any Hack around for this :roll:

Regards
Simon

 
gvb

Joined: 2002-10-22
Posts: 3
Posted: Tue, 2002-10-22 21:27

I would like to do the same thing... I take high quality pictures, and typically use another image resizing program before I upload them, but for other users that are uploading pictures, is there are way to NOT keep the original image (sometimes well over 2 megs each) and have a sort of hard limit of 640pixels?

-gvb

 
BorgKing
BorgKing's picture

Joined: 2002-09-12
Posts: 314
Posted: Wed, 2002-10-23 15:53

There's no hack for this, gallery 1.x was designed with a small number of people that upload photos in mind. It was assumed that those people know what they're doing. Therefore all image operations are based on the original image and deleting them will screw up your gallery.

To OP: can't you use a program that resizes photos and keeps the exif data?

 
brick_top

Joined: 2002-10-23
Posts: 5
Posted: Wed, 2002-10-23 22:03
Quote:
Is there a nice way, that i don't have my Original Pics on my HomePage ( they take a lot of Storage..... ???
Ideas i have would be to keep the Originals at Home using DSL & DynDNS
or to have the Original replaced by the resized... but then i would loose the EXIF Informations...

Any Hack around for this :roll:

Regards
Simon

Hi!

Yaeh this Feature would be great!! I also would like to have the Original replaced by the resized.

brick_top aka pEtEr

 
mrjcleaver

Joined: 2002-09-01
Posts: 18
Posted: Thu, 2002-10-24 06:40

jhead (http://www.sentex.net/~mwandel/jhead/) will copy the EXIF information from one jpeg to another; it will even work on a directory full.

I use the excellent 500kb EXIF Viewer program (http://home.pacbell.net/michal_k/exif_v.html) to view the images off the camera,aa create reduced sized pictures and then jhead to reinstate the EXIF information.

I upload the reduced sized ones to my gallery.

However, that said, I am thinking about using mogrify on the server to reduce again any pictures that are less popular (with jhead again to reinstate the data).

Perhaps gallery can be altered to depend on jhead thus providing the facility to ditch the original?

M.

 
gvb

Joined: 2002-10-22
Posts: 3
Posted: Fri, 2002-10-25 00:17

Sounds like an idea :smile:

Basically, the ability to setup a gallery for not so computer savy users. They could theoretically, just take their full quality images and upload them not having to do any resizing, etc... and the server would reduce the image size and quality without wasting tons of space saving the original image.

-gvb

 
BorgKing
BorgKing's picture

Joined: 2002-09-12
Posts: 314
Posted: Fri, 2002-10-25 13:18

This should actually be not that hard to accomplish. It would involve editing the save_photos.php around line 313. Photos get inserted in the temp dir, before they're moved to the album location, when you would resize them before adding them to the album location, this would do the trick.

Note1: I don't know what will happen to EXIF data
Note2: This should be done in the gallery_remote.php file as well.

Unfortunately I know just enough PHP to make my layout modifications, this won't be achievable by me. But it'll be a nice function for sure.

 
skicrave

Joined: 2002-10-25
Posts: 89
Posted: Fri, 2002-10-25 18:46

Could someone with more programming knowledge please look into this feature. I know a lot of people are using Gallery as a global photo management system for a site of users, and this mod would really help a lot of us out with both storage and bandwidth issues.

If this can't be done easily, how hard would it be to reject any images that are over, say 640x480 in dimmension?

Thanks,

Jason

 
killerblade

Joined: 2002-10-26
Posts: 6
Posted: Sat, 2002-10-26 17:07

hi folks

i also have that storage problem (uploading 1600x1200 pic ~ 400k per pic is much)
well i tried to understand the code and tried to program that the original pic will be deleted after resizing, but it didnt work.
now i will try to programm it with the idea posted 2 posts ago (resizing the original).

ill answer here if i got a solution

cya
kb

 
killerblade

Joined: 2002-10-26
Posts: 6
Posted: Sat, 2002-10-26 20:03

hi folks!

after hrs of researching the code i DID it!!

u have to add the following code after line #329 (before the line: $err = $gallery->album->addPhoto($file, $tag, $mangledFilename, $caption);) :

$dir = $gallery->app->tmpDir;
fs_copy($file, "$dir/$mangledFilename.$tag");
$file = "$dir/$mangledFilename.$tag";
$temp_files[$file]++;
resize_image("$file", "$dir/$mangledFilename.temp.$tag", "640");
$file = "$dir/$mangledFilename.temp.$tag";
$temp_files[$file]++;

this will copy the original file to the temp dir specified in the config.php file, resize the image to 640x480 and set this file as original to the following instruction (copying to the album folder etc);

i tried it with a few pics and it works. BUT you have to switch the resize_size to off

if u dont do that, you will get a 2. resized pic aswell as the "original" (resized one).

hope it will work on your system (i didnt change the gallery_remote.php cuz i dont need it *g*)

cya
kb

 
skicrave

Joined: 2002-10-25
Posts: 89
Posted: Sun, 2002-10-27 22:20

Nice work Killerblade! This will be such a resource, and time saver for me! Now if I can just figure out how to sort albums by last update, I'll be done modding Gallery.

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Wed, 2002-10-30 09:51

Hi folks. Not sure if this will help...

I churned out a bit of code which will resize the original photos in all the albums (or just the ones you select). It evolved out of a need for me to resize all the photos in my album because I was running out of hard drive space. Anyhow, it will resize your images, preserves EXIF data on jpegs, allows resizing of the ".sized" images, and can rebuild the thumbnails while you're at it.

So while this won't resize when someone uploads, it'll at least do it retroactively when you run the code.

I recently went in and tried to make the code "foolproof", so I've decided to share it here. For more, visit http://www.beckettmw.com/testgallery . I've set the page up so you can actually play with the feature on my test site to see how it works before you try it out yourself.

If you do try it out yourself, please let me know how it goes, so I can change things if necessary.

Regards,
-Beckett (beck@beckettmw.com)

 
mrjcleaver

Joined: 2002-09-01
Posts: 18
Posted: Thu, 2002-10-31 13:49

Hi Beckett,
Thanks for this contribution. I, for one, appreciate it!

The only important modification I can see that I need is to show a nested list of album names on the left hand side. This is important for me because I want to resize a deeply nested album without affecting the ones above it. For your test album, this is to resize album testnest without resizing album testalbum.

Perhaps this is what you meant by: Coming soon to this location: changing album properties for every album you select in the list to the left all at once. Visit beckettmw.com/testgallery to check for updates. ?

Other issues:

The second thing is I find the .sized option confusing. I'd probably remove it but I would be interested to here whether other users think the same.

In the long term it would be best for gallery to have a generic mechanism for selecting albums/pictures. This is so that the selection mechanism can be integrated with other functions. For example, I want to make smallest those pictures that are least popular and popularity of a picture depends on people voting for that picture!

Something needs to be done about the naming of the term 'resize' as gallery already uses that word to mean something else.

Keep up the good work, I'm dying for space on my server!

Thanks,
Martin. :grin:

 
mrjcleaver

Joined: 2002-09-01
Posts: 18
Posted: Fri, 2002-11-01 03:22

If you install gallery under postnuke, you'll find that myresize does not invoke postnuke's login sequence like it should. Instead it (looks like it) invokes gallery's built in routine.

Regards, M.

 
mrjcleaver

Joined: 2002-09-01
Posts: 18
Posted: Fri, 2002-11-01 03:25

In fact, I don't think it works at all properly under postnuke, the main page loads but when attempting to resize I get:

Sorry, you can't access this file directly...

Regards,
M.

 
BorgKing
BorgKing's picture

Joined: 2002-09-12
Posts: 314
Posted: Mon, 2002-11-04 19:19

Beckett, thanx a lot, it looks like a really great tool, and I'm going to try it for sure.

As for the previous poster, for me it made complete sense, the .sized option should definitely be there, although I'm not sure of the necessity, since Gallery can already do this, and the quality would be better when higher resolution images are used to make the resize from.

 
gvb

Joined: 2002-10-22
Posts: 3
Posted: Tue, 2002-11-12 00:58

So this feature will be part of G2 :wink:

-gvb

 
teletubby

Joined: 2002-07-17
Posts: 8
Posted: Thu, 2002-11-14 18:49
Quote:
BUT you have to switch the resize_size to off

if u dont do that, you will get a 2. resized pic aswell as the "original" (resized one).

Killerblade,

I have been looking for something that would do this for over a year, thanks for the code :grin:

One dumb question about your instructions above:

Where (what file(s) do I modify) to switch the resize_size to off???

Thank you again,

Teletubby

 
vestus

Joined: 2002-11-20
Posts: 1
Posted: Wed, 2002-11-20 06:48

TT: He meant in the initial configuration script, the auto-resize feature.

I've taken a crack at this today, and think I have an interim solution. (warning though, I do not write in PHP, so it is all pure hacking. )

I took Killerblade's code and added flags to the base settings for Gallery, so that you can set/clear/change the default and each albums resize-to value. You One minor/major flaw is that I cannot tell if a file _needs_ to be resized (eg is smaller), it just resizes them all. Exif isn't cooperating so it needs an alternate method.

Example album: <!-- BBCode Start --><A HREF="http://www.vestus.com/scripts/gallery/test/" TARGET="_blank">Test gallery</A><!-- BBCode End -->
(Album will be removed after 12/1/02 (or sooner if abused.)) user: test pass: test

Archive file:
<!-- BBCode Start --><A HREF="http://www.vestus.com/pub/Gallery131-resize0.3.tar.gz" TARGET="_blank">Gallery131-resize0.3.tar.gz</A><!-- BBCode End --> has all the files I changed, 1.3.1 backups and a small readme. Simply extract over your base /gallery directory. You will/may have to change permissions on /gallery/setup.

(If you want to look at the code changes, base_size is the flag I added. )

Kudos to KB for the resizing bit.

Good Luck

Vestus (spam@vestus.com)

 
torreyl

Joined: 2002-11-20
Posts: 2
Posted: Thu, 2002-11-21 00:06
Quote:

i tried it with a few pics and it works. BUT you have to switch the resize_size to off

Great idea! I have a question though. I have numerous albums that I've created in the past with resize_size set to 600. Now I want to get rid of the "sized" images and just keep the thumbnail and the original.

Any idea how to change the value of resize_size retroactively?

Thanks,
Torrey

 
ajoyprabhu

Joined: 2002-09-26
Posts: 65
Posted: Thu, 2002-11-21 14:35

My suggestion is completely outside of Gallery and PHP etc. If you are running wondows, search for all files with the wildcard *.sized.* and then simply delete them!

Just my ¢2 worth!

Ajoy

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Thu, 2002-11-21 15:02

I wouldn't recommend that... it will hose your database and break Gallery.

However, if you download my myresize code (mentioned above), then enter an absurdly large number into the max. size box (say, 20000 pixels), and put the same number (or higher) into the ".sized" size box, then it will go through and remove all of the .sized images without touching your originals.
(It will then update the resize size to this value so that your future uploads will not generate the .sized images...).

Hope that helps,
-Beckett (beck@beckettmw.com)

 
torreyl

Joined: 2002-11-20
Posts: 2
Posted: Thu, 2002-11-21 18:05

:grin: The myresize.php is very cool! Worked no problem.

Thanks,
Torrey

 
panecea

Joined: 2003-01-02
Posts: 4
Posted: Thu, 2003-01-02 20:13
Quote:

$dir = $gallery->app->tmpDir;
fs_copy($file, "$dir/$mangledFilename.$tag");
$file = "$dir/$mangledFilename.$tag";
$temp_files[$file]++;
resize_image("$file", "$dir/$mangledFilename.temp.$tag", "640");
$file = "$dir/$mangledFilename.temp.$tag";
$temp_files[$file]++;

For those of us who are completely ignorant, can you please post which file this code is supposed to go in? if anybody knows, please help. I don't have enough space on my server for two versions of the same picture.

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Mon, 2003-01-06 20:06

killerblade was referring to save_photos.php.

-Beckett (

)

 
dtdgoomba

Joined: 2002-11-04
Posts: 185
Posted: Sat, 2003-01-11 21:41

Thanks for both hacks: the one for future photos saved (killerblade) and the one for past ones (beckett). They worked fine, until at one point it froze (not sure if my laptop lost connection or something), then it ended up freezing our server, and needed a restart. Now I have photos with broken thumbs and recreating thumbs doesn't work, even though when you click them, you get the resized photos. At the moment, I'm going to look up a 'replace photo" in the forums, b/c i was sure I saw a hack for that...

actually i'm gonna try to edit the thumb now to see if that works...

After the restart, I've been using it without problems for my other galleries..

 
dtdgoomba

Joined: 2002-11-04
Posts: 185
Posted: Sat, 2003-01-11 22:10

Editing the thumb works, as long as I double click to reset its position. The rectangle starts off the image at first.

The script will freeze after a while but at least this time it didn't freeze the server, I just restart the script and it quickly goes through folders it's already done and goes to where it left off eventually..

the next time it freezes, I'll check the error log to see what it says and post it here.

 
dtdgoomba

Joined: 2002-11-04
Posts: 185
Posted: Sat, 2003-01-11 22:19

Looks like it just timed out or something, in regards to the 30 secs I allowed so I'm moving it up to 90.

again, it does work, so thanks!

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Sat, 2003-01-11 22:46

Yeah. NetPBM and Jhead operations take forever. So the script is about as fast as it can be. If you use ImageMagick, it'll probably be a little faster.
I really should put something in the readme about doing resizes in smaller batches to avoid the timeouts (which are safe, but just a hassle because you have to restart again).
Hmm... the freezing sounds bizarre. If you have an older version of PHP it could be running into memory problems ??

 
dtdgoomba

Joined: 2002-11-04
Posts: 185
Posted: Sat, 2003-01-11 23:31

it's 4.23 we run our own server so we update it (not sure if we're doing 4.3.0 yet) but i think the page was timing out and then i also lost my connection on my laptop (damn wireless noise).

either way, it occassionally stops mid process for resizing or redoing the thumbs, but i just restart and it gets through it and finishes it. strange, but it's not a problem really, just takes a little more time.

i'm using it on my 2nd gallery right now and it's fine so far. either way, it saves me a lot of time.

I do notice that the messed up thumbs (mostly the highlight photo ones) where i selected a smaller part of the thumb in edit thumbnail, then when it gets resized, that box I made is off the picture, causing it to be blank until i reedit the thumb. This was in the first gallery i was working on. my 2nd gallery hasn't had a problem. maybe it was just a freak thing. I'll let you know as I update my other gallery ... in small batches!

Again, thanks a lot for the code

 
Albright

Joined: 2003-01-19
Posts: 3
Posted: Sun, 2003-01-19 22:56

killerblade's chunk of code looks like what I need, but before I implement it, a couple questions...

Will this downsample images with high dpi resolutions to 72 dpi? Will aspect ratios be preserved? And will the client be notified that their image was too big and has been resized?

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Sun, 2003-01-19 23:10

Will this downsample images with high dpi resolutions to 72 dpi?

Okay. This requires explanation. DPIs above 72 are really a printer-only phenomenon, and not really part of a JPEG's spec. Browsers display JPEGs at 72 DPI regardless of what their target DPI is set to, so DPI is irrelevant in this case. But at least for NetPBM, the DPI setting will be lost on resize. I'm not sure about ImageMagick. Again, this shouldn't matter, since the images are being displayed in the browser anyhow. I once spent 20 minutes trying to find out how to force a DPI setting in NetPBM but I didn't find a way.

Will aspect ratios be preserved?

Yes.

And will the client be notified that their image was too big and has been resized?

No. You can add some code pretty easily to print out a message though. Let me know if you need help wiith that.

Also, EXIF data in jpegs will *not* be preserved with killerblade's original code. If this is important, add the bit of code I posted in <!-- BBCode Start --><A HREF="http://gallery.menalto.com/modules.php?op=modload&amp;name=phpBB_14&amp;file=index&amp;action=viewtopic&amp;topic=1424&amp;5465" TARGET="_blank">this thread</A><!-- BBCode End -->.

-Beckett (

)

 
Albright

Joined: 2003-01-19
Posts: 3
Posted: Sun, 2003-01-19 23:55

I don't care so much about EXIF stuff, 'cuz my gallery will mostly consist of hand-drawn art that has been scanned instead of true digital photos.

As for the DPI stuff, I know browsers will always display at 72 dpi, but sometimes, back when I was running a gallery like what this script does, but by hand ( :sad: ) I've had people try to send me images that "look" small to their eyes, but are 300 dpi and therefore have an unwieldy filesize. I'll be using ImageMagick, so I guess I'll just experiment and see what it does.

As for implementing an error message... yeah, I might need a little help with that. :smile: I pretty much know only enough PHP to butcher, not truly "hack..." I'll give it a try, though.

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Mon, 2003-01-20 00:32
Quote:
As for implementing an error message... yeah, I might need a little help with that. I pretty much know only enough PHP to butcher, not truly "hack..." I'll give it a try, though.

Just add something like this to the code (make sure it's inside the if() statement).

print "Image too large. Shrinking it for you...<br />n";

You could print out the resized size, but you'll have to do a couple lines of math, and I'll let you figure that out for yourself. :wink:

-Beckett (

)

 
johncall

Joined: 2003-02-05
Posts: 7
Posted: Wed, 2003-02-05 15:04

Killerblade's code seems to be exactly what I am looking for. But wouldn't it have been easier to simply use the resize feature built in (imagename.sized.jpg) and just code the ability to delete the original and remove the view full image option?

I am just throwing this out to see what the experts think, not saying there is anything wrong with killerblade's code hack :smile:

 
BorgKing
BorgKing's picture

Joined: 2002-09-12
Posts: 314
Posted: Wed, 2003-02-05 17:50

Actually, this is how this entire discussion started, way back in 2002 :wink:

No, it's not possible to delete the original image, Gallery depends on it for most image operations (move, resize etc.). Deleting the original image will simply screw up your Gallery, so it's like the last resort option. Killerblade's code is the first resort :smile:

 
shine_162
shine_162's picture

Joined: 2003-02-08
Posts: 8
Posted: Wed, 2003-02-12 14:07

thx killerblade GREAT job!

i did a little fine tuning, which allows to:
selcect the "Auto-Resize"-values in "properties" for each album
use "off" in "Auto-Resize" which will then display pics in original size

original killerblade hack for save_photos.php:

Quote:

u have to add the following code after line #329 (before the line: $err = $gallery->album->addPhoto($file, $tag, $mangledFilename, $caption);) :

$dir = $gallery->app->tmpDir;
fs_copy($file, "$dir/$mangledFilename.$tag");
$file = "$dir/$mangledFilename.$tag";
$temp_files[$file]++;
resize_image("$file", "$dir/$mangledFilename.temp.$tag", "640");
$file = "$dir/$mangledFilename.temp.$tag";
$temp_files[$file]++;

fine tuned:

<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE>
// RESIZE HACK by killerblade tuned by shine_162
if ($gallery->album->fields["resize_size"]!="off"){
$dir = $gallery->app->tmpDir;
fs_copy($file, "$dir/$mangledFilename.$tag");
$file = "$dir/$mangledFilename.$tag";
$temp_files[$file]++;
resize_image("$file", "$dir/$mangledFilename.temp.$tag", $gallery->album->fields["resize_size"]);
$file = "$dir/$mangledFilename.temp.$tag";
$temp_files[$file]++;
// you may delete the following line if you don't want to see max-size information
echo '.. pics will be resized to <b>'.$gallery->album->fields["resize_size"]. '</b> max. lenght/high if larger';
}
// end resize hack
</TD></TR></TABLE><!-- BBCode End -->

 
reactivo

Joined: 2003-02-27
Posts: 3
Posted: Thu, 2003-02-27 15:25

Hello everybody, this patch is great. I just want to ask something else, I don't know if I miss something in the thread and I don't see this discussion, but I will like to know if is possible in someway to keep the date of creation of the original pictures. Because as you have notice the date is modified I will like to preserve that.

Regards, Max.

 
dtdgoomba

Joined: 2002-11-04
Posts: 185
Posted: Thu, 2003-02-27 17:30

Like Picture Taken Date, camera used, etc..? I think that's the EXIF data. Killerblade's code alters the pic and doesn't preserve that data, however, beckett posted a link to a thread above which has the code you plug in to preserve that data... just scroll up a little. Hope that helps.

 
reactivo

Joined: 2003-02-27
Posts: 3
Posted: Tue, 2003-03-04 20:58

Exactly that was it, thank you dtdgoomba.

Cheers.

 
ronpoz
ronpoz's picture

Joined: 2002-07-23
Posts: 6
Posted: Thu, 2003-06-19 02:06

Where does this go in Gallery 1.3.4? Line 329 looks nothing like the reference point mentioned by killerblade. Thanks!

shine_162 wrote:
thx killerblade GREAT job!

i did a little fine tuning, which allows to:
selcect the "Auto-Resize"-values in "properties" for each album
use "off" in "Auto-Resize" which will then display pics in original size

original killerblade hack for save_photos.php:

Quote:

u have to add the following code after line #329 (before the line: $err = $gallery->album->addPhoto($file, $tag, $mangledFilename, $caption);) :

$dir = $gallery->app->tmpDir;
fs_copy($file, "$dir/$mangledFilename.$tag");
$file = "$dir/$mangledFilename.$tag";
$temp_files[$file]++;
resize_image("$file", "$dir/$mangledFilename.temp.$tag", "640");
$file = "$dir/$mangledFilename.temp.$tag";
$temp_files[$file]++;

fine tuned:

<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE>
// RESIZE HACK by killerblade tuned by shine_162
if ($gallery->album->fields["resize_size"]!="off"){
$dir = $gallery->app->tmpDir;
fs_copy($file, "$dir/$mangledFilename.$tag");
$file = "$dir/$mangledFilename.$tag";
$temp_files[$file]++;
resize_image("$file", "$dir/$mangledFilename.temp.$tag", $gallery->album->fields["resize_size"]);
$file = "$dir/$mangledFilename.temp.$tag";
$temp_files[$file]++;
// you may delete the following line if you don't want to see max-size information
echo '.. pics will be resized to <b>'.$gallery->album->fields["resize_size"]. '</b> max. lenght/high if larger';
}
// end resize hack
</TD></TR></TABLE><!-- BBCode End -->

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Thu, 2003-06-19 06:12

ronpoz, in v.1.3.4, this code got moved to the processNewImage() function in util.php. It's no longer in save_photos.php.

-Beckett (

)

 
killerblade

Joined: 2002-10-26
Posts: 6
Posted: Tue, 2003-07-08 22:02

in gallery 1.3.4 the line:
>$err = $gallery->album->addPhoto($file, $tag, $mangledFilename, $caption)

has moved to
util.php
#1482

thank you all for your replies :)
it was a honor to create such a hack ;)

mfg
killerblade

 
bobob

Joined: 2003-07-12
Posts: 110
Posted: Sat, 2003-08-02 16:45

I have combined the code of killerblade and of beckett for the EXIF data and inserted the code at line1482 of util.php, but am getting errors when I upload a zip file. Can anybody verify that the following code is correct:

$dimensions = getimagesize($file);
if($dimensions[0] > "640" || $dimensions[1] > "640") {
$dir = $gallery->app->tmpDir;
fs_copy($file, "$dir/$mangledFilename.$tag");
$file = "$dir/$mangledFilename.$tag";
$temp_files[$file]++;
resize_image("$file", "$dir/$mangledFilename.temp.$tag", "640");
//copy over EXIF data if a jpeg

if (!strcmp($tag, "jpg")) {

$jhead = $gallery->app->use_exif;

exec_wrapper(fs_import_filename($jhead, 1) . " -te "

. fs_import_filename("$dir/$mangledFilename.$tag", 1) . " "

. fs_import_filename("$dir/$mangledFilename.temp.$tag", 1));

}
$file = "$dir/$mangledFilename.temp.$tag";
$temp_files[$file]++;
}

 
bobob

Joined: 2003-07-12
Posts: 110
Posted: Sun, 2003-08-03 10:39

killerblade, becket....?

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Tue, 2003-08-26 09:39

Well at first glance the code *looks* okay. Please either post your additions in context of util.php or email me your file. Also, please tell us the *exact* error you're receiving.

-Beckett (

)

 
tomsawyer123
tomsawyer123's picture

Joined: 2002-07-24
Posts: 81
Posted: Wed, 2003-08-27 15:27

Beckett,

Does your resize script compatible with the last release of gallery -> 1.4-RC1 ?

Thanks for this great script!

TOM

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Wed, 2003-08-27 23:54

I have no idea. Wanna be my guinea pig and test it out??
I don't have time right now to check it out.

It was certainly working with the CVS version a couple weeks ago when I added some new photos to my own website.

Once 1.4 final is released, I'll have time to look into it if the code needs to be updated.

-Beckett (

)

 
anonymous11234

Joined: 2002-12-05
Posts: 135
Posted: Thu, 2003-08-28 21:10

I use your resize script with the latest version and it works perfect. I have 2 albums running on one site with over 4,000 pictures and I have them all reduced. It works perfect.

Thanks again for it...

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Fri, 2003-08-29 06:46

Great news! Thanks. :)

 
nukestud
nukestud's picture

Joined: 2003-03-25
Posts: 114
Posted: Sun, 2003-08-31 06:05

Guys this has no effect for me, hows it supposed to work? How do I initiate it, when adding pics?

This is the code I have insterted into util.php

if ($gallery->album->fields["resize_size"]!="off"){
			$dir = $gallery->app->tmpDir;
			fs_copy($file, "$dir/$mangledFilename.$tag");
			$file = "$dir/$mangledFilename.$tag";
			$temp_files[$file]++;
			resize_image("$file", "$dir/$mangledFilename.temp.$tag", $gallery->album->fields["resize_size"]);
			$file = "$dir/$mangledFilename.temp.$tag";
			$temp_files[$file]++;
			// you may delete the following line if you don't want to see max-size information
			echo '.. pics will be resized to <b>'.$gallery->album->fields["resize_size"]. '</b> max. lenght/high if larger';
}
			$err = $gallery->album->addPhoto($file, $tag, $mangledFilename, $caption, "", $extra_fields);