This is a discussion on creating thumbnails without downloading entire image. within the Linux Networking forums, part of the Linux Forums category; Is it possible to create a solution that creates dynamic thumbnails from iamges without downloading the entire image. This is ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Is it possible to create a solution that creates dynamic thumbnails
from iamges without downloading the entire image. This is on this newsgroup because its primarily a networking question. Can I request each image seperately and in the order that I want. In particular I know that sometimes when you download the image it goes from top to bottom, other times it goes from blurry to sharp. If I can request the order of information transfer, I could for each image just get the blurry versions and use that information to generate sharp small thumbs. These will not be ideal (ie average of surrounding pixels) but this will be fine. Thank you very much for any information. If this is possible is there an implementation, or do you guys have some tips as to how I could go about implementing this; I imagine it would be through some sort of hack in the TCP request, but I'm not well versed enough in these methods to know. -Ashot Petrosian UTCS |
|
|||
|
Ashot Petrosian wrote:
> Is it possible to create a solution that creates dynamic thumbnails > from iamges without downloading the entire image. > > This is on this newsgroup because its primarily a networking question. It's not. - Read on. > Can I request each image seperately and in the order that I want. In > particular I know that sometimes when you download the image it goes > from top to bottom, other times it goes from blurry to sharp. If I > can request the order of information transfer, I could for each image > just get the blurry versions and use that information to generate > sharp small thumbs. These will not be ideal (ie average of > surrounding pixels) but this will be fine. Thank you very much for > any information. Your question is about HTML and its techniques, this NG's primary focus is on technical questions related to networking. HTTP, which transports HTML, is in the application level, which nobody here cares much about. But to answer Your questions anyways: You can request each image seperately. You will first ask for the HTML source of any given page You want to view. H_T_ML is text only, and may contain refe- rences to images that Your browser shall display within that text area. Your browser (if not lynx) will recognize those references and request each of those images in turn from the server. - So, You need to get the page source first, parse it for image references and then, ask for the images to be sent. That is what every browser does. When an image goes "from blurry to sharp", there are two concepts for that: If it's ".gif", there's an "interlace" functionality in this format (gif87a and gif89) which controls this. Non-interlace will transfer the image line by line, while interlace will send like $LINE_0; $LINE_N; $LINE_(N*2) .. $LINE_(N*n), and then start from the top with $LINE_(0+1); $LINE_(N+1); $LINE_(N*2+1) and so on. There's a similar thing for ".jpeg", but I'm no expert on that. In HTML, there's also a "lowres" parameter for the <IMG> tag, where You can specify a source that contains a smaller version (bytewise, that is; that has nothing to do with the size of the displayed img) of the to-be-displayed picture (like lower resolution and/or black- /white) that will be loaded and displayed first, and only after all such placeholders for the pictures of one page are loaded, the actual images are being transmitted. Only in this latter case, where "lowres" is used in an HTML <IMG> tag, You can save bandwith by only downloading the lowres source; with the interlace mechanism, You will have to load the entire file first. - You can later resize it to save disk space, but to be able to do so, You need to have the entire image. > If this is possible is there an implementation, or do you guys have > some tips as to how I could go about implementing this; I imagine it > would be through some sort of hack in the TCP request, but I'm not > well versed enough in these methods to know. Again, You want to talk HTTP. That's applications. Go find an appro- priate group for that. - Here, it's "FTP-County", with some more low- level speakers. We don't understand Your high-level conversation... Just kidding, Ashot, but I hope I got You on the right track. Cheers, Jack. -- ---------------------------------------------------------------------- My personal reading of the string "MicroSoft" expands to "NanoWeak"... |
|
|||
|
Ashot Petrosian <ashot@molsoft.com> wrote:
> Is it possible to create a solution that creates dynamic thumbnails > from iamges without downloading the entire image. No. If it's straight bitmap, then, I guess, you can request every other 1k byte of the image to reduce the bandwidth. But, most images are compressed (ie. GIF/JPEG/PNG), so you won't be able to uncompress due to "missing" data. > If this is possible is there an implementation, or do you guys have > some tips as to how I could go about implementing this; I imagine it > would be through some sort of hack in the TCP request, but I'm not > well versed enough in these methods to know. TCP is just delivery mechanism, and has nothing to do with it. -- William Park, Open Geometry Consulting, <opengeometry@yahoo.ca> Linux solution/training/migration, Thin-client |
|
|||
|
Ashot Petrosian wrote:
> Is it possible to create a solution that creates dynamic thumbnails > from iamges without downloading the entire image. > > This is on this newsgroup because its primarily a networking question. It's not. - Read on. > Can I request each image seperately and in the order that I want. In > particular I know that sometimes when you download the image it goes > from top to bottom, other times it goes from blurry to sharp. If I > can request the order of information transfer, I could for each image > just get the blurry versions and use that information to generate > sharp small thumbs. These will not be ideal (ie average of > surrounding pixels) but this will be fine. Thank you very much for > any information. Your question is about HTML and its techniques, this NG's primary focus is on technical questions related to networking. HTTP, which transports HTML, is in the application level, which nobody here cares much about. But to answer Your questions anyways: You can request each image seperately. You will first ask for the HTML source of any given page You want to view. H_T_ML is text only, and may contain refe- rences to images that Your browser shall display within that text area. Your browser (if not lynx) will recognize those references and request each of those images in turn from the server. - So, You need to get the page source first, parse it for image references and then, ask for the images to be sent. That is what every browser does. When an image goes "from blurry to sharp", there are two concepts for that: If it's ".gif", there's an "interlace" functionality in this format (gif87a and gif89) which controls this. Non-interlace will transfer the image line by line, while interlace will send like $LINE_0; $LINE_N; $LINE_(N*2) .. $LINE_(N*n), and then start from the top with $LINE_(0+1); $LINE_(N+1); $LINE_(N*2+1) and so on. There's a similar thing for ".jpeg", but I'm no expert on that. In HTML, there's also a "lowres" parameter for the <IMG> tag, where You can specify a source that contains a smaller version (bytewise, that is; that has nothing to do with the size of the displayed img) of the to-be-displayed picture (like lower resolution and/or black- /white) that will be loaded and displayed first, and only after all such placeholders for the pictures of one page are loaded, the actual images are being transmitted. Only in this latter case, where "lowres" is used in an HTML <IMG> tag, You can save bandwith by only downloading the lowres source; with the interlace mechanism, You will have to load the entire file first. - You can later resize it to save disk space, but to be able to do so, You need to have the entire image. > If this is possible is there an implementation, or do you guys have > some tips as to how I could go about implementing this; I imagine it > would be through some sort of hack in the TCP request, but I'm not > well versed enough in these methods to know. Again, You want to talk HTTP. That's applications. Go find an appro- priate group for that. - Here, it's "TCP-County", with some more low- level speakers. We don't understand Your high-level conversation... Just kidding, Ashot, but I hope I got You on the right track. Cheers, Jack. -- ---------------------------------------------------------------------- My personal reading of the string "MicroSoft" expands to "NanoWeak"... |
|
|||
|
Ashot Petrosian wrote:
> Is it possible to create a solution that creates dynamic thumbnails > from iamges without downloading the entire image. > > This is on this newsgroup because its primarily a networking question. It's not. - Read on. > Can I request each image seperately and in the order that I want. In > particular I know that sometimes when you download the image it goes > from top to bottom, other times it goes from blurry to sharp. If I > can request the order of information transfer, I could for each image > just get the blurry versions and use that information to generate > sharp small thumbs. These will not be ideal (ie average of > surrounding pixels) but this will be fine. Thank you very much for > any information. Your question is about HTML and its techniques, this NG's primary focus is on technical questions related to networking. HTTP, which transports HTML, is in the application level, which nobody here cares much about. But to answer Your questions anyways: You can request each image seperately. You will first ask for the HTML source of any given page You want to view. H_T_ML is text only, and may contain refe- rences to images that Your browser shall display within that text area. Your browser (if not lynx) will recognize those references and request each of those images in turn from the server. - So, You need to get the page source first, parse it for image references and then, ask for the images to be sent. That is what every browser does. When an image goes "from blurry to sharp", there are two concepts for that: If it's ".gif", there's an "interlace" functionality in this format (gif87a and gif89) which controls this. Non-interlace will transfer the image line by line, while interlace will send like $LINE_0; $LINE_N; $LINE_(N*2) .. $LINE_(N*n), and then start from the top with $LINE_(0+1); $LINE_(N+1); $LINE_(N*2+1) and so on. There's a similar thing for ".jpeg", but I'm no expert on that. In HTML, there's also a "lowres" parameter for the <IMG> tag, where You can specify a source that contains a smaller version (bytewise, that is; that has nothing to do with the size of the displayed img) of the to-be-displayed picture (like lower resolution and/or black- /white) that will be loaded and displayed first, and only after all such placeholders for the pictures of one page are loaded, the actual images are being transmitted. Only in this latter case, where "lowres" is used in an HTML <IMG> tag, You can save bandwith by only downloading the lowres source; with the interlace mechanism, You will have to load the entire file first. - You can later resize it to save disk space, but to be able to do so, You need to have the entire image. > If this is possible is there an implementation, or do you guys have > some tips as to how I could go about implementing this; I imagine it > would be through some sort of hack in the TCP request, but I'm not > well versed enough in these methods to know. Again, You want to talk HTTP. That's applications. Go find an appro- priate group for that. - Here, it's "TCP-County", with some more low- level speakers. We don't understand Your high-level conversation... Just kidding, Ashot, but I hope I got You on the right track. Cheers, Jack. -- ---------------------------------------------------------------------- My personal reading of the string "MicroSoft" expands to "NanoWeak"... |
|
|||
|
jack wrote:
> Ashot Petrosian wrote: > > Is it possible to create a solution that creates dynamic thumbnails > > from iamges without downloading the entire image. I really don't like to answer my own postings, but here's one more to help You out: As said, I'm not too familiar with JPEG, but what You can try is to (1) find out about the technique JPEG uses for that "blurry to sharp" transition You describe, (2) quantify the amount of data You want to have of a given source, (3) create a script that will send an HTTP GET request for that image (or, HTTP HEAD request which will return the size of the file You're asking for, and only then GET it), and (4) have this script RST'ing the connection after You got the amount of data of that file that You need. You will eventually end up with corrupted JPEGs, but that's not Your interest, anyways. And, as for how to break the HTTP transmission of that image, You will need TCP/IP functionality all right. So this _is_ the correct NG for this. You knew all that before coming here, didn't You...? ;) Cheers, JAck. -- ---------------------------------------------------------------------- My personal reading of the string "MicroSoft" expands to "NanoWeak"... |
![]() |
| Thread Tools | |
| Display Modes | |
|
|