Skip to content

Commit

Permalink
Enabled HEX view for RAW formats.
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanOltmann committed Feb 17, 2024
1 parent 2e28fee commit d71f501
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions app/src/commonMain/kotlin/HtmlGenerator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,12 @@ fun generateHexHtml(bytes: ByteArray): String {
ImageFormat.JPEG ->
generateHtmlFromSlices(bytes, createJpegSlices(bytes))

ImageFormat.TIFF ->
ImageFormat.TIFF,
ImageFormat.CR2,
ImageFormat.NEF,
ImageFormat.ARW,
ImageFormat.RW2,
ImageFormat.ORF ->
generateHtmlFromSlices(bytes, createTiffSlices(bytes, exifBytes = false))

ImageFormat.PNG ->
Expand All @@ -195,7 +200,9 @@ fun generateHexHtml(bytes: ByteArray): String {
ImageFormat.WEBP ->
generateHtmlFromSlices(bytes, createWebPSlices(bytes))

ImageFormat.HEIC, ImageFormat.AVIF, ImageFormat.JXL ->
ImageFormat.HEIC,
ImageFormat.AVIF,
ImageFormat.JXL ->
generateHtmlFromSlices(bytes, createBaseMediaFileFormatSlices(bytes))

else -> "HEX view for $format is not (yet) supported."
Expand Down Expand Up @@ -839,8 +846,7 @@ private fun createBaseMediaFileFormatSlices(bytes: ByteArray): List<LabeledSlice
val itemTypeFourCC = infeBox.itemType.toFourCCTypeString()

val label =
"Item #${infeBox.itemId} @ ${infeBox.itemProtectionIndex} = $itemTypeFourCC".
escapeHtmlSpecialChars()
"Item #${infeBox.itemId} @ ${infeBox.itemProtectionIndex} = $itemTypeFourCC".escapeHtmlSpecialChars()

slices.add(
LabeledSlice(
Expand Down

0 comments on commit d71f501

Please sign in to comment.