The offset for the cropped-active-sensor-area (Thumb) are reported in the LibRaw sample program raw_identfy.cpp as follows:if (S.raw_inset_crops[0].cleft != 0xffff)fprintf(outfile, "left: %d ", S.raw_inset_crops[0].cleft);if (S.raw_inset_crops[0].ctop != 0xffff)fprintf(outfile, "top: %d", S.raw_inset_crops[0].ctop);

Some format like .PEF don't report these values. Same for "thumb size" dimensions  (Strange name only used in DCRAW and LibRaw.)

But is better to extract the whole-active-sensor-area.(Image size). Why throw away active pixels?