Posted by broumbroum
on April 24, 2010 at 4:43 PM PDT
I'm facing an issue where it may be possible to make tiff pictures in a low-memory cost fashion .
there it is : open a file for writing a sequence, insert an empty image (so called primary ifd), add one thumbnail and fill out the process by adding pixels with replacePixels before to quit with endsequence.
(UNIQUE source : exif structure )
here I've been uneasy with the IFD header, which seems no to be recognized by the tiffImagereader.readHeader()....
Does someone know where pitfalls are for such picture I/O ops ?
I write subsequently tiled regions of the source pic and i get this error :
java.lang.IllegalArgumentException: Forward mapped source region does not intersect destination region!<br />
I've looked at the tiffimagewriter source code and it's rather complex stuff.... I don't know if both Imagewriteparam must be set when using replacepixels (setdestinationoffset() ??)
iwp.setDestinationOffset(dstROIB.getLocation()); // is that necessary ?<br />
w.prepareReplacePixels(0, dstROIB); // seems to be involved with destinationoffset for intersection<br />
Rectangle dstBufferROI = new Rectangle(dstBuffer.getWidth(), dstBuffer.getHeight()).intersection(dstROIB);<br />
w.replacePixels(dstBuffer.getSubimage(dstBufferROI.x, dstBufferROI.y, dstBufferROI.width, dstBufferROI.height), iwp);<br />
Message was edited by: broumbroum