This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 8 - Pages: 1 - Last Post: 18-Nov-2017 15:02 Last Post By: jGromit
additus

Posts: 84
Registered: 3-May-2009
Set max image size possible?
Posted: 07-Oct-2017 13:49
 
  Click to reply to this thread Reply
Responsive layout is of course good for mobile platforms, but it´s not good on big screens when the maximum image size is exceeded. Is there a way to put a maximum upper limit to which image will be exposed? I have found maximum size setting for page, but I guess that something else.

Edited by: additus on 07-Oct-2017 13:49
jGromit

Posts: 33,164
Registered: 31-Jan-2006
Re: Set max image size possible?
Posted: 07-Oct-2017 14:07   in response to: additus in response to: additus
 
  Click to reply to this thread Reply
If you go to Tiger > Lightbox > Main image > Images and check Never scale up, the images will never be shown larger than they really are, determined by the image bounds you've set under Album > Settings > Images > General > Image bounds
additus

Posts: 84
Registered: 3-May-2009
Re: Set max image size possible?
Posted: 16-Nov-2017 16:12   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
Thank you for replying! Even when setting the album in this way the images are scaled up. (I am using HiDPI images, if it may affect this). The test-album is here: www.cherrug.se/Test2.
jGromit

Posts: 33,164
Registered: 31-Jan-2006
Re: Set max image size possible?
Posted: 16-Nov-2017 17:14   in response to: additus in response to: additus
 
  Click to reply to this thread Reply
additus wrote:
I am using HiDPI images, if it may affect this....

Yes, exactly. If you set image bounds of, say, 1000x800, and also choose HiDPI images, the actual images may be as large as 2000x1600. The script that displays them in the album looks at the actual dimensions to decide how large it can display the image without any browser expansion.

If you really want to limit the images to 1000x800, do not choose HiDPI images.

(Laza - same problem in Matrix, and since I don't control the script in that skin, I've never figured out how to address it. In short, the script isn't looking at the HTML reported image width and height - it's looking at the real image width and height. Not sure whether you can do anything about this in TIger.)
additus

Posts: 84
Registered: 3-May-2009
Re: Set max image size possible?
Posted: 16-Nov-2017 20:16   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
Thank for your explanation! This is however not a solution because I am losing to much in image quality using e.g. Retina displays. Have to stick to Turtle then.
Laza

Posts: 9,467
Registered: 6-Sep-2005
Re: Set max image size possible?
Posted: 17-Nov-2017 09:17   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
In practice a HiDpi image of 2000x1600 pixels (1000x800) is indistinguishable from a normal 2000x1600 image. Should we detect the browser's dpi to deliver the best image size?
jGromit

Posts: 33,164
Registered: 31-Jan-2006
Re: Set max image size possible?
Posted: 17-Nov-2017 13:05   in response to: Laza in response to: Laza
 
  Click to reply to this thread Reply
Laza wrote:
In practice a HiDpi image of 2000x1600 pixels (1000x800) is indistinguishable from a normal 2000x1600 image. Should we detect the browser's dpi to deliver the best image size?

No, way too complicated. I think the answer is simpler than that. There really is no such thing as a "HiDPI image." It's just an image that's twice the size. So how does that work? Simple. jAlbum just lies to the HTML about how large it is.

A simple HTML skin doesn't ask the JPG how large it is. It asks jAlbum, and then does something like this:
<img src="${imagePath}" height="${imageHeight}" width="${imageWidth}">
So, the lie works, and the browser shows the image in a space that's actually half the size of the image. For a retina display, that's great, and for a normal display it's undetectable, other than having to do some quick browser resizing.

In a scripted skin like Matrix or Tiger, that's a problem, since the script normally isn't asking jAlbum what the image dimensions are. The script is just looking at the JPG itself, and not enlarging it beyond its actual dimensions. So the lie doesn't work.

I'm not sure how, but Turtle is currently doing this correctly. If you tell it to "shrink only," and give it a HiDPI image that's actually 2000x1600, it never shows it larger than 1000x800. Apparently, Turtle is paying attention to the phony imageWidth and imageHeight numbers that jAlbum is cranking out. So it does what's intended - it shows the image in half the space of its actual dimensions. Good for retina, with its higher pixel density, no problem for regular displays.

So what's the answer? Somewhere in your script in Tiger, if the choice is never to enlarge the image beyond its real dimensions, the script needs to say, "don't make this bigger than imageWidth x imageHeight, regardless of the JPG's actual dimensions."
Laza

Posts: 9,467
Registered: 6-Sep-2005
Re: Set max image size possible?
Posted: 18-Nov-2017 10:03   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
Thanks Gromit, this helps me a lot. Probably I went through this already with Turtle, but I forgot...
jGromit

Posts: 33,164
Registered: 31-Jan-2006
Re: Set max image size possible?
Posted: 18-Nov-2017 15:02   in response to: Laza in response to: Laza
 
  Click to reply to this thread Reply
Laza wrote:
Probably I went through this already with Turtle, but I forgot...

Yeah, I find stuff in my own code that I wrote only a few months ago, and don't remember at all. But then again, I'm an old man, and I'm confused. ;)
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums