Fixed HUAWEI EXIF reporting/read bug?

frm

Well-known member
Affected version
XF 2.2.1 / XFMG 2.2.0
Unsure what an exposure time of 501000/1000000000 is, but it only appears on this device (HUAWEI HWV32 aka HUAWEI P20 LITE).

1603653725357.webp

Another picture:
1603653787482.webp

And another...
1603653828653.webp

But my Canon T6i is fine:
1603653911994.webp

And my 5D MK IV
1603653998556.webp

As well as my friend's EOS M50
1603654178360.webp

Cannot duplicate here as I don't have this device and unsure if I can emulate it...
 
It may just be the way that device reports its exposure time. In which case, we might not be able to do anything.

For the affected media item, please get a copy of the exif data stored in the xf_mg_media_item table from the exif_data column.
 
It may just be the way that device reports its exposure time. In which case, we might not be able to do anything.

For the affected media item, please get a copy of the exif data stored in the xf_mg_media_item table from the exif_data column.
Code:
{"FILE":{"FileName":"phplhnhE0","FileDateTime":1603442306,"FileSize":1203136,"FileType":2,"MimeType":"image\/jpeg","SectionsFound":"ANY_TAG, IFD0, THUMBNAIL, EXIF, GPS, INTEROP"},"COMPUTED":{"html":"width=\"4608\" height=\"3456\"","Height":3456,"Width":4608,"IsColor":1,"ByteOrderMotorola":1,"ApertureFNumber":"f\/2.2","Thumbnail.FileType":2,"Thumbnail.MimeType":"image\/jpeg"},"IFD0":{"ImageWidth":4608,"ImageLength":3456,"BitsPerSample":[8,8,8],"Make":"HUAWEI","Model":"HWV32","Orientation":1,"XResolution":"72\/1","YResolution":"72\/1","ResolutionUnit":2,"Software":"ANE-L12JPZ 9.1.0.288(C791E19R1P7)","DateTime":"2020:10:19 11:20:59","YCbCrSubSampling":[2,2],"YCbCrPositioning":1,"Exif_IFD_Pointer":296,"GPS_IFD_Pointer":968,"DeviceSettingDescription":"ipp\u0000"},"THUMBNAIL":{"Compression":6,"XResolution":"72\/1","YResolution":"72\/1","ResolutionUnit":2,"JPEGInterchangeFormat":1310,"JPEGInterchangeFormatLength":5040},"EXIF":{"ExposureTime":"501000\/1000000000","FNumber":"220\/100","ExposureProgram":2,"ISOSpeedRatings":50,"ExifVersion":"0210","DateTimeOriginal":"2020:10:19 11:20:59","DateTimeDigitized":"2020:10:19 11:20:59","ComponentsConfiguration":"\u0001\u0002\u0003\u0000","CompressedBitsPerPixel":"95\/100","ShutterSpeedValue":"298973\/10000","ApertureValue":"227\/100","BrightnessValue":"0\/1","ExposureBiasValue":"0\/10","MaxApertureValue":"227\/100","MeteringMode":5,"LightSource":1,"Flash":1,"FocalLength":"3810\/1000","SubSecTime":"738298","SubSecTimeOriginal":"738298","SubSecTimeDigitized":"738298","FlashPixVersion":"0100","ColorSpace":1,"ExifImageWidth":4608,"ExifImageLength":3456,"InteroperabilityOffset":1186,"SensingMethod":2,"FileSource":"\u0003","SceneType":"\u0001","CustomRendered":1,"ExposureMode":0,"WhiteBalance":0,"DigitalZoomRatio":"100\/100","FocalLengthIn35mmFilm":47,"SceneCaptureType":0,"GainControl":0,"Contrast":0,"Saturation":0,"Sharpness":0,"SubjectDistanceRange":0,"ImageUniqueID":"6f9c0a591be48a260000000000000000"},"GPS":{"GPSVersion":"\u0002\u0002\u0000\u0000","GPSLatitudeRef":"N","GPSLatitude":["***"],"GPSLongitudeRef":"***","GPSLongitude":["***"],"GPSAltitudeRef":"\u0000","GPSAltitude":"7788\/100","GPSTimeStamp":["2\/1","20\/1","58\/1"],"GPSProcessingMode":"GPS","GPSDateStamp":"2020:10:19"},"INTEROP":{"InterOperabilityIndex":"R98","InterOperabilityVersion":"0100"}}

To preserve privacy, I replaced the perceived PII GPS information of a user with ***. If this is necessary to debug, I could send it directly to you.
 
Yup, that's exactly what the raw EXIF data says, so we're just reporting that:

Code:
"ExposureTime":"501000\/1000000000"

