|
Replies:
22
-
Pages:
2
[
1
2
| Next
]
-
Last Post:
12 May 17, 23:37
Last Post By: MarkE
|
Threads:
[
Previous
|
Next
]
|
|
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
|
|
|
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
|
|
|
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
|
|
|
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.
|
|
|
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
|
|
|
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.
|
|
|
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
|
|
|
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.
|
|
|
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 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.
|
|
|
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
|
|
|
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.
|
|
|
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
|
|
|
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 ...
|
|
|
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
|
|
|
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.
|
|
|
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
|
|
|
I will release my Util.js library with the upcoming Tiger skin
Tiger? Is that the Turtle 2?!
|
|
|
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
|
|
|
Tiger? Is that the Turtle 2?!
Yes - evolution...
|
|
|
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
|
|
|
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
|
|
|
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
|
|
|
Not yet, you can ask here until.
|
|
|
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
|
|
|
Not yet, you can ask here until.
How about if I email you? Still, the same address?
|
|
|
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
|
|
|
Tiger? Is that the Turtle 2?!
Yes - evolution...
Skipping right over that whole "dinosaur" thing, eh? Not even a pause for some marsupials?
|
|
|
|
Legend
|
|
Forum admins
|
|
Helpful Answer
|
|
Correct Answer
|
|