Open karuru6225 opened 12 months ago
残りは // ComponentsConfiguration 各コンポーネントの意味 0x9101 Undefined 4 ◎ // FlashpixVersion 対応フラッシュピックスバージョン 0xA000 Undefined 4 ◎ の2つ。
こちらのことでしょうか?
すみませんが、既存のコードの修正意図が分からずですが、↑はコメントですね?
kCGImagePropertyExifDictionary
にComponentsConfiguration
やFlashpixVersion
の情報を入れる感じでしょうか?
photoInfo.toXMP()
を出力
<x:xmpmeta
xmlns:x="adobe:ns:meta/">
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:photo="http://dcpadv.org/schema/3.0/photoinfo"
xmlns:measurement="http://dcpadv.org/schema/3.0/measurement"
xmlns:item="http://dcpadv.org/schema/3.0/measurementitem">
<photo:ConstructionName>動作テストTBH221030</photo:ConstructionName>
<photo:Contructor>大成建設(株)</photo:Contructor>
<photo:LargeClassification>測量</photo:LargeClassification>
<photo:PhotoClassification>施工状況写真</photo:PhotoClassification>
<photo:ConstructionType>工種TBH221030</photo:ConstructionType>
<photo:MiddleClassification>種別TBH221030</photo:MiddleClassification>
<photo:SmallClassification>細別TBH221030</photo:SmallClassification>
<photo:Title>A0. 鉄筋籠搬入状況</photo:Title>
<photo:ClassificationRemarks>
<rdf:Seq></rdf:Seq>
</photo:ClassificationRemarks>
<photo:ShootingSpot></photo:ShootingSpot>
<photo:IsRepresentative>False</photo:IsRepresentative>
<photo:IsFrequencyOfSubmission>True</photo:IsFrequencyOfSubmission>
<photo:Measurements>
<rdf:Description>
<measurement:Classification>0</measurement:Classification>
<measurement:MeasurementItems>
<rdf:Seq>
<rdf:li>
<rdf:Description>
<item:Name>鉄筋籠搬入状況</item:Name>
<item:Mark></item:Mark>
<item:DesignedValue></item:DesignedValue>
<item:MeasuredValue></item:MeasuredValue>
<item:UnitName></item:UnitName>
<item:Remarks>
<rdf:Seq></rdf:Seq>
</item:Remarks>
</rdf:Description>
</rdf:li>
</rdf:Seq>
</measurement:MeasurementItems>
</rdf:Description>
</photo:Measurements>
<photo:ContractorRemarks></photo:ContractorRemarks>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
exif.setAttribute(ExifInterface.TAG_XMP, photoInfo.toXMP())
する前(1)、後(2)、exif.saveAttributes()
した後(3)でバイナリーを比較
(1) xmp情報なし
(2) xmp情報なし
(3) xmpが2回入っている
元々のXMPの代わりにTESTJANG
という文字を入れてみても2重に作成される
https://android.googlesource.com/platform/frameworks/base/+/refs/heads/main/media/java/android/media/ExifInterface.java#1851
setAttribute
の際に
mAttributes[i].put(tag, ExifAttribute.createByte(value));
が2回実行される
EXIF_TAGS
の0と5番目がexifTag
が存在していて、exifTag.primaryFormat == IFD_FORMAT_BYTE
の判定で
dataFormat = exifTag.primaryFormat;
がセットされて1851行のXMPデータが2回実施される。
// List of Exif tag groups
static final ExifTag[][] EXIF_TAGS = new ExifTag[][] {
IFD_TIFF_TAGS, IFD_EXIF_TAGS, IFD_GPS_TAGS, IFD_INTEROPERABILITY_TAGS,
IFD_THUMBNAIL_TAGS, IFD_TIFF_TAGS, ORF_MAKER_NOTE_TAGS, ORF_CAMERA_SETTINGS_TAGS,
ORF_IMAGE_PROCESSING_TAGS, PEF_TAGS
};
Issue報告 https://issuetracker.google.com/issues/new?component=460705&template=1238586&hl=ja
Component used: Android ExifInterface
Version used: 1.3.6
Devices/Android versions reproduced on: Issue consistently reproduced across various devices, on Android versions 9 to 13.
When reporting bugs, please always include:
1. Reproduction steps:
- Import and use the ExifInterface library version 1.3.6 in an Android project.
- Utilize the `setAttribute` method of the ExifInterface, specifying `ExifInterface.TAG_XMP` and the corresponding XMP data.
- Observe that the generated image contains duplicated XMP data.
2. How reproducible the issue is on the affected device: The issue occurs consistently on every attempt across various devices and Android versions (9 to 13).
3. If known, how reproducible the issue is on other devices and OS versions: Consistently reproducible on all tested devices and OS versions.
Where possible, please also provide:
1. A project code that reproduces the issue:
https://github.com/ncdcdev/cordova-plugin-blackboard-camera/blob/a7516c4c831967614d0f66d36470a2c8a5613fa9/src/android/ElectronicBlackBoardManager.kt#L27
2. A screen record or screenshots showing the issue: A screenshot showing the duplicated XMP data in the binary data of the photo is attached for reference.
Additional Notes:
Upon inspection of the `setAttribute` source code in the ExifInterface library, it was found that `EXIF_TAGS` includes `IFD_TIFF_TAGS` twice. This redundancy potentially causes the XMP data to be generated twice in the resulting image, indicating a possible bug in the library's handling of XMP data.
AndroidのIssueに登録 https://issuetracker.google.com/issues/309843390
担当アサインはされたが特に進捗や返信がない
タスク
J-COMSIA認定に合格するために、追加で必要なExifの追加をお願いします。
資料