rejetto forum

embedded thumbnails

rejetto · 20 · 10540

0 Members and 1 Guest are viewing this topic.

Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
Hi, i never digged in it too much, i don't have the need myself, but...
a lot of people is pissed by having 1000 pictures and 1000 files more for the thumbnails.
i know, as many of you, that JPEGs can contain thumbnails (as metadata [EXIF]). I'm unsure about PNGs, also because they apparently don't support exif.

Even limited to jpegs, i find this thing quite interesting.
Many pictures made by cameras already have a thumbnail inside.
So, we lack at least 2 things

1. a tool to inject thumbnails inside pictures that has no thumbnail.
2. HFS being able to quickly and easily provide the thumbnail inside the bigger file.

about #1
By a quick search, i found this freeware tool "exiftool", with an example on how to use it.
If we cannot build a brand new tool ourselves, we can assemble something working.
Provided the thumbnail (it can be generated with a dedicated tool, as we have many) in a file, the command would be
exiftool '-ThumbnailImage<=thumbnail.jpg' myBigPicture.jpg

By using exiftool we can initially determine if the bigPicture does already have a thumbnail, and in such case just skip it.
RAWR guys may be interested in adding a similar feature to their thumbnail maker. If they don't have functions to handle exif, they may call exiftool.

about #2
i already found a functions library called "dEXIF" that should fit our needs.
no time for a deeper test at the moment.
« Last Edit: July 13, 2009, 11:49:39 AM by rejetto »


Offline TSG

  • Operator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
I would rather proper icon support than this, personally. If you have the time to spend... Vista and 7 have really nice icons and its a shame that they cant be used by HFS. And XP has atleast 32x32 and 48x48 so I think it is worth the effort...

I like the idea, don't get me wrong, but I would prefer... after 3 years using HFS and hearing the complaints about the icons, to get that sorted out first. I am pretty sure you just have to display them as PNG24 or something and most browsers will work with the transparency, except IE6, but they will still show.
« Last Edit: July 13, 2009, 12:28:37 PM by TSG »


Offline bacter

  • Operator
  • Tireless poster
  • *****
    • Posts: 681
    • View Profile
Perhaps another approach could be to use the sprites technique, as it is used in many websites loading only one imagefile that contains all the bullets,smileys , small images and background items.

There are some tools that allow to join individual elements manually, but perhaps there is also a tool that could build a huge file containing all same-sized thumbnails.

The only problem is you have to create also an indexfile to get the offsets linked to the imagefiles.
But two files for one folder is not bad.

your computer has no brain - use your own !


Offline AvvA

  • Tireless poster
  • ****
    • Posts: 135
    • View Profile
If it can help you, i found this : http://www.exiv2.org/index.html
It's an API C++ library that can provide creation and insertion of the EXIF preview thing, if I understood clearly the thing ^^.

I put a flag on this topic to see progress about this thumbnails thing, and provide help if I can :)


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
I would rather proper icon support than this, personally.

a year ago (or the like) i spent some hours trying to get better icons, but i met some technical problem, maybe a bug of the libraries. honestly i don't remember.
i think at the time i didn't consider PNG24 because IE6 was much more used than today.
my website stats report IE6 being used by 15% of visitors (37% of IE users). That's still a lot, but since we are talking about a non-vital feature (icons would appear with a white background instead of transparent) it's virtually acceptable.

just for your information, at this right moment i have not my computer.  :'(
it was returned for assistence (days ago) because the display was broken (laptop), and i cannot work on HFS on this other computer.
they estimated €300 for fixing it (as i feared). Little sense. I think i will buy this for €86 and will try to replace it myself.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
Perhaps another approach could be to use the sprites technique, as it is used in many websites loading only one imagefile that contains all the bullets,smileys , small images and background items.

yes bacter, i already thought about it, and finally decided embedded was better.
sprite method has some cons:
if you delete a pic, the thumbnail is not deleted.
if you update a pic, the thumbnail is not updated.
if you move a pic to another folder, the thumbnail is not moved.
if you must load only a part of the thumbnails (paged browsing), you must load them all.

but it's still a good solution for static archives, probably better than classic 2-files per picture.


Offline TCube

  • Tireless poster
  • ****
    • Posts: 440
    • View Profile
Salut !

Am I off topic ?

Never had any problem with one XML page that fits with 3.92 Ifranview

url : Deleted

EXIF data iis all 2 simple 2 included : $d / $t .... etc ... depending on the metadata your can extract from your camera brand.

Please confirm  ;)

TC
« Last Edit: July 14, 2009, 11:47:40 AM by TCube »
Make it idiot-proof and I will make a better idiot


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile

Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
Never had any problem with one XML page that fits with 3.92 Ifranview
http://theperfumeater.no-ip.org/Photos%20albums/XML%20Original%20Thumbs%20and%20Show/

you built a static gallery, with 19 files for 6 photos.
if you change a photo, or delete it, you must rebuild the whole gallery, mustn't you?
i was suggesting a solution with 6 files for 6 photos, and no need to rebuild anything ;)


Offline TCube

  • Tireless poster
  • ****
    • Posts: 440
    • View Profile
Got your idea Rejetto  :D

Edit : thinking over it ... my point of view

