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


Permlink Replies: 22 - Pages: 2 [ 1 2 | Next ] - Last Post: 12 May 17, 23:37 Last Post By: MarkE Threads: [ Previous | Next ]
drmikey

Posts: 208
Registered: 22-Dec-2006
Generating both regular and hiDPI images/thymbs for use in the same album?
Posted: 12 May 17, 01:15
 
  Click to reply to this thread Reply
With the increasing popularity and use of responsive image support (picture and/or srcset) in web pages these days (i.e, for lazy loading images or showing on hiDPI devices), it is reasonable to have the option in Jalbum to produce images and thumbs at the same album generation with different resolutions/sizes, etc. I have searched the forum but can't find any info on an option and/or code to be able to generate both regular thumbs/images and hiDPI thumbs/images at the same time for use in this way. Is this possible?
If not, seems something to consider adding in v14?

Mike
JeffTucker

Posts: 8,039
Registered: 31-Jan-2006
Re: Generating both regular and hiDPI images/thymbs for use in the same album?
Posted: 12 May 17, 01:40   in response to: drmikey in response to: drmikey
 
  Click to reply to this thread Reply
You could traverse the album objects, perhaps in the postdir.bsh file, and feed them through the image processor with image bounds of your own choosing, and write them out to your own directory, like bigthumbs. See scaleToFit().

And remember, there's nothing "magic" about HiDPI images - they're just generated using double the stated image bounds.

My dinner is ready - I'll post back later with some sample code.
drmikey

Posts: 208
Registered: 22-Dec-2006
Re: Generating both regular and hiDPI images/thymbs for use in the same album?
Posted: 12 May 17, 02:16   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
I love Magic! ( I understand that issue).
Anyway, thanks! Here is a more accurate description of what I am thinking about and why I would like to generate multiple images.
JeffTucker

Posts: 8,039
Registered: 31-Jan-2006
Re: Generating both regular and hiDPI images/thymbs for use in the same album?
Posted: 12 May 17, 02:35   in response to: drmikey in response to: drmikey
 
  Click to reply to this thread Reply
Yes, I've looked at the srcset stuff before, and I have the impression that it's a solution that is misguided, and will be made obsolete by technology.

Think about it - why don't you just provide the higher resolution image at all times? If you want to show a 200x200px image, just provide one that's 400x400px, but let CSS scale it down to size.

The answer seems to be, "to save bandwidth when it's not really needed." And yet, where would one most need the higher resolution? On a high-density display, most often found on mobile devices... where, as luck would have it, bandwidth might actually be an issue! So, you're saving bandwidth where it's not really a concern (big home PC monitor), but using more bandwidth where it really is an issue (mobile device).

As available bandwidth continues to increase, I think we will soon get to a point at which it's just not an issue any longer, and all of these complicated coded solutions will be unnecessary.
JeffTucker

Posts: 8,039
Registered: 31-Jan-2006
Re: Generating both regular and hiDPI images/thymbs for use in the same album?
Posted: 12 May 17, 02:43   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
In any event, while I don't really have the energy to put together a full working solution, conceptually all you need to do is march through the album objects and generate some custom images.
AlbumImage ai = new AlbumImage(new File(fileName), engine);
ai = ai.scaleToFit(new Dimension(400, 400));
ai.saveImage(new File("bigthumbs", fileName), 75);
The 400's are the image bounds, and the 75 is the JPG quality.

What I can't work out at the moment is how to deal with things like the representing thumbnails for folders. I think you'd need to grab something like representingFile for the folders.
Laza

Posts: 1,732
Registered: 6-Sep-2005
Re: Generating both regular and hiDPI images/thymbs for use in the same album?
Posted: 12 May 17, 08:25   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
I will release my Util.js library with the upcoming Tiger skin, which already has a function that creates extra image sizes. Although it's not made for thumbs I think it'll be easy to tweak it.

Another option could be adding both normal and HiDPI thumbs, e.g.
${thumbPath} = "thumbs/foo.jpg"
${hiResThumbPath} = "thumbs/hires/foo.jpg"
This wouldn't break old skin.

In my opinion the Hi Res images can be spotted only in special cases, with line art images, scanned documents, but with normal continuous tone images it's hard to tell any difference beyond 160 dpi.
Dschuwi

Posts: 296
Registered: 12-Nov-2003
Re: Generating both regular and hiDPI images/thymbs for use in the same album?
Posted: 12 May 17, 08:50   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
jGromit wrote:
So, you're saving bandwidth where it's not really a concern (big home PC monitor), but using more bandwidth where it really is an issue (mobile device).

