I am trying to build an uploader which uploads progressive files in two steps:
- Upload the minimal number of bytes to create a thumbnail (0-10%)
- Upload the rest of the bytes for the thumbnail. (11%-100%)
I want to do this to have thumbnails available earlier without having to upload a seperate thumbnail.
Taking an image (3426398 Byte) which was created with jpegtran -copy all -progressive -outfile progressive.jpg original.jpg
and then taking the first 350000 bytes with dd if=progressive.jpg of=thumb.jpg bs=1 count=350000
I got a thumbnail which works.
- Original: https://dl.dropbox.com/u/5910/thumbtest/progressive.jpg
- Thumbnail: https://dl.dropbox.com/u/5910/thumbtest/thumb.jpg
Is there a way to find out how many bytes I have to transfer in order to get an image where all lines are available? Thus only losing image quality?