If there is some sort of convention for converting that into something that makes sense then we could look at doing that, but I'm not sure what that would be.

If you can get an original copy of the image and send it to me then I will do some research but currently I don't think there's much we can do here.
 
If you can get an original copy of the image and send it to me then I will do some research but currently I don't think there's much we can do here.
Will get back to you ASAP.

Should I submit the URL of it as a ticket as the EXIF might be stripped as an attachment sent to you in a conversation?
 
Yeah a URL to the image directly hosted somewhere would be ideal. We're already discussing things here so a conversation is probably ok in this instance.
 
In the meantime... Just a hypothetical here: the device (or any Huawei if you can search XF's XFMG for these devices to see if there are similar results or if it's just the P20 Lite) could be reporting as microseconds and rounding up as nothing is below a 0.5 (making it 1).

The first example of 501000/1000000000 would be 0.501/1000 or 1/1000 at ISO 50. In those lighting conditions, it should be overexposed, unless there was some exposure compensation applied... but, it is reasonable to a degree because the two really don't go together (but I'm not familiar with their cameras).

Again, I'll get the raw data as soon as I can. Though, it might be worth looking into if you could find any images uploaded here with that device and/or any Huawei devices at that reporting odd exposures like this and then seeing if it is rounded microseconds.
 
I finally got a photo sent in by a member. This is what it looks like uploaded to the gallery:
1603718085485.webp

This is the file info in Windows' "Photos" application "more info" option:
1603718210199.webp

This is the raw code as before with GPS info removed with XXX (will send entirely with link to the downloadable image):
Code:
{"FILE":{"FileName":"php7cYaG1","FileDateTime":1603717477,"FileSize":5586474,"FileType":2,"MimeType":"image\/jpeg","SectionsFound":"ANY_TAG, IFD0, THUMBNAIL, EXIF, GPS, INTEROP"},"COMPUTED":{"html":"width=\"4608\" height=\"3456\"","Height":3456,"Width":4608,"IsColor":1,"ByteOrderMotorola":1,"ApertureFNumber":"f\/2.2","Thumbnail.FileType":2,"Thumbnail.MimeType":"image\/jpeg","Thumbnail.Height":384,"Thumbnail.Width":512},"IFD0":{"ImageWidth":4608,"ImageLength":3456,"BitsPerSample":[8,8,8],"Make":"HUAWEI","Model":"HWV32","Orientation":0,"XResolution":"72\/1","YResolution":"72\/1","ResolutionUnit":2,"Software":"ANE-L12JPZ 9.1.0.288(C791E19R1P7)","DateTime":"2020:10:26 14:18:51","YCbCrPositioning":1,"Exif_IFD_Pointer":284,"GPS_IFD_Pointer":XXX,"DeviceSettingDescription":"ipp\u0000"},"THUMBNAIL":{"ImageWidth":512,"ImageLength":384,"Compression":6,"Orientation":0,"XResolution":"72\/1","YResolution":"72\/1","ResolutionUnit":2,"JPEGInterchangeFormat":8886,"JPEGInterchangeFormatLength":47794},"EXIF":{"DocumentName":null,"ExposureTime":"6124000\/1000000000","FNumber":"220\/100","ExposureProgram":2,"ISOSpeedRatings":50,"ExifVersion":"0210","DateTimeOriginal":"2020:10:26 14:18:51","DateTimeDigitized":"2020:10:26 14:18:51","ComponentsConfiguration":"\u0001\u0002\u0003\u0000","CompressedBitsPerPixel":"95\/100","ShutterSpeedValue":"298973\/10000","ApertureValue":"227\/100","BrightnessValue":"0\/1","ExposureBiasValue":"0\/10","MaxApertureValue":"227\/100","MeteringMode":5,"LightSource":1,"Flash":0,"FocalLength":"3810\/1000","MakerNote":"##**dig","SubSecTime":"159902","SubSecTimeOriginal":"159902","SubSecTimeDigitized":"159902","FlashPixVersion":"0100","ColorSpace":1,"ExifImageWidth":4608,"ExifImageLength":3456,"InteroperabilityOffset":8500,"SensingMethod":2,"FileSource":"\u0003","SceneType":"\u0001","CustomRendered":1,"ExposureMode":0,"WhiteBalance":0,"DigitalZoomRatio":"100\/100","FocalLengthIn35mmFilm":62,"SceneCaptureType":0,"GainControl":0,"Contrast":0,"Saturation":0,"Sharpness":0,"SubjectDistanceRange":0},"GPS":{"GPSVersion":"XXX","GPSLatitudeRef":"XXX","GPSLatitude":["XXX"],"GPSLongitudeRef":"XXX","GPSLongitude":["XXX"],"GPSAltitudeRef":"XXX","GPSAltitude":"XXX","GPSTimeStamp":["XXX"],"GPSProcessingMode":"XXX","GPSDateStamp":"XXX"},"INTEROP":{"InterOperabilityIndex":"R98","InterOperabilityVersion":"0100"}}
Exposure time:
Code:
"ExposureTime":"6124000\/1000000000"

