rejetto forum

thumbnails

rejetto · 10 · 13819

0 Members and 1 Guest are viewing this topic.

Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13521
    • View Profile
i've found that extracting the thumbnail that's sometimes embedded in a jpeg can be easy with a method that's probably not 100% reliable but took me little work.
I'm going to introduce this new feature even if the default tpl will not make use of it for now.
It can be considered experimental.
The feature works like this: you append ?mode=thumb to the url of a jpg file.
The thumbnail itself is served as a file. If not available you'll get a 404.
Generating a thumbnail is of course much worse on the CPU and poses some serious concerns: store it? and where?
It may be introduced in the future, but it's not a quick job as the one i just did.

You'll find it in the RC7 i'm going to release soon.
« Last Edit: August 02, 2020, 04:21:31 PM by rejetto »


Offline dj

  • Tireless poster
  • ****
    • Posts: 291
  • 👣 🐾
    • View Profile
    • PWAs
I recommend to store it in a subfolder thumb on Upload (similar mobillight).
I will write the addon, when I'm Back from Holidays.
« Last Edit: August 02, 2020, 07:14:30 PM by dj »


Offline dj

  • Tireless poster
  • ****
    • Posts: 291
  • 👣 🐾
    • View Profile
    • PWAs
show the Server generated thumbnails (for now without saving)



jpgimgthumb_Store.diff.tpl works only with mobillight for now
I can't get the 'load' macro to run with images
« Last Edit: August 11, 2020, 05:04:01 AM by dj »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13521
    • View Profile
I can't get the 'load' macro to run with images

i don't understand what you meant


Offline dj

  • Tireless poster
  • ****
    • Posts: 291
  • 👣 🐾
    • View Profile
    • PWAs
I tried it first server side.

{.load|smallpic.jpg|var=mytext.}
{.save|test.jpg|var=mytext.}

test.jpg is saved, but not readable (format not supported)


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2063
    • View Profile
what you would like are macros like "load bin" and "save bin" using a buffer variable

load and save only deal with text files, and besides this can create some problems when used with different encoding formats (ansi utf8 utf16 ...)


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13521
    • View Profile
just as mars said.
if you need them to make cool stuff we can add them.


Offline danny

  • Tireless poster
  • ****
    • Posts: 281
    • View Profile
...
The feature works like this: you append ?mode=thumb to the url of a jpg file.
The thumbnail itself is served as a file. If not available you'll get a 404...
Can you change to If not available then send whole jpg file?

This piece is missing?:  I wonder if there is a 3rd party thumbnail generator, which could add thumbnails into the jpgs without re-encoding the original photo data?  If that was available and commandline, then @sunday exec thumbgen.bat.  Hopefully it could skip jpgs which already contain thumbnail data.

In this case, 'thumbgen.bat' can run multithread by
start "" "my.exe" -c start-minimized=yes -c active=yes
So, hfs, exec doesn't have to wait on it to finish (For Windows 7,8,8+1,10, by using start, then a batch file can end in a couple of milliseconds).
« Last Edit: August 19, 2020, 10:49:24 PM by danny »


Offline dj

  • Tireless poster
  • ****
    • Posts: 291
  • 👣 🐾
    • View Profile
    • PWAs
Can you change to If not available then send whole jpg file?

uncomment line14 in show the Server generated thumbnails
or use this code
« Last Edit: August 19, 2020, 09:12:02 AM by dj »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13521
    • View Profile
Can you change to If not available then send whole jpg file?

surely it would not be the main behavior, as not everybody would want that.
For the time being you should handle the 404 and request the whole picture if you want.