Is there a way to get better resizing for pics?

pezastic
pezastic's picture

Joined: 2003-06-28
Posts: 65
Posted: Tue, 2003-12-30 15:34

Is there a way to allow viewers to click on an individual picture and be taken to that picture's source? That would enable the web browser to do any necessary resizing. That way, the pic would be as large as possible, while staying within the web browser's border.

This may be something that can be hacked, in order to create the aforementioned situation? Is there anyone that knows how to do this?

 
Gaile

Joined: 2002-07-20
Posts: 1301
Posted: Tue, 2003-12-30 19:29

... moved to Customizing Gallery ...

 
pezastic
pezastic's picture

Joined: 2003-06-28
Posts: 65
Posted: Fri, 2004-01-02 13:05

Perhaps more explanation is needed?

By default, upon clicking an image in Gallery, a viewer is taken from:

www.sitename.com/gallery/albumname/imagename

to:

www.sitename.com/gallery/albumname/imagename?full=1

Often times, large images are well beyond the extent of the viewer's screen size, necessitating a vertical and/or horizontal scroll to see the image.

Instead, I would like a viewer to be taken to:

www.sitename.com/gallery/albums/albumname/imagename.jpg

That way, only the source image would be in the viewer's web browser, allowing it (the web browser) to resize the image so that it (the image) doesn't go past the extent of the web browser's window.

How can I do this?

 
wsellers

Joined: 2004-01-04
Posts: 2
Posted: Sun, 2004-01-04 04:05

Hey pixelpoet---- Did you ever get this resizing thing fixed? I have a similar problem...

If you can, go to: http://www.wsellers.com/gallery

Check out some of the older albums.... see how when you click on them from the thumbnail--- they resize to a nice size pic---- if you click again on that same image---- it resizes just a little bit....

OK... look at the group "01-03-2004 - Perks" See how when you click again on the pic (after the thumbnail) --- it resizes to a huge pic?! How can I fix it like the others... I don't know WHAT I did ;) any help would be appreciated.

Thanks,
Will

 
pezastic
pezastic's picture

Joined: 2003-06-28
Posts: 65
Posted: Sun, 2004-01-04 05:35

Even pics from your older albums surpass the boundaries of an 800x600 web browser. If a viewer could get to the source, as referenced in my previous post, the web browser could do the resizing. To me, that is the ideal setup.

The image gallery zoph has this setup, but I can't get it to work on my host. It requires gd2 and I only have image magick installed. If I could configure it to use a gd2 installed to my website home directory, I would use that image gallery instead of this one.

Then again, there has to be a way of altering Gallery to access the image sources, as referenced above. For me, that would be the ideal situation.

 
wsellers

Joined: 2004-01-04
Posts: 2
Posted: Sun, 2004-01-04 07:58

FYI--- Hum... I am still having trouble when I want to view anything else besides the intermedia picture size (click after thumbnail) --- If I click a third time on the image---- its HUGE. I want the larger pic to "fix to" the browser. I checked permissions, even tried uploading a new version... Still same problem.

I must not be seeing something simple... Anyone please give me a solution ;)

 
Gaile

Joined: 2002-07-20
Posts: 1301
Posted: Sun, 2004-01-04 09:45
wsellers wrote:
Hey pixelpoet---- Did you ever get this resizing thing fixed? I have a similar problem...

Thanks,
Will

Hi Will

Actually, I wasn't looking into fixing it? Sorry! :( I just moved this post to the correct forum. Hopefully someone will have some ideas.

Gaile

 
pezastic
pezastic's picture

Joined: 2003-06-28
Posts: 65
Posted: Thu, 2004-01-08 13:35

Is there anyone that can guide me toward finding a solution to my problem, outlined in the first and third post of this thread?

 
Gaile

Joined: 2002-07-20
Posts: 1301
Posted: Thu, 2004-01-08 17:56

I might be missing something here, but why not just use the Gallery settings to set the size?

Aside from IE - I don't think any other browsers will "set" the photo size to fit the browser window.

Using Gallery and setting a maximum size seems like a more elegant solution, imo.

Gaile

 
pezastic
pezastic's picture

Joined: 2003-06-28
Posts: 65
Posted: Fri, 2004-01-09 22:14

Maybe I am missing something here. I thought that most viewers would be using IE. I also thought that their display settings would not be so universal. Given those assumptions, having Gallery do the resizing of images just doesn't make sense to me.

