[
https://issues.apache.org/jira/browse/TIKA-2861?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18095095#comment-18095095
]
ASF GitHub Bot commented on TIKA-2861:
--------------------------------------
dschmidt commented on code in PR #2938:
URL: https://github.com/apache/tika/pull/2938#discussion_r3555022526
##########
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-audiovideo-module/src/main/java/org/apache/tika/parser/mp4/TikaMp4BoxHandler.java:
##########
@@ -186,12 +183,12 @@ private void processQuickTimeItemList(@Nullable byte[]
payload) {
* the raw value, so QuickTime location matches the {@code geo:*} output
of the udta path.
*/
private void addLocation(String iso6709) {
- Matcher matcher = ISO6709_PATTERN.matcher(iso6709);
- if (matcher.find()) {
- tikaMetadata.set(TikaCoreProperties.LATITUDE,
Double.parseDouble(matcher.group(1)));
- tikaMetadata.set(TikaCoreProperties.LONGITUDE,
Double.parseDouble(matcher.group(2)));
- if (matcher.group(3) != null) {
- tikaMetadata.set(TikaCoreProperties.ALTITUDE,
Double.parseDouble(matcher.group(3)));
+ ISO6709.Location location = ISO6709.parse(iso6709);
+ if (location != null) {
+ tikaMetadata.set(TikaCoreProperties.LATITUDE, location.latitude);
+ tikaMetadata.set(TikaCoreProperties.LONGITUDE, location.longitude);
+ if (location.altitude != null) {
+ tikaMetadata.set(TikaCoreProperties.ALTITUDE,
location.altitude);
}
Review Comment:
Wondering if tikaMetadata could be made aware of the ISO6709.Location type?
Then 5 lines would shrink to one ... but maybe it's not a good idea for
coupling reasons 🤷🏻♂️
> MP4Parser not getting gps metadata
> ----------------------------------
>
> Key: TIKA-2861
> URL: https://issues.apache.org/jira/browse/TIKA-2861
> Project: Tika
> Issue Type: Bug
> Components: metadata
> Reporter: Junran
> Priority: Major
> Attachments: 1.mp4, 2.MOV
>
>
> Hello, MP4Parser is not getting video GPS metadata which is extracted for
> images such as jpeg. I have checked both MP4 and MOV files, the files I
> checked all have GPS Exif data embedded in the same fields as image. Any
> idea? Thanks!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)