rowBytes returns wrong value
Hi
i am about to create an exporter for a compression format.
I experience a strange situation where the value of ExportRecord->rowBytes is giving a strange value which makes my code crash Photoshop.
I process the image row by row and initially create a buffer of size gStuff->imageSize.h*gStuff->imageSize.v*gStuff->planes
Now I get the image data line by line, plane by plane, copy it into the buffer I have created, and advance a pointer by rowBytes assuming that its value would be the same as imageSize.h to copy the next line.
This caused buffer overruns. After debugging using a simple 1000x1000 rgb image i saw that rowBytes returned 1008.
For a 900x900 image it returned 912.
Why is that? It should be 1000 and 900 in these cases, I specify to get only get only one plane and one line.
The doc says "rowBytes = The offset between rows for the requested image data.", so where do these extra bytes come from? What value do they have?
If rowBytes is not the width of the image how usefull is it?
Thanks
Dimi