Skip to content

Conversation

@afcapel
Copy link
Contributor

@afcapel afcapel commented Feb 27, 2023

For Sony and Canon Raw file formats. They are based on the tiff format and have the same magic number data so they are incorrectly classified as tiff images.

Defining them as subtypes of tiff solves this issue:

Marcel::MimeType.for Pathname.new("/Users/afcapel/Downloads/RAW_SONY_ILCE-7M2.ARW"), name: "/Users/afcapel/Downloads/RAW_SONY_ILCE-7M2.ARW"
=> "image/x-raw-sony"

For Sony and Canon Raw file formats. They are based on the tiff format
and have the same magic number data so they are incorrectly classified
as tiff images.

Defining them as subtypes of tiff solves this issue:

```ruby
Marcel::MimeType.for Pathname.new("/Users/afcapel/Downloads/RAW_SONY_ILCE-7M2.ARW"), name: "/Users/afcapel/Downloads/RAW_SONY_ILCE-7M2.ARW"
=> "image/x-raw-sony"
```
@jeremy jeremy merged commit 415a693 into rails:main Mar 1, 2024
@jeremy jeremy changed the title Fix RAW images file type detection Identify Sony and Canon raw images as subtypes of image/tiff Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants