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-2017 23:37 Last Post By: MarkE Threads: [ Previous | Next ]
drmikey

Posts: 885
Registered: 22-Dec-2006
Generating both regular and hiDPI images/thymbs for use in the same album?
Posted: 12-May-2017 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
jGromit

Posts: 32,108
Registered: 31-Jan-2006
Re: Generating both regular and hiDPI images/thymbs for use in the same album?
Posted: 12-May-2017 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: 885
Registered: 22-Dec-2006
Re: Generating both regular and hiDPI images/thymbs for use in the same album?
Posted: 12-May-2017 02:16   in response to: jGromit in response to: jGromit
 
  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.
jGromit

Posts: 32,108
Registered: 31-Jan-2006
Re: Generating both regular and hiDPI images/thymbs for use in the same album?
Posted: 12-May-2017 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.
jGromit

Posts: 32,108
Registered: 31-Jan-2006
Re: Generating both regular and hiDPI images/thymbs for use in the same album?
Posted: 12-May-2017 02:43   in response to: jGromit in response to: jGromit
 
  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: 7,099
Registered: 6-Sep-2005
Re: Generating both regular and hiDPI images/thymbs for use in the same album?
Posted: 12-May-2017 08:25   in response to: jGromit in response to: jGromit
 
  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: 1,532
Registered: 12-Nov-2003
Re: Generating both regular and hiDPI images/thymbs for use in the same album?
Posted: 12-May-2017 08:50   in response to: jGromit in response to: jGromit
 
  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 ...
jGromit

Posts: 32,108
Registered: 31-Jan-2006
Re: Generating both regular and hiDPI images/thymbs for use in the same album?
Posted: 12-May-2017 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: 3,048
Registered: 24-Apr-2006
Re: Generating both regular and hiDPI images/thymbs for use in the same album?
Posted: 12-May-2017 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: 7,099
Registered: 6-Sep-2005
Re: Generating both regular and hiDPI images/thymbs for use in the same album?
Posted: 12-May-2017 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: 3,048
Registered: 24-Apr-2006
Re: Generating both regular and hiDPI images/thymbs for use in the same album?
Posted: 12-May-2017 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: 7,099
Registered: 6-Sep-2005
Re: Generating both regular and hiDPI images/thymbs for use in the same album?
Posted: 12-May-2017 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: 3,048
Registered: 24-Apr-2006
Re: Generating both regular and hiDPI images/thymbs for use in the same album?
Posted: 12-May-2017 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?
jGromit

Posts: 32,108
Registered: 31-Jan-2006
Re: Generating both regular and hiDPI images/thymbs for use in the same album?
Posted: 12-May-2017 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: 21,854
Registered: 18-Oct-2002
Re: Generating both regular and hiDPI images/thymbs for use in the same album?
Posted: 12-May-2017 14:17   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
Tiger is a great example of evolution, and Laza is the great mind behind it! :-)

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