Update notes for 2017-03-03

This commit is contained in:
2017-03-03 18:40:38 +02:00
parent 644e443069
commit 8f3c2f53c3
5 changed files with 117 additions and 9 deletions

View File

@ -22,10 +22,30 @@ $ identify ~/Desktop/alc_contrastes_desafios.jpg
<!--more-->
- This results in discolored thumbnails, sRGB and CMYK:
- This results in discolored thumbnails when compared to the original PDF, for example sRGB and CMYK:
![Thumbnail in sRGB colorspace](/cgspace-notes/2017/03/thumbnail-srgb.jpg)
![Thumbnial in CMYK colorspace](/cgspace-notes/2017/03/thumbnail-cmyk.jpg)
- I filed an issue for the color space thing: [DS-3517](https://jira.duraspace.org/browse/DS-3517)
## 2017-03-03
- I created a patch for DS-3517 and made a pull request against upstream `dspace-5_x`: https://github.com/DSpace/DSpace/pull/1669
- Looks like `-colorspace sRGB` alone isn't enough, we need to use profiles:
```
$ convert -thumbnail 300x300 -flatten -profile /opt/brew/Cellar/ghostscript/9.20/share/ghostscript/9.20/iccprofiles/default_cmyk.icc -profile /opt/brew/Cellar/ghostscript/9.20/share/ghostscript/9.20/iccprofiles/default_rgb.icc alc_contrastes_desafios.pdf\[0\] alc_contrastes_desafios.pdf.jpg
```
- This is a great resource describing the color stuff: http://www.imagemagick.org/Usage/formats/#profiles
- Somehow we need to detect the color system being used by the input file and handle each case differently
- This is trivial with `identify` (even by the [Java ImageMagick API](http://im4java.sourceforge.net/api/org/im4java/core/IMOps.html#identify)):
```
$ identify -format '%r\n' alc_contrastes_desafios.pdf\[0\]
DirectClass CMYK
$ identify -format '%r\n' Africa\ group\ of\ negotiators.pdf\[0\]
DirectClass sRGB Alpha
```