[SOLVED] Gallery is stretching my images to fit browser window

paulmcnelis

Joined: 2008-03-26
Posts: 32
Posted: Fri, 2009-09-04 20:01

The original uploaded file is 1079 x 800 pixels. On my 1680x1050 resolution monitor, when when you click on the above image to see the full size, gallery stretches it to 1211 x 897! You can clearly see the pixelation.

Why is Gallery doing this???? Why is gallery touching the full size image at all in the first place? Leave it alone G3! You've resized it for display within the gallery like a good dog. When I click on full size, I want to see original, full size, not stretch-to-fit! Bad dog!

I know this is a beta, so I'm gonna tough it out and see what transpires. I'm a big fan of less is more, but I don't have a good feeling about this... especially coupled with the fact that the themes have been made more difficult to customize.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Sat, 2009-09-05 01:40

The original is not resized. NOTE the original in G3 does get modified if you rotate it. The keeporiginal module can come in handy for that:
http://codex.gallery2.org/Gallery3:Modules:keeporiginal

See your original here:
http://www.mindink.com/gallery/var/albums/insect-photos/ants-formicidae/formica-incerta-ants/formica-incerta-ant-2.jpg

The default theme is using javascript to stretch the image to fit the window. This was an oft requested feature. Change it as you see fit as it's only a function of the particular theme. While Serge's theme still scales the image with the window he is using a completely different method:
http://photo.dragonsoft.us/

Look at the source of the page or page or any default theme's photo page and you'll see this comment:

Quote:
<!-- Use javascript to show the full size as an overlay on the current page -->

But do please continue to give input, we need it to help make things easier to change or create docs. Aside from the menu issue which I'm awaiting feedback on. What in G3 more difficult to customize? What are you having problems with? What are you comparing it to?
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
paulmcnelis

Joined: 2008-03-26
Posts: 32
Posted: Sat, 2009-09-05 12:47

So, how do i stop the theme from stretching the image either up or down? I don't know how to alter the code.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Sat, 2009-09-05 14:26

What in G3 more difficult to customize? What are you having problems with? What are you comparing it to?

If you're going to alter a theme first I'd suggest cloning the default them. If you make changes to the default them and upgrade your changes will be overwritten:
http://codex.gallery2.org/Gallery3:Tutorials:Themes

And be aware that with G3 being in beta still if you make major changes to your theme, an upgrade might break your changes so you may need to make modifications again. I know Serge D who created that theme I linked to above has had to make many changes just because of changes to the code base.

First make sure you're using the latest code:
http://codex.gallery2.org/Gallery3:Upgrading

One way to go about it is to remove this code from photo.html.php:

<? if (access::can("view_full", $theme->item())): ?>
<!-- Use javascript to show the full size as an overlay on the current page -->
<script>
  $(document).ready(function() {
    $(".gFullSizeLink").click(function() {
      $.gallery_show_full_size(<?= html::js_string($theme->item()->file_url()) ?>, "<?= $theme->item()->width ?>",
 "<?= $theme->item()->height ?>");
      return false;
    });
  });
</script>
<? endif ?>

Now if you click on the image to view full size, you just get sent straight to the full size image, no styling, no cool overlay.

If you still want a cool overlay, I'd hit google and start searching (sorry, I'm not a coder, developer, web designer, etc :) )

Here's the code that displays the image on the photo page with a link to the full size image

    <? if (access::can("view_full", $item)): ?>
    <a href="<?= $item->file_url() ?>" class="gFullSizeLink" title="<?= t("View full size")->for_html_attr() ?>">
      <? endif ?>
      <?= $item->resize_img(array("id" => "gPhotoId-{$item->id}", "class" => "gResize")) ?>
      <? if (access::can("view_full", $item)): ?>
    </a>
    <? endif ?>

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
paulmcnelis

Joined: 2008-03-26
Posts: 32
Posted: Wed, 2009-09-23 23:13

All I would like is the overlay without the resizing code.

