Author Topic: resizing images  (Read 4832 times)

0 Members and 1 Guest are viewing this topic.

Offline Kheperi

  • album.pl Tester
  • **
  • Posts: 31
  • Karma: +0/-0
  • I did, I did change the default text!
resizing images
« on: July 22, 2002, 12:50:44 »
Hi

I'm a new user of this script and i really like it!
I have a request for a new feature though. My images are way bigger then the usual screenresolution. But i would like to keep the pics as they are on my server.  

Best would be if the browser was free to resize the images, like the last versions of IE do.
Also ok would be if i could set a size for the images as thay are displayed after downloading (nomatter how big they are on my server).

I hope you will implement something like this.
« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re: resizing images
« Reply #1 on: July 22, 2002, 13:21:00 »
I do understand. It can be done by constraining the original images using HEIGHT and WIDTH tags. Unfortunately, it means that the whole image is still loaded (full size) and is just constrained...

Thanks for the request, I can't promise I'll get right to it, but it's on the books now. :)
« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »

Offline Kheperi

  • album.pl Tester
  • **
  • Posts: 31
  • Karma: +0/-0
  • I did, I did change the default text!
Re: resizing images
« Reply #2 on: July 23, 2002, 12:24:30 »
uhmm how can i do that? It would be an acceptable way to me for now, but i have no idea where to put that tags. I do understand html to some extend and i understand scripts a little but hmm you build the scripts in a very structured way, but its way to dificult to me to work it out myself.
« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re: resizing images
« Reply #3 on: July 23, 2002, 16:54:54 »
Haha! Yeah, "structured" is a word for it...  ;) It's pretty convoluted in the script, I often have trouble myself, so don't feel bad. If you wanted to put in a temporary fix, you could change this code, around line 5453:

Code: [Select]
           if (!isAMovie($photo))
           {
                 $actual_object.="<img src=\"";
                 if ($create_html_flag)
                 {
...


by adding this:

Code: [Select]
           if (!isAMovie($photo))
           {
                 $actual_object.="<img height=\"400\" src=\"";
                 if ($create_html_flag)
                 {
...


If you add only a height or only a width tag, your images will remain porportional.

Hope that hepls!
« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »

Offline Kheperi

  • album.pl Tester
  • **
  • Posts: 31
  • Karma: +0/-0
  • I did, I did change the default text!
Re: resizing images
« Reply #4 on: July 24, 2002, 09:24:01 »
Works great! thanks! For now this is a good sollution.

Would be great though if the visitor could have the option of watching resized (to fit the screen) or fullsized (for saving or printing or whatever).

Thanks for your really quick sollution!
« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re: resizing images
« Reply #5 on: July 25, 2002, 07:23:15 »
This is now done (properly :)).

Files to update:

album.pl
album_strings.txt
album_header.tml
Photo_Album.css

and there are 3 new config items (small_width, small_height, medium_width, medium_height, large_width, large_height). See the release notes for a bit more info, or take a look at a photo in the sample album:

http://perl.cdnarmy.ca/cgi-bin/album.pl?photo=jonalbum/appletoilet.jpg

Cheers
« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »

Offline Kheperi

  • album.pl Tester
  • **
  • Posts: 31
  • Karma: +0/-0
  • I did, I did change the default text!
Re: resizing images
« Reply #6 on: July 25, 2002, 10:08:15 »
Looks very promising! i want to try that too on my picture site

uhm i cant find any new releases. Its still 5.6

Oh... correction, it seems the name is still 5.6 but in the script itself it has been updated :- )

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re: resizing images
« Reply #7 on: July 25, 2002, 10:40:23 »
Yep, my update process is confusing, but otherwise we'd be at album.pl v268 right now.  ;D
« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »

Offline Kheperi

  • album.pl Tester
  • **
  • Posts: 31
  • Karma: +0/-0
  • I did, I did change the default text!
Re: resizing images
« Reply #8 on: July 25, 2002, 12:42:15 »
Got it working! :- )
I had to change a few things more then the 4 files you named though. In fact i replaced everything, to get it finally running ok. Didnt probably need to do all of that but oh well :- ) wasnt too much work.

And its working great! this is exactly what i wanted! :-)

Is it possible to set a default? It now pics full size, but i think i would like to have medium as default... hehe there will always be something to whish for i guess :- )
You know what would be cool... fullscreen pictures with some sort of on screen display with a set of buttons that only appear when moving the mouse or so  8)
« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re: resizing images
« Reply #9 on: July 25, 2002, 13:45:29 »
I'll see what I can do about the "default" business. The full screen slideshow I think is beyond my capabilities, since we're still stuck with viewing these things through a browser... :)
« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »

Offline Kheperi

  • album.pl Tester
  • **
  • Posts: 31
  • Karma: +0/-0
  • I did, I did change the default text!
Re: resizing images
« Reply #10 on: July 26, 2002, 12:37:11 »
that fullscreen stuff was just me dreaming loud  ;D
But i really look forward to the posibility of a default setting of the immage size.
« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »

Offline WyldeCard

  • album.pl User
  • *
  • Posts: 11
  • Karma: +0/-0
  • album.pl ... The best!
Re: resizing images
« Reply #11 on: July 26, 2002, 19:39:27 »

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re: resizing images
« Reply #12 on: July 26, 2002, 22:42:10 »
Cool, thanks Dale! I'll play with it and see how it works. I'm very limited with my JS, so this kind of thing helps!

Cheers
« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »

Offline Kheperi

  • album.pl Tester
  • **
  • Posts: 31
  • Karma: +0/-0
  • I did, I did change the default text!
Re: resizing images
« Reply #13 on: July 27, 2002, 00:46:55 »

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re: resizing images
« Reply #14 on: July 30, 2002, 11:29:26 »
Ok, I've updated album.pl to "remember" what size you were viewing at previously. This only lasts while your browsing around the album for that session, as it becomes a passed variable, like the ones used to enter descriptions or turn on debugging...

Cheers
« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »