Update notes for 2017-03-03

This commit is contained in:
Alan Orth 2017-03-03 18:40:38 +02:00
parent 644e443069
commit 8f3c2f53c3
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9
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
```

View File

@ -82,7 +82,7 @@ $ identify ~/Desktop/alc_contrastes_desafios.jpg
"headline": "March, 2017",
"url": "https://alanorth.github.io/cgspace-notes/2017-03/",
"wordCount": "113",
"wordCount": "218",
"datePublished": "2017-03-01T17:08:52&#43;02:00",
@ -178,7 +178,7 @@ $ identify ~/Desktop/alc_contrastes_desafios.jpg
<p></p>
<ul>
<li>This results in discolored thumbnails, sRGB and CMYK:</li>
<li>This results in discolored thumbnails when compared to the original PDF, for example sRGB and CMYK:</li>
</ul>
<p><img src="/cgspace-notes/2017/03/thumbnail-srgb.jpg" alt="Thumbnail in sRGB colorspace" /></p>
@ -189,6 +189,28 @@ $ identify ~/Desktop/alc_contrastes_desafios.jpg
<li>I filed an issue for the color space thing: <a href="https://jira.duraspace.org/browse/DS-3517">DS-3517</a></li>
</ul>
<h2 id="2017-03-03">2017-03-03</h2>
<ul>
<li>I created a patch for DS-3517 and made a pull request against upstream <code>dspace-5_x</code>: <a href="https://github.com/DSpace/DSpace/pull/1669">https://github.com/DSpace/DSpace/pull/1669</a></li>
<li>Looks like <code>-colorspace sRGB</code> alone isn&rsquo;t enough, we need to use profiles:</li>
</ul>
<pre><code>$ 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
</code></pre>
<ul>
<li>This is a great resource describing the color stuff: <a href="http://www.imagemagick.org/Usage/formats/#profiles">http://www.imagemagick.org/Usage/formats/#profiles</a></li>
<li>Somehow we need to detect the color system being used by the input file and handle each case differently</li>
<li>This is trivial with <code>identify</code> (even by the <a href="http://im4java.sourceforge.net/api/org/im4java/core/IMOps.html#identify">Java ImageMagick API</a>):</li>
</ul>
<pre><code>$ identify -format '%r\n' alc_contrastes_desafios.pdf\[0\]
DirectClass CMYK
$ identify -format '%r\n' Africa\ group\ of\ negotiators.pdf\[0\]
DirectClass sRGB Alpha
</code></pre>

View File

@ -36,7 +36,7 @@
&lt;p&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This results in discolored thumbnails, sRGB and CMYK:&lt;/li&gt;
&lt;li&gt;This results in discolored thumbnails when compared to the original PDF, for example sRGB and CMYK:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&#34;https://alanorth.github.io/cgspace-notes/cgspace-notes/2017/03/thumbnail-srgb.jpg&#34; alt=&#34;Thumbnail in sRGB colorspace&#34; /&gt;&lt;/p&gt;
@ -45,7 +45,29 @@
&lt;ul&gt;
&lt;li&gt;I filed an issue for the color space thing: &lt;a href=&#34;https://jira.duraspace.org/browse/DS-3517&#34;&gt;DS-3517&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
&lt;/ul&gt;
&lt;h2 id=&#34;2017-03-03&#34;&gt;2017-03-03&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;I created a patch for DS-3517 and made a pull request against upstream &lt;code&gt;dspace-5_x&lt;/code&gt;: &lt;a href=&#34;https://github.com/DSpace/DSpace/pull/1669&#34;&gt;https://github.com/DSpace/DSpace/pull/1669&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Looks like &lt;code&gt;-colorspace sRGB&lt;/code&gt; alone isn&amp;rsquo;t enough, we need to use profiles:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$ 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
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;This is a great resource describing the color stuff: &lt;a href=&#34;http://www.imagemagick.org/Usage/formats/#profiles&#34;&gt;http://www.imagemagick.org/Usage/formats/#profiles&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Somehow we need to detect the color system being used by the input file and handle each case differently&lt;/li&gt;
&lt;li&gt;This is trivial with &lt;code&gt;identify&lt;/code&gt; (even by the &lt;a href=&#34;http://im4java.sourceforge.net/api/org/im4java/core/IMOps.html#identify&#34;&gt;Java ImageMagick API&lt;/a&gt;):&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$ identify -format &#39;%r\n&#39; alc_contrastes_desafios.pdf\[0\]
DirectClass CMYK
$ identify -format &#39;%r\n&#39; Africa\ group\ of\ negotiators.pdf\[0\]
DirectClass sRGB Alpha
&lt;/code&gt;&lt;/pre&gt;</description>
</item>
<item>

View File

@ -36,7 +36,7 @@
&lt;p&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This results in discolored thumbnails, sRGB and CMYK:&lt;/li&gt;
&lt;li&gt;This results in discolored thumbnails when compared to the original PDF, for example sRGB and CMYK:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&#34;https://alanorth.github.io/cgspace-notes/cgspace-notes/2017/03/thumbnail-srgb.jpg&#34; alt=&#34;Thumbnail in sRGB colorspace&#34; /&gt;&lt;/p&gt;
@ -45,7 +45,29 @@
&lt;ul&gt;
&lt;li&gt;I filed an issue for the color space thing: &lt;a href=&#34;https://jira.duraspace.org/browse/DS-3517&#34;&gt;DS-3517&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
&lt;/ul&gt;
&lt;h2 id=&#34;2017-03-03&#34;&gt;2017-03-03&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;I created a patch for DS-3517 and made a pull request against upstream &lt;code&gt;dspace-5_x&lt;/code&gt;: &lt;a href=&#34;https://github.com/DSpace/DSpace/pull/1669&#34;&gt;https://github.com/DSpace/DSpace/pull/1669&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Looks like &lt;code&gt;-colorspace sRGB&lt;/code&gt; alone isn&amp;rsquo;t enough, we need to use profiles:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$ 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
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;This is a great resource describing the color stuff: &lt;a href=&#34;http://www.imagemagick.org/Usage/formats/#profiles&#34;&gt;http://www.imagemagick.org/Usage/formats/#profiles&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Somehow we need to detect the color system being used by the input file and handle each case differently&lt;/li&gt;
&lt;li&gt;This is trivial with &lt;code&gt;identify&lt;/code&gt; (even by the &lt;a href=&#34;http://im4java.sourceforge.net/api/org/im4java/core/IMOps.html#identify&#34;&gt;Java ImageMagick API&lt;/a&gt;):&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$ identify -format &#39;%r\n&#39; alc_contrastes_desafios.pdf\[0\]
DirectClass CMYK
$ identify -format &#39;%r\n&#39; Africa\ group\ of\ negotiators.pdf\[0\]
DirectClass sRGB Alpha
&lt;/code&gt;&lt;/pre&gt;</description>
</item>
<item>

View File

@ -35,7 +35,7 @@
&lt;p&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This results in discolored thumbnails, sRGB and CMYK:&lt;/li&gt;
&lt;li&gt;This results in discolored thumbnails when compared to the original PDF, for example sRGB and CMYK:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&#34;https://alanorth.github.io/cgspace-notes/cgspace-notes/2017/03/thumbnail-srgb.jpg&#34; alt=&#34;Thumbnail in sRGB colorspace&#34; /&gt;&lt;/p&gt;
@ -44,7 +44,29 @@
&lt;ul&gt;
&lt;li&gt;I filed an issue for the color space thing: &lt;a href=&#34;https://jira.duraspace.org/browse/DS-3517&#34;&gt;DS-3517&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
&lt;/ul&gt;
&lt;h2 id=&#34;2017-03-03&#34;&gt;2017-03-03&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;I created a patch for DS-3517 and made a pull request against upstream &lt;code&gt;dspace-5_x&lt;/code&gt;: &lt;a href=&#34;https://github.com/DSpace/DSpace/pull/1669&#34;&gt;https://github.com/DSpace/DSpace/pull/1669&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Looks like &lt;code&gt;-colorspace sRGB&lt;/code&gt; alone isn&amp;rsquo;t enough, we need to use profiles:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$ 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
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;This is a great resource describing the color stuff: &lt;a href=&#34;http://www.imagemagick.org/Usage/formats/#profiles&#34;&gt;http://www.imagemagick.org/Usage/formats/#profiles&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Somehow we need to detect the color system being used by the input file and handle each case differently&lt;/li&gt;
&lt;li&gt;This is trivial with &lt;code&gt;identify&lt;/code&gt; (even by the &lt;a href=&#34;http://im4java.sourceforge.net/api/org/im4java/core/IMOps.html#identify&#34;&gt;Java ImageMagick API&lt;/a&gt;):&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$ identify -format &#39;%r\n&#39; alc_contrastes_desafios.pdf\[0\]
DirectClass CMYK
$ identify -format &#39;%r\n&#39; Africa\ group\ of\ negotiators.pdf\[0\]
DirectClass sRGB Alpha
&lt;/code&gt;&lt;/pre&gt;</description>
</item>
<item>