- Thing is : I don't bother modifying photo gallery every time I'm looking at them (I mean I spend already a lot of work on every one of them being the best looking I can do with effects or no effects)
- Ifranview does generates thumbnails from which I can determined : size, background colours, columns per view, save configuration within *.ini set up files and finally which will include any metadata I want 2 show from my original camera facilities.
- Thus, yes files are multiplied with the XML page ... still Thumbnails show off very quickly  ;) (80x80 ... 100x100 ... etc)
- When user go 2 full size picture sideshow, if done correctly (800x600) it's not that bad.
- If I want to be smart and I don't even need to add a sub-directory to copy the full size picture ... these can be liked to the original folders (Your remark :19 files for 6 pictures)
- When I do have pictures folders within the HFS French Version : I don't authorised people/user 2 modify these folders (delete)
« Last Edit: July 15, 2009, 09:52:41 AM by TCube »
Make it idiot-proof and I will make a better idiot


Offline TSG

  • Operator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
I would rather proper icon support than this, personally.

a year ago (or the like) i spent some hours trying to get better icons, but i met some technical problem, maybe a bug of the libraries. honestly i don't remember.
i think at the time i didn't consider PNG24 because IE6 was much more used than today.
my website stats report IE6 being used by 15% of visitors (37% of IE users). That's still a lot, but since we are talking about a non-vital feature (icons would appear with a white background instead of transparent) it's virtually acceptable.

just for your information, at this right moment i have not my computer.  :'(
it was returned for assistence (days ago) because the display was broken (laptop), and i cannot work on HFS on this other computer.
they estimated €300 for fixing it (as i feared). Little sense. I think i will buy this for €86 and will try to replace it myself.

Ouch, Sorry to hear about your laptop. IE6 is dying a slow and painful death, YouTube is currently advertising that they plan to drop support for the browser. http://www.neowin.net/news/main/09/07/14/youtube-to-drop-support-for-ie-6 I have already dropped support, even on our website I just removed the drop down menu's in IE6. You choose to not upgrade your home computer, or use a better browser, you choose to lose out on features. With large corporate networks I can understand, but they should be on at least IE7 by now, its been over 2 years.

But still, if you can get them displaying in PNG24, in IE6 it will basically show the matte of each icon. That is what is happening with the current icons, and Why they look so bad. They are being converted to GIF from PNG24 and being flattened resulting in the matte showing through where the transparency colour should be present.
« Last Edit: July 14, 2009, 10:08:49 PM by TSG »


Offline AvvA

  • Tireless poster
  • ****
    • Posts: 135
    • View Profile
...But still, if you can get them displaying in PNG24, in IE6 it will basically show the matte of each icon. That is what is happening with the current icons, and Why they look so bad. They are being converted to GIF from PNG24 and being flattened resulting in the matte showing through where the transparency colour should be present.
Just a suggestion, isn't it possible to use a client-side solution like this one, or similar ?
This way you don't have to bother about which format you send to the browser.

Another way should be to make HFS modify each PNG file's header like explain there : http://phoenity.com/newtedge/png_degradability/ or alternatively convert them to 8 bits PNGs : http://kevinfreitas.net/pro/articles/png-magic/

But that seems heavy to me, I find the js/css solution much more convenient :)


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
this fix is just great!!!
i cannot test it myself, but i can trust the comments :)


Offline TSG

  • Operator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
There is a .htc fix that actually enables png transparency... or is it javascript... I dunno, but there is fix that works, but thats for less concern, I would rather have access to these images :)

I was thinking it could be accessed on /~img_file## so /~img_file16 all the way up to /~img_file256 once you get it working anyway. Of course if an icon doesn't support it, it should show the next higher or lower res available.


Offline AvvA

  • Tireless poster
  • ****
    • Posts: 135
    • View Profile
Quote
this fix is just great!!!
i cannot test it myself, but i can trust the comments :)
This works very well, the only bad side is that it asks for JavaScript, but as long as HFS templates are using it, it doesn't seem to be a problem :)
But, sorry if I disapoint you :P , you always can test this kind of things ;)
http://browsershots.org/http://www.twinhelix.com/css/iepngfix/demo/
more specifically : http://browsershots.org/screenshots/99355cc747dca021f12fba85a939c1d2/


There is a .htc fix that actually enables png transparency... or is it javascript... I dunno, but there is fix that works, but thats for less concern, I would rather have access to these images :)
It's the same thing as the one I linked, it's far more worked out though, but there are so many differents fixes...
It seems that those tricks -almost*- all pass thru the IE specific DXImageTransform.Microsoft.AlphaImageLoader and javascript (*there are server side tips also ^^).

But well, this was only an explicative example on how to free HFS from eating my processor ressources :)
I won't go into details, but making HFS a Gimp/CS/Irfanview isn't a good idea, I think :P
I also like PNG format, but I also know that it's far from a ressourceless conversion, JPG or GIF should be more appropriate to the task, as there are a lot of icons in an utilities share folder, in example.

I was thinking it could be accessed on /~img_file## so /~img_file16 all the way up to /~img_file256 once you get it working anyway. Of course if an icon doesn't support it, it should show the next higher or lower res available.
Unless i miss something, you got it, this is a client-side fix, it doesn't concern what you're talking about. You'll have access to the icon, like you said or another way, but you just won't have to deal with graphical tasks, just send the pic and leave the template do the work for you if necessary, as IE6 is the only concerned.


But okay, now i've exposed what I think, even if it's worthless ^^, I bounce again on the second main topic thing ;D (TSG's request for 7/Vista icon support)

By searching to help someone with PNG conversion, I link him to my favorite program :)
By watching more closely, I re-discover that source code was given. I think this could perhaps help you, as the second subject touch conversion in a certain way...
http://psydk.org/PngOptimizer.php?lang=en

This utility, in command line version, offers to play with transparency, and makes "minded" conversions.


note to moderators :
Perhaps it should be a good idea to split this topic, "EXIF for thumbnails" and "vista/seven icons support", these two are linked but different things, I think :)