Skip to content

Commit

Permalink
Revert "Support for HEIC files (#51)"
Browse files Browse the repository at this point in the history
This reverts commit daad3b9.
  • Loading branch information
StefanOltmann committed Jan 7, 2024
1 parent daad3b9 commit f53bb87
Show file tree
Hide file tree
Showing 262 changed files with 490 additions and 2,918 deletions.
133 changes: 133 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Large diffs are not rendered by default.

12 changes: 4 additions & 8 deletions NOTICE.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
Ashampoo Kim - Kotlin Image Metadata
Copyright 2024 Ashampoo GmbH & Co. KG
Copyright 2023 Ashampoo GmbH & Co. KG

This product includes a modified portion of 'Apache Commons Imaging'
developed by the Apache Software Foundation (https://www.apache.org/).
The metadata handling logic, originally implemented in Java, has been rewritten in Kotlin.
Copyright 2007-2023 The Apache Software Foundation

Logic for reading HEIC images was derived from 'metadata-extractor'
developed by Drew Noakes (https://github.com/drewnoakes/metadata-extractor).
Copyright 2002-2023 Drew Noakes and contributors

This product includes images from Unplash provided under
the Unsplash license (https://unsplash.com/license).
These files are used as test data.

The sample images photo_62.nef, photo_63.arw, photo_64.rw2, photo_56.orf and
photo_72.hif are taken from https://github.com/drewnoakes/metadata-extractor-images
under the note "You are free to use these media files however you wish".
The sample images photo_62.nef, photo_63.arw, photo_64.rw2 and photo_56.orf are
taken from https://github.com/drewnoakes/metadata-extractor-images under the note
"You are free to use these media files however you wish.".
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ It's part of [Ashampoo Photos](https://ashampoo.com/photos).
* JPG: Read & Write EXIF, IPTC & XMP
* PNG: Read & Write `eXIf` chunk & XMP
+ Also read non-standard EXIF & IPTC from `tEXt`/`zTXt` chunk
* HEIC: Read EXIF & XMP
+ Somewhat experimental as only tested for iPhone HEIC files so far
* TIFF / DNG / RAW: Read EXIF & XMP
+ Good support for Canon CR2, Fujifilm RAF & Adobe DNG
+ Experimental support for NEF, ARW, RW2 & ORF with known issues
Expand All @@ -35,7 +33,7 @@ of Ashampoo Photos, which, in turn, is driven by user community feedback.
## Installation

```
implementation("com.ashampoo:kim:0.9")
implementation("com.ashampoo:kim:0.8.3")
```

## Sample usages
Expand Down Expand Up @@ -140,7 +138,6 @@ val newBytes = Kim.updateThumbnail(
## Limitations

* Inability to update EXIF, IPTC and XMP in JPG files simultaneously.
* HEIC files are only tested for iPhone SE 3. If you encounter an unsupported file, please contribute it.

## Contributions

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Ashampoo GmbH & Co. KG
* Copyright 2023 Ashampoo GmbH & Co. KG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Ashampoo GmbH & Co. KG
* Copyright 2023 Ashampoo GmbH & Co. KG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Ashampoo GmbH & Co. KG
* Copyright 2023 Ashampoo GmbH & Co. KG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Ashampoo GmbH & Co. KG
* Copyright 2023 Ashampoo GmbH & Co. KG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Ashampoo GmbH & Co. KG
* Copyright 2023 Ashampoo GmbH & Co. KG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/commonMain/kotlin/com/ashampoo/kim/Kim.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Ashampoo GmbH & Co. KG
* Copyright 2023 Ashampoo GmbH & Co. KG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Ashampoo GmbH & Co. KG
* Copyright 2023 Ashampoo GmbH & Co. KG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Ashampoo GmbH & Co. KG
* Copyright 2023 Ashampoo GmbH & Co. KG
* Copyright 2007-2023 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion src/commonMain/kotlin/com/ashampoo/kim/common/ByteOrder.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Ashampoo GmbH & Co. KG
* Copyright 2023 Ashampoo GmbH & Co. KG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Ashampoo GmbH & Co. KG
* Copyright 2023 Ashampoo GmbH & Co. KG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/commonMain/kotlin/com/ashampoo/kim/common/ExifUtil.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Ashampoo GmbH & Co. KG
* Copyright 2023 Ashampoo GmbH & Co. KG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
34 changes: 0 additions & 34 deletions src/commonMain/kotlin/com/ashampoo/kim/common/FourCC.kt

This file was deleted.

2 changes: 1 addition & 1 deletion src/commonMain/kotlin/com/ashampoo/kim/common/GpsUtil.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Ashampoo GmbH & Co. KG
* Copyright 2023 Ashampoo GmbH & Co. KG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Ashampoo GmbH & Co. KG
* Copyright 2023 Ashampoo GmbH & Co. KG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Ashampoo GmbH & Co. KG
* Copyright 2023 Ashampoo GmbH & Co. KG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Ashampoo GmbH & Co. KG
* Copyright 2023 Ashampoo GmbH & Co. KG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Ashampoo GmbH & Co. KG
* Copyright 2023 Ashampoo GmbH & Co. KG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Ashampoo GmbH & Co. KG
* Copyright 2023 Ashampoo GmbH & Co. KG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Ashampoo GmbH & Co. KG
* Copyright 2023 Ashampoo GmbH & Co. KG
* Copyright 2007-2023 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion src/commonMain/kotlin/com/ashampoo/kim/common/ZLib.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Ashampoo GmbH & Co. KG
* Copyright 2023 Ashampoo GmbH & Co. KG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Ashampoo GmbH & Co. KG
* Copyright 2023 Ashampoo GmbH & Co. KG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -80,36 +80,6 @@ object ImageFormatMagicNumbers {
0x52, 0x49, 0x46, 0x46, null, null, null, null, 0x57, 0x45, 0x42, 0x50
)

/* 4 bytes + "ftypheic" */
val heic: List<Byte?> = byteListOf(
null, null, null, null
).plus("ftypheic".encodeToByteArray().toList())

/* A HEIC brand */
val mif1: List<Byte?> = byteListOf(
null, null, null, null
).plus("ftypmif1".encodeToByteArray().toList())

/* A HEIC brand */
val msf1: List<Byte?> = byteListOf(
null, null, null, null
).plus("ftypmsf1".encodeToByteArray().toList())

/* A HEIC brand */
val heix: List<Byte?> = byteListOf(
null, null, null, null
).plus("ftypheix".encodeToByteArray().toList())

/* A HEIC brand */
val hevc: List<Byte?> = byteListOf(
null, null, null, null
).plus("ftyphevc".encodeToByteArray().toList())

/* A HEIC brand */
val hevx: List<Byte?> = byteListOf(
null, null, null, null
).plus("ftyphevx".encodeToByteArray().toList())

private fun byteListOf(vararg ints: Int?): List<Byte?> =
ints.map { it?.toByte() }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Ashampoo GmbH & Co. KG
* Copyright 2023 Ashampoo GmbH & Co. KG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
6 changes: 2 additions & 4 deletions src/commonMain/kotlin/com/ashampoo/kim/format/ImageParser.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright 2024 Ashampoo GmbH & Co. KG
* Copyright 2023 Ashampoo GmbH & Co. KG
* Copyright 2007-2023 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,7 +17,6 @@
package com.ashampoo.kim.format

import com.ashampoo.kim.common.ImageReadException
import com.ashampoo.kim.format.heic.HeicImageParser
import com.ashampoo.kim.format.jpeg.JpegImageParser
import com.ashampoo.kim.format.png.PngImageParser
import com.ashampoo.kim.format.raf.RafImageParser
Expand Down Expand Up @@ -47,8 +47,6 @@ fun interface ImageParser {

ImageFormat.RAF -> RafImageParser

ImageFormat.HEIC -> HeicImageParser

else -> null
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Ashampoo GmbH & Co. KG
* Copyright 2023 Ashampoo GmbH & Co. KG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Ashampoo GmbH & Co. KG
* Copyright 2023 Ashampoo GmbH & Co. KG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Ashampoo GmbH & Co. KG
* Copyright 2023 Ashampoo GmbH & Co. KG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright 2024 Ashampoo GmbH & Co. KG
* Copyright 2023 Ashampoo GmbH & Co. KG
* Copyright 2007-2023 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -41,7 +42,7 @@ object ArwPreviewExtractor : TiffPreviewExtractor {
if (previewLength == 0)
return null

randomAccessByteReader.moveTo(previewImageStart)
randomAccessByteReader.skipTo(previewImageStart)

val previewBytes = randomAccessByteReader.readBytes(previewLength)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright 2024 Ashampoo GmbH & Co. KG
* Copyright 2023 Ashampoo GmbH & Co. KG
* Copyright 2007-2023 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -41,7 +42,7 @@ object Cr2PreviewExtractor : TiffPreviewExtractor {
if (previewLength == 0)
return null

randomAccessByteReader.moveTo(previewImageStart)
randomAccessByteReader.skipTo(previewImageStart)

val previewBytes = randomAccessByteReader.readBytes(previewLength)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright 2024 Ashampoo GmbH & Co. KG
* Copyright 2023 Ashampoo GmbH & Co. KG
* Copyright 2007-2023 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -51,7 +52,7 @@ object DngPreviewExtractor : TiffPreviewExtractor {
if (previewLength == 0)
return null

randomAccessByteReader.moveTo(previewImageStart)
randomAccessByteReader.skipTo(previewImageStart)

val previewBytes = randomAccessByteReader.readBytes(previewLength)

Expand Down
Loading

1 comment on commit f53bb87

@StefanOltmann
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted due to uncertainty regarding the patent situation surrounding HEIC parsers.

Please sign in to comment.