I don't understand why this is a standard feature. The image should not be resized beyond it's full size resolution. There is no option to turn this on/off (the resizing portion that is). If my monitor resolution was 5,000 x 5,000 the image shouldn't resize from 700x500 to 5,000 x 5,000, it should just show the full size 1280x960 for example.

It just seems common sense to me. If I'm a professional photographer (and I'm not) using G3, I definitely don't want my images resized and pixelated to fit someone's monitor whose resolution is larger than the original image, thus making the images look anything BUT professional.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Wed, 2009-09-23 23:25
Quote:
I don't understand why this is a standard feature.

Because the majority of the people want it like this. 5000x5000 monitor is unrealistic :) But I get what you're saying. Create a theme to do what you want. This is just default, out of the box behavior that the vast majority of people will like and not even touch. A handful of people, like you, will want to customize Gallery or a theme in some fashion. We can't create options for every little thing otherwise G3 would be huge and bloated (see G2 with the X_Treme theme).

Most G2 installs I've seen use Matrix or Carbon, totally uncustomized. :) But editing themes in G2 is also a total PITA. In G3 as long as you know a bit of HTML and CSS you should be able to get pretty much anything you want done. Otherwise, wait for a theme closer to what you want there are already a couple user contribute themes:
http://codex.gallery2.org/Category:Gallery_3:Themes
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
paulmcnelis

Joined: 2008-03-26
Posts: 32
Posted: Sat, 2009-09-26 00:20

Case in point: http://mindink.com/gallery/index.php/declan/aphid-1

The original photo is 500x400. My monitor's resolution is 1680x1050. When clicking on the above photo it stretches the 500x400 original image to 1122 x 897!

Why should someone have to customize the theme when this is pretty much a fault of the theme to being with. Seriously. I don't understand why anyone would want their images to stretch beyond their original size.

No one's asking to make a thousand customizations to make G3 bloatware. All I'm saying is that the devs need to put code into G3 so that the resize does not resize the original beyond it's original pixels.

I shouldn't have to customize the theme to FIX something that's inherently wrong to begin with.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Sat, 2009-09-26 02:14
Quote:
I shouldn't have to customize the theme to FIX something that I believe is inherently wrong to begin with.

There, fixed that for you. The theme isn't broken. You just don't like it's behavior. So yeah, you need to either wait for someone to create a theme that does what you want or make one yourself. G3 out of the box isn't going to fit the needs of everyone. So for those people they will need to customize it.

You are just 1 person, if every single user wanted something slightly different and we made an option for that, we'd have bloatware on our hands, or something very similar to G2 :). This is just the plain jane, default theme. There are going to be TONS of people who don't like it, just like the Matrix theme for G2.

Here's 3 user contributed themes already:
http://codex.gallery2.org/Category:Gallery_3:Themes

The "default carbonized" demo isn't active apparently as it looks like the author is using different software on their site right now.

The other 2 don't stretch the images for full size, though they do the same thing my modification above does.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22888
Posted: Sun, 2009-09-27 05:51

This issue HAS been resolved with this ticket:
http://sourceforge.net/apps/trac/gallery/ticket/695

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
simon-b

Joined: 2008-04-24
Posts: 4
Posted: Tue, 2009-09-29 03:02

I agree with paulmcnelis, it is quite ridiculous to blow an image up beyond its original physical size, especially in an application that is specifically built for the display of images! I can't believe for one minute that anyone who's in the image business, whether for profit or fun, would want this feature. Surely it's obvious that if you set a maximum image size in the Admin, then that's as big as it should get - and if you've got any sense you'll upload a file with those exact dimensions so that the image will display at its best.

Anyway, good on you all for creating the application, I'll be turning the "See full-size image" off (presumably by editing the php file as described above??) and then trying to wrap my head around customising the theme.

Simon

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Tue, 2009-09-29 03:56

