<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://forum.ubuntu-fr.org/extern.php?action=feed&amp;tid=377788&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Forum Ubuntu-fr.org / Imagmagik positionnement]]></title>
		<link>http://forum.ubuntu-fr.org/viewtopic.php?id=377788</link>
		<description><![CDATA[Les sujets les plus récents dans Imagmagik positionnement.]]></description>
		<lastBuildDate>Thu, 11 Feb 2010 08:09:58 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Réponse à&#160;:  Imagmagik positionnement]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3272457#p3272457</link>
			<description><![CDATA[<p>Salut,</p><p>c&#039;est un peu bizarre de laisser autant de blanc sur des images, mais bon, en cherchant un peu j&#039;ai trouvé ça sur le man de convert:</p><div class="codebox"><pre><code>-page &lt;width&gt;x&lt;height&gt;{+-}&lt;x offset&gt;{+-
          }&lt;y offset&gt;{%}{!}{&lt;}{&gt;}
          preferred size and location of an image canvas.

          Use this  option  to  specify  the  dimensions  of  the
          Postscript page in dots per inch or a TEXT page in pix-
          els.</code></pre></div><p>ici:<br /><a href="http://amath.colorado.edu/computing/software/man/convert.html">http://amath.colorado.edu/computing/sof … nvert.html</a></p><p>je pense qu&#039;avec l&#039;option offset tu peux peut-être centrer ton image mais il faut que l&#039;offset dépende de la taille de l&#039;image. Il y a aussi cet option offset sur l&#039;option &quot;-size&quot;.</p><p>Je n&#039;ai pas essayé mais essaye de jouer avec cet offset, déjà en mettant un offset manuel fixe pour voir si ça décale bien l&#039;image. Puis si ça marche, essaye de calculer cet offset en fonction de la taille.</p>]]></description>
			<author><![CDATA[dummy@example.com (CasseTaTele)]]></author>
			<pubDate>Thu, 11 Feb 2010 08:09:58 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3272457#p3272457</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Imagmagik positionnement]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3272035#p3272035</link>
			<description><![CDATA[<p>Personne n&#039;a d&#039;idée ?</p>]]></description>
			<author><![CDATA[dummy@example.com (Tomzz)]]></author>
			<pubDate>Wed, 10 Feb 2010 22:18:27 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3272035#p3272035</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Imagmagik positionnement]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3266533#p3266533</link>
			<description><![CDATA[<p>Un p&#039;tit up</p>]]></description>
			<author><![CDATA[dummy@example.com (Tomzz)]]></author>
			<pubDate>Mon, 08 Feb 2010 14:13:44 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3266533#p3266533</guid>
		</item>
		<item>
			<title><![CDATA[Imagmagik positionnement]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3264631#p3264631</link>
			<description><![CDATA[<p>Bonjour,<br />J&#039;ai fais un petit script nautilus basé sur imagmagik pour mettre en forme rapidement des images afin de les insérer sur un site web (oscommerce en l&#039;occurrence).<br />Le but étant d&#039;obtenir des images ayant toujours la même dimension en respectant les proportions d&#039;origine.</p><p>Donc, dans le cas où les proportions d&#039;origines ne permettent pas d&#039;atteindre les dimensions souhaitées ( orientation Paysage dans un mode portrait par exemple) la plus grande dimension est réduite vers la plus grande cible, la plus petite réduite en proportion et un fond vient remplir la partie manquante à la petite dimension pour atteindre la taille cible.</p><p>Mon problème est que l&#039;image redimensionnée est placée à partir du coin supérieur gauche de l&#039;image totale:<br /><span class="postimg"><img src="http://img638.imageshack.us/img638/2898/snapshot1265559298.png" alt="snapshot1265559298.png" /></span><br />ou<br /><span class="postimg"><img src="http://img683.imageshack.us/img683/4199/snapshot1265559408.png" alt="snapshot1265559408.png" /></span></p><p>hors je souhaiterai qu&#039;elle soit centrée (verticalement et horizontalement).</p><p>Voilà les lignes que j&#039;utilise:</p><div class="codebox"><pre><code>convert &quot;$imag1&quot; -resize 300x400 -strip -quality 50 -interlace line &quot;$image&quot;
  convert -page 300x400 &quot;$image&quot; -coalesce  &quot;$image&quot;</code></pre></div><p>et le script complet, si il peut être utile à quelqu&#039;un:</p><div class="codebox"><pre class="vscroll"><code>#!/bin/bash

printf %s &quot;$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS&quot; |
while read -r arg
do
  ## traitement des espaces et caractères spéciaux dans le nom de fichier ##
  detox -v -s utf_8 &quot;$arg&quot; &gt; /tmp/img.txt
  if [ $(wc -l /tmp/img.txt | cut -d&#039; &#039; -f1) -gt &quot;1&quot; ]; then
  {
	  tail --lines=1 /tmp/img.txt &gt; /tmp/img1.txt
	  varg=$(cat /tmp/img1.txt | cut -d&#039;&gt;&#039; -f2 | sed &#039;s/ //g&#039;)
	  echo &quot;$varg&quot; &gt; /tmp/img2.txt
	  imag1=$(cat /tmp/img2.txt | sed &#039;s/ //g&#039;)
	  image=&quot;${imag1##*/}.jpg&quot;
	  rm /tmp/img.txt
	  rm /tmp/img1.txt
	  rm /tmp/img2.txt
  }
  else
  {
	  imag1=&quot;$1&quot;
	  image=&quot;$1&quot;.jpg
  }
  fi
  
## redimentionnement et conversion de l&#039;image ##
  convert &quot;$imag1&quot; -resize 300x400 -strip -quality 50 -interlace line &quot;$image&quot;
  convert -page 300x400 &quot;$image&quot; -coalesce  &quot;$image&quot;

  mv &quot;$image&quot; $HOME/fichiers-web/images-pretes/&quot;$image&quot;
done</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (Tomzz)]]></author>
			<pubDate>Sun, 07 Feb 2010 16:18:22 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3264631#p3264631</guid>
		</item>
	</channel>
</rss>
