Why OPENCV lost exif infomation of JPEG?

OPENCV version: 4.5.1

When I transform a JPEG with orientation information, the result didn’t have orientation information.

I used flags IMREAD_UNCHANGED and I expect exif information can save after image process, such as chagne quality.

it’s not entirely lost (it just never leaves the imprter code)
if your image had some exif rotation, imread() will return an already rotated image
please cross-check with IMREAD_IGNORE_ORIENTATION

no, there is no exif information stored for your image, and no exif saved

Thanks for reply.

My scenes is:
I use opencv do some specific actions, but whether use exif to rotate image rely to client’s behavior. So I need exif after image transform by OpenCV.

Could you give me some suggestion?

you could open an issue as feature request Issues · opencv/opencv · GitHub

maybe you want to use imagemagick. OpenCV is for computer vision, not for saving pictures in different formats.

cv::imread returns a cv::Mat. Mat objects contain only image data, no exif information. as mentioned, rotation info is applied to the data upon loading, but that is all.

I prefer OpenCV because its high performance. I will open an issue and expect you will consider to support this. Thanks~

issue: [feature request]: Save exif information · Issue #21789 · opencv/opencv · GitHub