My pics are taken at 1600x1200. If I set Gallery to resize my pics to 640x480, that is fine for a display setting of 800x600. However, at 1024x768, it looks very small.

So, a hack that would take the viewer to the image source would enable the web browser to keep the image as large as possible, without going beyond its borders, regardless of the display setting.

 
Gaile

Joined: 2002-07-20
Posts: 1301
Posted: Sat, 2004-01-10 19:05

Hi pezastic

Even if most of your viewers are using IE, not all of them will have the resize feature of that browser turned on. It was one of the first things I turned off when I used IE, because I found it annoying (like their toolbar that shows up over images)!

At any rate - I understand what it is you're wanting to do, but here is another thing to consider: are all your users on superfast computers with high speed internet access? Even on cable access I find larger images are slow to load at times, but it is your Gallery and you know your own target audience - so I won't say anything more! ;)

Most likely what you want to do is possible, but you may have to hack around in the code yourself to figure it out, since there doesn't appear to be too many others interested in this feature (that have come forward here). If you do find a solution I hope you'll post it here to share with anyone else looking for the same thing.

Good luck, and have fun with Gallery!

Gaile

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2004-01-10 21:40

I too am not convinced a direct link to the image is right for everybody, but here's a patch to do it so you can try it out..
Edit view_photo.php and search for print_photos. The first place you find this string should be a line starting with "if (isset".. just above this line add:

$adminCommands .= '<a href="' . $gallery->album->getPhotoPath(
$index, $gallery->user->canViewFullImages($gallery->album)) . '">[' .
_("source image") . ']';

This creates a link to the full size image if the user has access, otherwise the resized version. The link will appear in the top command bar. Enjoy..

 
pezastic
pezastic's picture

Joined: 2003-06-28
Posts: 65
Posted: Mon, 2004-01-12 09:36

Is there any way to integrate it more into the clicking scheme of Gallery? Here is what currently happens in a Gallery default setup:

1. From the album, clicking on the image sends the viewer to the normal image view - ...albumname/imagename.jpg

2. From the normal image view, clicking on the image sends the viewer to the full image view - ...albumname/imagename.jpg?full=1

3. From the full image view, clicking on the image sends the viewer back to the normal image view - ...albumname/imagename.jpg

Here is what I would like to change:

3. From the full image view, clicking on the image sends the viewer to the source image view - ...albums/albumname/imagename.jpg

That way, a viewer could still have two image sizes controlled by Gallery, normal and full, and be able to follow an image to its source by clicking on it. This would be far more user-friendly than having to click on a link, something that novice viewers wouldn't even see most of the time.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2004-01-20 17:20

Find this code in view_photo.php:

            if ($full) {
                    $href= makeAlbumUrl($gallery->session->albumName, $id);
            } else if ($gallery->user->canViewFullImages($gallery->album)) {
                    $href= makeAlbumUrl($gallery->session->albumName, $id, array("full" => 1));
            }

Change the first "$href=" to:
$href= $gallery->album->getPhotoPath($index, $gallery->user->canViewFullImages($gallery->album));
That might do it..

 
pezastic
pezastic's picture

Joined: 2003-06-28
Posts: 65
Posted: Wed, 2004-01-21 01:13

Thanks a bunch! That worked perfectly!

 
Jhearad

Joined: 2005-02-11
Posts: 10
Posted: Fri, 2005-02-11 00:33

Is there any way to make a similar change, but in such a way that you go from a thumbnail, to the intermediate image, then directly to the original image. I effectively want the same system as the one pezastic was after, but skipping the ...albumname/imagename.jpg?full=1 bit. What would I have to change in view_photo.php to achieve that? Many thanks for any help.

 
Jhearad

Joined: 2005-02-11
Posts: 10
Posted: Fri, 2005-02-11 16:42

OK, got it, all I needed to do was to change

else if ($full) { 
			$href= makeAlbumUrl($gallery->session->albumName, $id);
	 	} else if ($gallery->user->canViewFullImages($gallery->album)) {
			$href= makeAlbumUrl($gallery->session->albumName, $id, array("full" => 1));
		}

to

else if ($full) { 
			$href= makeAlbumUrl($gallery->session->albumName, $id);
	 	} else if ($gallery->user->canViewFullImages($gallery->album)) {
			$href= $gallery->album->getPhotoPath($index, $gallery->user->canViewFullImages($gallery->album));
		}

This works well as long as clickable image dimensions are hidden. If they are not, it still opens the full image inside the gallery.