Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: needlessly modifying images' ICC profiles #347

Open
gianni-rosato opened this issue Jul 16, 2023 · 3 comments
Open

bug: needlessly modifying images' ICC profiles #347

gianni-rosato opened this issue Jul 16, 2023 · 3 comments
Labels
crate:services:autumn crates/services/autumn

Comments

@gianni-rosato
Copy link

What happened?

Sending images via Revolt appears to strip ICC color profile information, which causes some images to display incorrectly. Upon sending an image like this to Revolt, the color information is stripped from the image & it ends up looking wrong. Discord only strips the ICC color information in previews, when pressing "view full image" it is actually intact. Additionally, most modern browsers support ICC color management.

I understand stripping metadata to preserve user privacy, but it is never harmful to keep the ICC color profile around to make sure the image's color information is displayed properly. Additionally, every iPhone takes images tagged with the P3 color profile. ICC color information can be preserved with exiftool by running exiftool -all= --icc_profile:all input.jpg.

color_strip_example

@insertish insertish transferred this issue from revoltchat/frontend Jul 21, 2023
@insertish insertish self-assigned this Jul 21, 2023
@insertish insertish removed their assignment Mar 31, 2024
@insertish insertish changed the title bug: Needlessly modifying images' ICC profiles bug: needlessly modifying images' ICC profiles Sep 29, 2024
@insertish insertish transferred this issue from revoltchat/autumn Sep 29, 2024
@insertish insertish added the crate:services:autumn crates/services/autumn label Sep 29, 2024
@insertish
Copy link
Member

Would like to do this Rust native and not pull in exiftool (appears to be quite difficult to get a static copy).
One option is little_exif, but ran into an issue that needs investigating, relevant issue: TechnikTobi/little_exif#12

@insertish insertish moved this from 🕒 Backlog to 💡 Open in Revolt Project Oct 2, 2024
@insertish
Copy link
Member

Tried to rebase forked crate on main, now does not build due to:

error[E0658]: use of unstable library feature 'seek_seek_relative'
   --> /home/izzy/.cargo/registry/src/index.crates.io-6f17d22bba15001f/revolt_little_exif-0.5.1/src/png/vec.rs:174:11
    |
174 |             cursor.seek_relative(chunk.length() as i64 + 12)?;
    |                    ^^^^^^^^^^^^^
    |
    = note: see issue #117374 <https://github.com/rust-lang/rust/issues/117374> for more information

Blocked on #341

@TechnikTobi
Copy link

TechnikTobi commented Oct 28, 2024

I see. Is this the only unstable feature used by little_exif? If so I can look into a work around that would be part of the 0.6.0 release (which, as far as I can tell, is able to properly read in the EXIF information from your example file).

Edit: Checked this, replacing seek_relative is viable and the only change required for 1.77.2 compatibility. Will be available in the 0.6.0 release.

@insertish insertish moved this from 💡 Open to 🚪 Blocked in Revolt Project Oct 28, 2024
@insertish insertish removed the bug label Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crate:services:autumn crates/services/autumn
Projects
Status: 🚪 Blocked
Development

No branches or pull requests

3 participants