As available bandwidth continues to increase, I think we will soon get to a point at which it's just not an issue any longer, and all of these complicated coded solutions will be unnecessary.


I think this will always be an issue, just like it is with HDD space or computing power. They are incredibly huge nowadays, compared to what we were used to in our beginnings, yet the demands keep rising and we need more space and power again ... an eternal game.

Regarding mobile devices: Hi-dpi images are not a question of hi-dpi monitors. The screen resolution can be very low on a mobile, but we are used to pinch and zoom into everything we see - so it makes sense especially on mobile devices to provide hi-dpi tiny pix ...
JeffTucker

Posts: 8,039
Registered: 31-Jan-2006
Re: Generating both regular and hiDPI images/thymbs for use in the same album?
Posted: 12 May 17, 09:00   in response to: Dschuwi in response to: Dschuwi
 
  Click to reply to this thread Reply
Dschuwi wrote:
Regarding mobile devices: Hi-dpi images are not a question of hi-dpi monitors. The screen resolution can be very low on a mobile, but we are used to pinch and zoom into everything we see - so it makes sense especially on mobile devices to provide hi-dpi tiny pix ...

But that's exactly my point. The bandwidth issue is mostly a mobile device problem, and yet that's where you really want the HiDPI images! So why not just feed the HiDPI images to all visitors?

And I'm not sure that the demands will always exceed the capacity. I remember the earliest use of videos on web pages - starting, stopping, endless buffering. Haven't encountered that in a long time unless a site is having some kind of server problems. And when it comes to storage space, even a low-end PC comes with a TB drive, yet my total storage in use, including the OS, is less than 200GB.
MarkE

Posts: 206
Registered: 24-Apr-2006
Re: Generating both regular and hiDPI images/thymbs for use in the same album?
Posted: 12 May 17, 09:34   in response to: Laza in response to: Laza
 
  Click to reply to this thread Reply
Laza wrote:
I will release my Util.js library with the upcoming Tiger skin

Tiger? Is that the Turtle 2?!
Laza

Posts: 1,732
Registered: 6-Sep-2005
Re: Generating both regular and hiDPI images/thymbs for use in the same album?
Posted: 12 May 17, 09:44   in response to: MarkE in response to: MarkE
 
  Click to reply to this thread Reply
MarkE wrote:
Tiger? Is that the Turtle 2?!
Yes :) - evolution...
MarkE

Posts: 206
Registered: 24-Apr-2006
Re: Generating both regular and hiDPI images/thymbs for use in the same album?
Posted: 12 May 17, 09:53   in response to: Laza in response to: Laza
 
  Click to reply to this thread Reply
Laza wrote:
MarkE wrote:
Tiger? Is that the Turtle 2?!
Yes :) - evolution...

It never stops .....

Do you have a dedicated place in the Forum ... I may ask you questions there ....

Ta,

Mark
Laza

Posts: 1,732
Registered: 6-Sep-2005
Re: Generating both regular and hiDPI images/thymbs for use in the same album?
Posted: 12 May 17, 10:54   in response to: MarkE in response to: MarkE
 
  Click to reply to this thread Reply
Not yet, you can ask here until.
MarkE

Posts: 206
Registered: 24-Apr-2006
Re: Generating both regular and hiDPI images/thymbs for use in the same album?
Posted: 12 May 17, 11:03   in response to: Laza in response to: Laza
 
  Click to reply to this thread Reply
Laza wrote:
Not yet, you can ask here until.

How about if I email you? Still, the same address?
JeffTucker

Posts: 8,039
Registered: 31-Jan-2006
Re: Generating both regular and hiDPI images/thymbs for use in the same album?
Posted: 12 May 17, 13:41   in response to: Laza in response to: Laza
 
  Click to reply to this thread Reply
Laza wrote:
MarkE wrote:
Tiger? Is that the Turtle 2?!
Yes :) - evolution...

Skipping right over that whole "dinosaur" thing, eh? Not even a pause for some marsupials?
davidekholm

Posts: 3,442
Registered: 18-Oct-2002
Re: Generating both regular and hiDPI images/thymbs for use in the same album?
Posted: 12 May 17, 14:17   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Tiger is a great example of evolution, and Laza is the great mind behind it! :-)
Legend
Forum admins
Helpful Answer
Correct Answer

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