ananjaser1211 / FloydQ_Reports

BUG Reporting for Exynos8890 OneUI 2.0 Project
57 stars 7 forks source link

[BUG] Wrong camera model in EXIF tags #257

Closed endolith closed 2 years ago

endolith commented 3 years ago

Describe the bug I just realized the EXIF data of photos is tagged as SM-G965F, even though it's actually SM-G930F hardware. The camera model needs to be correct in the EXIF tags, so it can work with photogrammetry software, etc. that gets the physical properties of the camera from a database of model numbers.

To Reproduce Steps to reproduce the behavior:

  1. Take a photo
  2. Look at EXIF data

Expected behavior It should say SM-G930F

Screenshots image

Smartphone (please complete the following information):

ananjaser1211 commented 3 years ago

This cant be fixed, as changing the model number to G93X in props would result in other issues in the ROM (not all apps will work, missing features etc)

so i cant add such change in the ROM, you can change the prop yourself by editing /system/system/vendor/build.prop and change G965F > G930F

endolith commented 3 years ago

It doesn't need to be changed in the system, just in the EXIF tags

ananjaser1211 commented 3 years ago

@endolith the EXIF generator takes the value from build.prop. which we use G965F. hence why it writes that in the image details. i dont know if there is an easy way to spoof that, i will check, but if not it probbaly will stay like that

SypeR54 commented 2 years ago

@endolith the EXIF generator takes the value from build.prop. which we use G965F. hence why it writes that in the image details. i dont know if there is an easy way to spoof that, i will check, but if not it probbaly will stay like that

It was a long time but maybe we can decompile Samsung Camera and patch the function?

https://developer.android.com/reference/android/media/ExifInterface

SypeR54 commented 2 years ago

Okay, i found where we can spoof the model number. Samsung Camera saves EXIF datas as an array to IMG file.

SamCamera_11.0.15.73_minAPI30\smali_classes2\com\sec\android\app\camera\cropper\util\ExifUtil.smali This file is saving EXIF data to the IMG file. If we can manipulate it via pulling it from a new build.prop string, it should save "Captured from SM-G930F / G935F / N930F / N935F" etc.

image

endolith commented 2 years ago

I'm not using Samsung Camera, I'm using OpenCamera :/ (Samsung Camera has too much sharpening)

SypeR54 commented 2 years ago

@endolith Then probably we cant do anything about it. Sorry man

Cvolton commented 2 years ago

In OpenCamera the respective functions are in net.sourceforge.opencamera.ImageSaver

notably line 2074 String exif_model = exif.getAttribute(ExifInterface.TAG_MODEL); and line 2235 exif_new.setAttribute(ExifInterface.TAG_MODEL, exif_model); Since OpenCamera already modifies the EXIF data, modifying line 2074 to something like String exif_model = "SM-G930F"; should be good enough

V3rB0se commented 2 years ago

Why not just modify exif data ?