Vincent makes some good points about the general case, however I
will add one additional comment which is that computing a checksum on
the encoded data should be significantly cheaper than the encoding
processes it's self (so you could encode the data, check if the
checksum matches (BTW the PNG encoder has a CRC generator) a
pre-existing image, check the encoded data byte by byte, just to be
sure, if everything checks out just use a reference).

   This is a quite a bit more work (and quite a bit slower) but would
be usable for the general case.  For now just having a simple minded
version (that might eventually grow into a general solution with
options) would be great though.

>>>>> "VH" == Vincent Hardy <[EMAIL PROTECTED]> writes:

VH> The reason there is no caching done is that the Image API does not
VH> contain information that would let you do proper caching. For
VH> example, because an image may be mutable, the SVGGraphics2D cannot
VH> cache an image between two drawImage calls, as the image data may
VH> change between the calls, even though the same java object is
VH> passed to the method...

VH> This is why there is no generic method that can be offered by
VH> default that would do proper image caching and this is why an
VH> image is embeded for every single drawImage call. However, as
VH> Thomas pointed out, you can write an image handler for a
VH> *specific* context. If you know that your images do not mute
VH> between API calls, then you can do caching. But this is not a
VH> generic solution and as such cannot be the default SVGGraphics2D
VH> handling of images.

VH> I hope this explains what we have done. Good luck with your
VH> project.  Cheers, Vincent.

VH> "Evenblij, Paul" wrote:
>>  -----Original Message----- From: Thomas E Deweese
>> [mailto:[EMAIL PROTECTED]] >[...]  
>> There are already good examples of doing this for export to image
>> files and the Base64 encoding, so even >someone not overly familure
>> with Batik should be able to put this togeather in a day or two
>> (hint hint :).
>> 
>> Hint taken.

   Great!

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to