Page 1 of 1

Partial read/write

Posted: 2016-07-20T06:07:37-07:00
by peter01242
Is it possible, using IM 7.0.2-Q8 on Windows to perform a partial read/write on a file?

The reason I ask is that I need to add bar-codes to (potentially very large) images and would prefer to be
able to read just the area of the image I need, composite the bar-code and write back the modified data
to the original image.

Ideally it would be useful to 'read' the file information from the file, to determine the size, prior to
initiating the partial read.

Any suggestions or should I look elsewhere?

Peter Young

Re: Partial read/write

Posted: 2016-07-20T06:21:38-07:00
by snibgo
I think IM can read only a certain rectangle from an image in a file, without reading all the other pixels into memory.

But the other end of the process is harder. I don't think it can update a rectangle of pixels in a file, without also reading the other pixels.

Well, I suppose it can for its own internal MPC format. But not in the general case.

What format are your images in? If non-compressed, so it's easy so find the file bytes that define an area, a hack could be written to read those bytes and make an image. Then, in the other direction, overwrite those file bytes.