simon-b, it's been fixed. Read the full thread before responding and you'll see Dave's response, the one right before your post :)

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22888
Posted: Tue, 2009-09-29 05:16
simon-b wrote:
Anyway, good on you all for creating the application, I'll be turning the "See full-size image" off (presumably by editing the php file as described above??) and then trying to wrap my head around customising the theme.

No need to customize anything.
Perhaps you don't know how to update your code? Please try an experimental version and the directions are in the Frequently Asked Questions section:
FAQ: How do I upgrade?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
petersra

Joined: 2009-10-13
Posts: 12
Posted: Fri, 2009-12-11 15:35

Greetings:

I understand that the decision to not scale image to fit the browser window has already been made in the development tree. However, I would like to reopen the issue it based upon some different reasoning.

When you open an Album, you see a set of thumbnails (image1). When you click on a thumbnail image you get a larger image (image2). Now, for most casual users this image is adequate.

But, some people may want to look closer at the image or see it in a larger form. Since there is no zoom function, the user is left to a) click in the image or b) select the "view full size" link at the top right. The resulting image (image3) fills the browser windows (Beta3 behavior) -- although there are some code problems in how this works (see below).

After some discussion (above), it was decided that image3 should not fill the browser window, instead gallery3 should honor the image attributes.

I believe that image3 should fill the browser window. Here are my arguments:

1. Gallery3 has no zoom capabilities. If a user wants to examine some component of the image, say some text in the image, the full browser image gets them closer.

2. Logically, using the "view full size" link should result in an image larger than what image2 is. However, that may not always the case based upon image attributes .

3. Several other products work this way, e.g. jalbum which I am using until gallery 3 is released.

4. I believe Gallery3 is moving from a photo based system toward a more general purpose multi-media solution. Jpeg files can be pictures or an image of a text document, e.g. obituary. A zoom or full browser image is very important in this model.

Beta 3 bug:

*The "view full size" link can malfunction using Firefox 3.5.5 on WINXP/Ubuntu 9.10. For some images, the larger image appears below the original image. See link below.

http://www.skatekey.net/gallery3/index.php/Peters-Cars/GTX-1965-2

Respectfully submitted,

Rob

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Fri, 2009-12-11 17:16
Quote:
I would like to reopen the issue it based upon some different reasoning.

It's already been discussed back and forth, a very heated discussion. There are some users who like that, there are others who don't. It was like this and it was changed. I doubt it's going to go back. In G1 and Jallery it's an option anyway. In G3, you'll need to edit/create a theme to do this.

Quote:
1. Gallery3 has no zoom capabilities. If a user wants to examine some component of the image, say some text in the image, the full browser image gets them closer.

Create a module or add that functionality to your theme or wait for someone to do that.

Quote:
2. Logically, using the "view full size" link should result in an image larger than what image2 is. However, that may not always the case based upon image attributes .

No, it shouldn't Full size is just that, the Full size, not "fit to screen", that would be a different option. One that G1/Jallery have. If you created your resize larger that your full size, then IMO, that's backwards.

Quote:
3. Several other products work this way, e.g. jalbum which I am using until gallery 3 is released.

G3 is not G1 or Jallery or any other product. Full size, is full size, not "fit to screen". That would be a different feature/option.

Quote:
Beta 3 bug:

*The "view full size" link can malfunction using Firefox 3.5.5 on WINXP/Ubuntu 9.10. For some images, the larger image appears below the original image. See link below.

Whether or not that exists in B3 it doesn't appear to be in the current code. Your link doesn't display that behavior to me in FF on XP.

My opinion was like yours because there were/are a fair number of people in G2 who wanted this and I welcomed this feature in G3. However, I gave in. Now, discussing this with you, I see the decision was correct. Full size is full size. Fit to screen is another option that would need to be created.

My suggestion, create a feature request for a "fit to screen" option:
http://sourceforge.net/apps/trac/gallery/

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22888
Posted: Sat, 2009-12-12 01:04
Quote:
My suggestion, create a feature request for a "fit to screen" option:
http://sourceforge.net/apps/trac/gallery/

That would be my suggestion as well as the old behavior was not what was desired by most.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team