My app let the user take a picture with the camera and return a byte array containing the image data (jpeg at the moment but can be modified).
If we know the width and height of the picture, is it possible to use
BitmapFactory.decodeByteArray(data, offset, length)
To decode the picture from specified offset to get a squared picture ?
The image is in high res (portrait) and I only need the squared bottom of this picture still in high res for image processing.
x offset = 0
y offset = height - width
width = width
height = width
I have seen this answer but I still was wondering if this was possible. I could compress image data with another format if needed
My guess was to compute the number of bytes used to store n
rows of pixels (using known dimensions), where n = maxRows - pictureWidth
and then start from computed offset