Images http://drupal8.ovh/en/tags/images en Images processing using ImageMagick (convert) http://drupal8.ovh/en/tutoriels/128/images-processing-using-imagemagick-convert <span class="field field--name-title field--type-string field--label-hidden">Images processing using ImageMagick (convert)</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/en/users/editor" typeof="schema:Person" property="schema:name" datatype="">editor</span></span> <span class="field field--name-created field--type-created field--label-hidden">Sat, 06/11/2016 - 23:54</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><h2>Crop images using convert (ImageMagick)</h2> <p>Example (Single file):<br /><code>convert input.jpg -crop 1300x950+312+72 crop.jpg<br /> convert input.jpg -crop 1300x950-100-50 crop.jpg</code></p> <h2>Resize images using convert (ImageMagick)</h2> <p><code>convert -resize 1024x768 *.JPG new_.jpg<br /> convert -resize 25% *.JPG new_.jpg</code></p> <p> </p> <h2>Batch process (bulk processing - shell/batch script)</h2> <p><code>#Example 1. Crop images<br /> for i in $( ls Renamed/*.jpg); do convert -crop 1300x950+312+72 $i outs/$i; done</code></p> <p>#Example 2 Resize images<br /> for i in $( ls ./*.jpg); do convert -resize 1024 $i outs/$i; done</p> </div> <div class="field field--name-field-tags field--type-entity-reference field--label-inline clearfix"> <h3 class="field__label inline">Tags</h3> <ul class="links field__items"> <li><a href="/en/tags/shell" hreflang="en">Shell</a></li> <li><a href="/en/tags/linux" hreflang="en">Linux</a></li> <li><a href="/en/tags/images" hreflang="en">Images</a></li> </ul> </div> <section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> <h2 class="title comment-form__title">Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=128&amp;2=comment&amp;3=comment" token="77211a64"></drupal-render-placeholder> </section> Sat, 11 Jun 2016 21:54:51 +0000 editor 128 at http://drupal8.ovh Get a Image file path (src) on Drupal 8 http://drupal8.ovh/en/tutoriels/83/get-a-image-file-path-src-on-drupal-8 <span class="field field--name-title field--type-string field--label-hidden">Get a Image file path (src) on Drupal 8</span> <div class="clearfix text-formatted field field--name-field-question field--type-text-long field--label-above"> <div class="field__label">Question</div> <div class="field__item"><p>How to display an image file (or get the src to render) in Drupal 8 ?</p> </div> </div> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/en/users/editor" typeof="schema:Person" property="schema:name" datatype="">editor</span></span> <span class="field field--name-created field--type-created field--label-hidden">Wed, 12/16/2015 - 23:44</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Get the image file src (url)   <br /><code>    $fid = 1;//The file ID   <br />     $file = \Drupal\file\Entity\File::load($fid);<br />     $path = $file-&gt;getFileUri();<br />     OR<br />     $path = 'public://images/image.jpg';<br />     $url = \Drupal\image\Entity\ImageStyle::load('medium')-&gt;buildUrl($path);</code></p> </div> <div class="field field--name-field-tags field--type-entity-reference field--label-inline clearfix"> <h3 class="field__label inline">Tags</h3> <ul class="links field__items"> <li><a href="/en/tags/drupal-8" hreflang="en">Drupal 8</a></li> <li><a href="/en/tags/code" hreflang="en">Code</a></li> <li><a href="/en/tags/images" hreflang="en">Images</a></li> </ul> </div> <section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> <h2 class="title">Comments</h2> <a id="comment-23"></a> <article role="article" data-comment-user-id="0" about="/en/comment/23" typeof="schema:Comment" class="comment js-comment by-anonymous clearfix"> <span class="hidden" data-comment-timestamp="1464455215"></span> <footer class="comment__meta"> <article typeof="schema:Person" about="/user/0" class="profile"> </article> <p class="comment__author"><span rel="schema:author"><span lang="" typeof="schema:Person" property="schema:name" datatype="">Granville (not verified)</span></span> </p> <p class="comment__time">Thu, 04/21/2016 - 19:38 <span property="schema:dateCreated" content="2016-04-21T17:38:46+00:00" class="rdf-meta hidden"></span> </p> <p class="comment__permalink"><a href="/en/comment/23#comment-23" hreflang="en">Permalink</a></p> </footer> <div class="comment__content"> <h3 property="schema:name" datatype=""><a href="/en/comment/23#comment-23" class="permalink" rel="bookmark" hreflang="en">small issue in last line</a></h3> <div property="schema:text" class="clearfix text-formatted field field--name-comment-body field--type-text-long field--label-hidden field__item"><p>I think it should be</p> <p><code>$url = \Drupal\image\Entity\ImageStyle::load('medium')-&gt;buildUrl($path);</code></p> </div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=23&amp;1=default&amp;2=en&amp;3=" token="b2c5533d"></drupal-render-placeholder> </div> </article> <div class="indented"><a id="comment-36"></a> <article role="article" data-comment-user-id="2" about="/en/comment/36" typeof="schema:Comment" class="comment js-comment by-node-author clearfix"> <span class="hidden" data-comment-timestamp="1464455238"></span> <footer class="comment__meta"> <article typeof="schema:Person" about="/en/users/editor" class="profile"> </article> <p class="comment__author"><span rel="schema:author"><span lang="" about="/en/users/editor" typeof="schema:Person" property="schema:name" datatype="">editor</span></span> </p> <p class="comment__time">Sat, 05/28/2016 - 19:07 <span property="schema:dateCreated" content="2016-05-28T17:07:18+00:00" class="rdf-meta hidden"></span> </p> <p class="comment__permalink"><a href="/en/comment/36#comment-36" hreflang="en">Permalink</a></p> <p class="visually-hidden">In reply to <a href="/en/comment/23#comment-23" class="permalink" rel="bookmark" hreflang="en">small issue in last line</a> by <span lang="" typeof="schema:Person" property="schema:name" datatype="">Granville (not verified)</span></p> </footer> <div class="comment__content"> <h3 property="schema:name" datatype=""><a href="/en/comment/36#comment-36" class="permalink" rel="bookmark" hreflang="en">Yes, Thank you.</a></h3> <div property="schema:text" class="clearfix text-formatted field field--name-comment-body field--type-text-long field--label-hidden field__item"><p>Yes, Thank you.</p> </div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=36&amp;1=default&amp;2=en&amp;3=" token="8d514b11"></drupal-render-placeholder> </div> </article> </div> <h2 class="title comment-form__title">Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=83&amp;2=comment&amp;3=comment" token="8faea1dd"></drupal-render-placeholder> </section> Wed, 16 Dec 2015 22:44:45 +0000 editor 83 at http://drupal8.ovh Linux Shell - Process bulk Images http://drupal8.ovh/en/tutoriels/8/linux-shell-process-bulk-images <span class="field field--name-title field--type-string field--label-hidden">Linux Shell - Process bulk Images</span> <div class="clearfix text-formatted field field--name-field-question field--type-text-long field--label-above"> <div class="field__label">Question</div> <div class="field__item"><p>How to process several images with linux shell.</p> </div> </div> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/en/users/editor" typeof="schema:Person" property="schema:name" datatype="">editor</span></span> <span class="field field--name-created field--type-created field--label-hidden">Mon, 11/16/2015 - 11:49</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Inlinux debian / ubuntu / mint ...</p> <p>1. Install imagemagick tools (if not installed)<br /><code># sudo apt-get install imagemagick</code></p> <p>2. Process images like : (here resize images to 50%)<br /><code>$ for i in $( ls *.jpg); do convert -resize 50% $i re_$i; done</code></p> </div> <div class="field field--name-field-tags field--type-entity-reference field--label-inline clearfix"> <h3 class="field__label inline">Tags</h3> <ul class="links field__items"> <li><a href="/en/tags/linux" hreflang="en">Linux</a></li> <li><a href="/en/tags/shell" hreflang="en">Shell</a></li> <li><a href="/en/tags/images" hreflang="en">Images</a></li> </ul> </div> <section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> <h2 class="title comment-form__title">Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=8&amp;2=comment&amp;3=comment" token="5fae70a6"></drupal-render-placeholder> </section> Mon, 16 Nov 2015 10:49:52 +0000 editor 8 at http://drupal8.ovh