The microseconds theory doesn't hold up on this one as it's shot at 1/160th from what Windows can read.
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XFMG release (2.2.1).

Change log:
Attempt to simplify the ExposureTime value down to a clearer value.
There may be a delay before changes are rolled out to the XenForo Community.
 
I finally got a photo sent in by a member. This is what it looks like uploaded to the gallery:
View attachment 238403

This is the file info in Windows' "Photos" application "more info" option:
View attachment 238404

This is the raw code as before with GPS info removed with XXX (will send entirely with link to the downloadable image):
Code:
{"FILE":{"FileName":"php7cYaG1","FileDateTime":1603717477,"FileSize":5586474,"FileType":2,"MimeType":"image\/jpeg","SectionsFound":"ANY_TAG, IFD0, THUMBNAIL, EXIF, GPS, INTEROP"},"COMPUTED":{"html":"width=\"4608\" height=\"3456\"","Height":3456,"Width":4608,"IsColor":1,"ByteOrderMotorola":1,"ApertureFNumber":"f\/2.2","Thumbnail.FileType":2,"Thumbnail.MimeType":"image\/jpeg","Thumbnail.Height":384,"Thumbnail.Width":512},"IFD0":{"ImageWidth":4608,"ImageLength":3456,"BitsPerSample":[8,8,8],"Make":"HUAWEI","Model":"HWV32","Orientation":0,"XResolution":"72\/1","YResolution":"72\/1","ResolutionUnit":2,"Software":"ANE-L12JPZ 9.1.0.288(C791E19R1P7)","DateTime":"2020:10:26 14:18:51","YCbCrPositioning":1,"Exif_IFD_Pointer":284,"GPS_IFD_Pointer":XXX,"DeviceSettingDescription":"ipp\u0000"},"THUMBNAIL":{"ImageWidth":512,"ImageLength":384,"Compression":6,"Orientation":0,"XResolution":"72\/1","YResolution":"72\/1","ResolutionUnit":2,"JPEGInterchangeFormat":8886,"JPEGInterchangeFormatLength":47794},"EXIF":{"DocumentName":null,"ExposureTime":"6124000\/1000000000","FNumber":"220\/100","ExposureProgram":2,"ISOSpeedRatings":50,"ExifVersion":"0210","DateTimeOriginal":"2020:10:26 14:18:51","DateTimeDigitized":"2020:10:26 14:18:51","ComponentsConfiguration":"\u0001\u0002\u0003\u0000","CompressedBitsPerPixel":"95\/100","ShutterSpeedValue":"298973\/10000","ApertureValue":"227\/100","BrightnessValue":"0\/1","ExposureBiasValue":"0\/10","MaxApertureValue":"227\/100","MeteringMode":5,"LightSource":1,"Flash":0,"FocalLength":"3810\/1000","MakerNote":"##**dig","SubSecTime":"159902","SubSecTimeOriginal":"159902","SubSecTimeDigitized":"159902","FlashPixVersion":"0100","ColorSpace":1,"ExifImageWidth":4608,"ExifImageLength":3456,"InteroperabilityOffset":8500,"SensingMethod":2,"FileSource":"\u0003","SceneType":"\u0001","CustomRendered":1,"ExposureMode":0,"WhiteBalance":0,"DigitalZoomRatio":"100\/100","FocalLengthIn35mmFilm":62,"SceneCaptureType":0,"GainControl":0,"Contrast":0,"Saturation":0,"Sharpness":0,"SubjectDistanceRange":0},"GPS":{"GPSVersion":"XXX","GPSLatitudeRef":"XXX","GPSLatitude":["XXX"],"GPSLongitudeRef":"XXX","GPSLongitude":["XXX"],"GPSAltitudeRef":"XXX","GPSAltitude":"XXX","GPSTimeStamp":["XXX"],"GPSProcessingMode":"XXX","GPSDateStamp":"XXX"},"INTEROP":{"InterOperabilityIndex":"R98","InterOperabilityVersion":"0100"}}
Exposure time:
Code:
"ExposureTime":"6124000\/1000000000"

