[quoted text, click to view] > what about shell? explorer is pretty quick when it comes to reading
> image size (and thumbnail). maybe i could use some of the shell32
> features? i've seen great thumbnail image extractor (using shell) on
> vbaccelerator. i thought that there would be some way to use the same
> technique to obtain only image size. unfortunately my knowledge is
> rather limited when it comes to shell programming :/
The image decoder reads the signature first, then the headers and finally
the image itself.
The headers will reveal the width and height not the size of the image when
decoded.
Some image formats such as tiff and jpeg allow a thumbnail to be embedded in
the image.
Reading and decoding a thumbnail is much faster than decoding an entire
image.
Displaying a small thumbnail is faster than displaying the full image.
You always have the option to read and decode only the thumbnail, if it is
present in the image.
The shell API's allow the programmer to create and cache thumbnails. Your
code must read and
decode the entire image before a thumbnail can be created. After the
thumbnail is created and cached,
reading and displaying the thumbnail is fast. The thumbnail will be
re-created only when the image has changed
invalidating the thumbnail in the cache.
[quoted text, click to view] "SharpCoderMP" <csharp_mp@interia.pl.NFSPM> wrote in message
news:%23fXCrkoLIHA.3852@TK2MSFTNGP06.phx.gbl...
> Michael Phillips, Jr. wrote:
>>> i need to know the size of an image without reading the whole file. any
>>> ideas where to start? i assume some p/invoke would be needed :/
>>> i need this because loading whole images into memory takes lots of time.
>>> and when you have lets say 300 of them, 6Mpix each it may take ages.
>>
>> There are many image formats. The size of the image when loaded will
>> only
>> be known after the image has been decoded.
>>
>> This is especially true for any image that is compressed. Until the
>> decoder
>> finishes the decompression, there is no way to know the size of the
>> image.
> what about shell? explorer is pretty quick when it comes to reading
> image size (and thumbnail). maybe i could use some of the shell32
> features? i've seen great thumbnail image extractor (using shell) on
> vbaccelerator. i thought that there would be some way to use the same
> technique to obtain only image size. unfortunately my knowledge is
> rather limited when it comes to shell programming :/