When a JPEG image is for example 4000 x 6000 pixels, the pure RAW image is likely a bit bigger, like e.g. 4010 x 6020 pixels. This is to improve RGB interpolation along the image edges. When reading a RAW file, one can usually choose to ignore these extra pixels or load them. To ensure that image regions are identically defined in the JPGs and RAW files, we must ignore reading those pixels. Maybe LIbARW has a function where you can choose to read/not read those pixels.
When a JPEG image is for example 4000 x 6000 pixels, the pure RAW image is likely a bit bigger, like e.g. 4010 x 6020 pixels. This is to improve RGB interpolation along the image edges. When reading a RAW file, one can usually choose to ignore these extra pixels or load them. To ensure that image regions are identically defined in the JPGs and RAW files, we must ignore reading those pixels. Maybe LIbARW has a function where you can choose to read/not read those pixels.