Perfil de cor embutido na imagem

Não tenho certeza se isso apareceu em outro lugar (os termos de busca, perfil de cor incorporado, retornam resultados não relacionados.. :slight_smile: ).

Eu administro um fórum de fotografia de Software Livre em discuss.pixls.us. Como você pode imaginar, temos usuários muito exigentes quanto à forma como suas imagens são exibidas.

Recentemente, nos deparamos com um problema em um tópico sobre gerenciamento de cores:

Um dos fotógrafos notou que a funcionalidade de buscar imagens vinculadas e armazená-las localmente parece remover as informações de cor das imagens. Embora isso possa ser aceitável para economizar espaço na maioria dos fóruns, para um fórum de fotografia isso é um pouco doloroso. :frowning:

Para ilustrar, esta imagem possui um perfil de cor incorporado rotacionado. Ela deveria mostrar (Rot = Vermelho, Grün = Verde, Blau = Azul):


A imagem fonte que incorporei na postagem acima pode ser encontrada aqui:

https://houz.org/tmp/farbkreis.jpg

Aqui está a mesma imagem, enviada diretamente ao fórum:

O processamento de imagem está sendo feito com o ImageMagick? Se sim, há alguma consideração em adicionar uma opção para converter imagens enviadas para sRGB e marcá-las como tal antes de salvar?

(Eu ficaria feliz em investigar mais se alguém puder me apontar as partes relevantes do código que lidam com a conversão de imagem ao fazer o upload?)

5 curtidas

Sure check with @zogstrip.

@zogstrip - is the conversion being done using imagemagick? If so, would you mind pointing me to the relevant section?

It appears that we may only need an option to convert any images to sRGB if they have a different profile embedded, and then either strip the profile or specify that the image is now sRGB.

We do the resizing with convert but then the thumbnail is optimised using optipng.

You will find everything you need to know in OptimizedImage and more specifically

3 curtidas

Tested fix:

https://github.com/discourse/discourse/pull/4064

3 curtidas

This still does not look fixed to me… I just tried with the image on the OP.

@tgxworld as part of your image magick 7 upgrade can you test this?

3 curtidas

This is actually a result of ImageOptim and not ImageMagick. We probably don’t want to be stripping the ICC profile here?

  • :strip — List of extra markers to strip: :comments , :exif , :iptc , :icc or :all (defaults to :all )
3 curtidas

Probably :comments is what we want there?

1 curtida

I was thinking about this and this seems very specific to a photography forum. If they want to keep all the metadata/color profile, they can just set SiteSetting.strip_image_metadata to false. For majority of the images, keeping the exif or iptc metadata isn’t going to be very useful.

2 curtidas

Interesting @Patrick_David, so this is not really a bug… it is a feature request to allow for fidelity when stripping exif tags (or simply misunderstanding an existing feature)

I am going to close this for now, but feel free to open a new topic if you find setting strip_image_metadata to false unacceptable.

5 curtidas