The microseconds theory doesn't hold up on this one as it's shot at 1/160th from what Windows can read.
6124000 / 1000000000 = 0.006124 = 1/160.
We're simplifying these now using a fairly simple calculation, though it produces a slightly different result to what Windows is, although it matches up to what is being reported in macOS.

1603735531913.webp

We're just dividing both the numerator and denominator by the numerator in all cases where that makes sense. Which seems to produce reasonably consistent results:

Code:
  6124000 / 1000000000
= (6124000/6124000) / (1000000000/6124000)
= 1 / 163

501000/1000000000 from the original becomes 1/1996.
 
1603735531913.png

501000/1000000000 from the original becomes 1/1996.
No camera I know of shoots at 1/163 and 1/1996, even in automatic mode, for a full, half, or third stop.

I would still say that they're 1/160 and 1/2000 respectively.

1603789516817.png

A lens that I was looking into, the Irix Blackstone f/2.4, shoots at an aperture of 2.4 but most cameras cannot read that EXIF data as it's not a 1/3rd stop and report back that it's a 2.8; it's a quirky thing. However, you can actually shoot at 2.8 on it, so you can't justify changing the EXIF from 2.8 to 2.4 if anything is shot at 2.8. This is primarily, my best guess, cameras are following ISO 15781:2019 and ISO 516:2019. It looks like HUAWEI may be shooting at these odd speeds, not meeting ISO and/or not recording properly, but the EXIF should read standard, much like the Blackstone lens above.

It's my opinion that you should get more photographer related forum owners to come in and see if these are acceptable numbers before applying a fix that reports non-standardized shutter speeds.
 
Another argument is this is the data displayed by Adobe Lightroom CC (on Windows, cannot test iOS at the moment), arguably the leader in photo manipulation.

1603792248042.png
 
Frankly, at this point, I'm fine with how it is.

If the numbers are somehow not acceptable because it's reporting non-standardized shutter speeds then there has to be a point where that becomes the responsibility of who is writing that into the metadata. I think we've reached that point.

Whenever it comes to formatting EXIF data acceptably, I always consider Flickr to be a good example of how it's done. It also verifies the 1/163 calculation:

1603791772637.png

(I uploaded the image privately)

I accept that other software may have different takes on how it should be, but this approach should be fine for the general case.

Other software seems to follow our original approach - just reporting the raw value:

1603792576518.webp
 
Whenever it comes to formatting EXIF data acceptably, I always consider Flickr to be a good example of how it's done.
Debatable as Photoshop would export otherwise and was released in 1990 (and Windows way before) whereas Flickr was in 2004.
there has to be a point where that becomes the responsibility of who is writing that into the metadata
Agreed. HUAWEI needs to follow standards (though, probably won't).

But if this is the way that XF is going to deal with it, then so be it.
As it's still much better than this and people hopefully have the common sense to set their cameras to 1/160th as opposed to asking how they can set it to 1/163.

Thanks for the hard work and effort to repair this one, @Chris D and the XF Team! :)
 
Wouldn't round(($y/$x),-1) work for most (if not all) cases?

It works for these 2 with values of 501000/1000000000 and 6124000/1000000000.
 
Wouldn't round(($y/$x),-1) work for most (if not all) cases?
It would be nice if we could use rounding functions in XF templates and each number (effectively in this case, the numerator and the denominator) in XFMG was made separately to do so (ie "$x/$y" instead of "$xy" [1/163]).

I was unaware of rounding available as a function in templates as I'd use them a lot elsewhere if possible (if it is, this should definitely be added to the manual).

I know XFMG can be extended, but it's beyond my knowledge, and I am fine with 1/163 unless these are 2 separate numbers and you can use a rounding function in a template because I won't pay $50 for an XFMG add on to do it. :)
 
Just out of interest: this is how my Nikon D750 displays shutter speed:

View attachment 238596

Seems to common with Nikon DSLRs.
This should be reported separately and the original picture sent to Chris (but uploaded to a directory and that URL sent so the EXIF isn't stripped) so it can be addressed in 2.2.2 as well.

There's absolutely no way to shoot at 10/anything (nor /8000 unless you're shooting the sun [just saw f/14 so probable there...] or out grabbing hummingbird stills ;))

...but if Flickr... should see what Flickr says first. :p

Edit: Before reporting separately, try to upload here as it has been repaired on the Media Gallery on XF and the new math may put it at 1/8000.

Edit: To address no way to shoot at 10/8000 is incorrect if you were shooting at 1/800 and there was just funky raw EXIF data to make it show that.
 
Last edited:
The fix we've put in place for this would now render that as 1/800 so no need for further reports.

From XFMG 2.2.1 onwards any ExposureTime value that can be simplified down to a 1/whatever value will be automatically.
 
Back
Top Bottom