<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
	<id>https://kono.phpage.fr/index.php?action=history&amp;feed=atom&amp;title=Python%2FScript-python-fu-taille_image</id>
	<title>Python/Script-python-fu-taille image - Historique des versions</title>
	<link rel="self" type="application/atom+xml" href="https://kono.phpage.fr/index.php?action=history&amp;feed=atom&amp;title=Python%2FScript-python-fu-taille_image"/>
	<link rel="alternate" type="text/html" href="https://kono.phpage.fr/index.php?title=Python/Script-python-fu-taille_image&amp;action=history"/>
	<updated>2026-10-23T18:33:15Z</updated>
	<subtitle>Historique des versions pour cette page sur le wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://kono.phpage.fr/index.php?title=Python/Script-python-fu-taille_image&amp;diff=2417&amp;oldid=prev</id>
		<title>Fylip22 le 27 janvier 2021 à 09:11</title>
		<link rel="alternate" type="text/html" href="https://kono.phpage.fr/index.php?title=Python/Script-python-fu-taille_image&amp;diff=2417&amp;oldid=prev"/>
		<updated>2021-01-27T09:11:30Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;fr&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Version précédente&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version du 27 janvier 2021 à 11:11&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l56&quot;&gt;Ligne 56 :&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Ligne 56 :&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;main()&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;main()&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Catégorie:Python]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Catégorie:Script]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Fylip22</name></author>
	</entry>
	<entry>
		<id>https://kono.phpage.fr/index.php?title=Python/Script-python-fu-taille_image&amp;diff=2415&amp;oldid=prev</id>
		<title>Fylip22 : Page créée avec « &lt;source lang=&quot;python&quot;&gt; #!/usr/bin/env python  import math from gimpfu import *  def lazy_scale_image(timg, tdrawable, max_width, max_height):     print &quot;max width: %s\nmax... »</title>
		<link rel="alternate" type="text/html" href="https://kono.phpage.fr/index.php?title=Python/Script-python-fu-taille_image&amp;diff=2415&amp;oldid=prev"/>
		<updated>2021-01-27T09:10:12Z</updated>

		<summary type="html">&lt;p&gt;Page créée avec « &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt; #!/usr/bin/env python  import math from gimpfu import *  def lazy_scale_image(timg, tdrawable, max_width, max_height):     print &amp;quot;max width: %s\nmax... »&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
&lt;br /&gt;
import math&lt;br /&gt;
from gimpfu import *&lt;br /&gt;
&lt;br /&gt;
def lazy_scale_image(timg, tdrawable, max_width, max_height):&lt;br /&gt;
    print &amp;quot;max width: %s\nmax height: %s&amp;quot; % (max_width, max_height)&lt;br /&gt;
    width = tdrawable.width&lt;br /&gt;
    height = tdrawable.height&lt;br /&gt;
&lt;br /&gt;
    if max_width &amp;lt;= 0:&lt;br /&gt;
        # Assume width is okay as it is&lt;br /&gt;
        max_width = width&lt;br /&gt;
    if max_height &amp;lt;= 0:&lt;br /&gt;
        # Assume height is okay&lt;br /&gt;
        max_height= height&lt;br /&gt;
&lt;br /&gt;
    if width &amp;lt;= max_width and height &amp;lt;= max_height:&lt;br /&gt;
        print &amp;quot;Nothing to do, returning&amp;quot;&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    image_aspect    = float(width) / float(height)&lt;br /&gt;
    boundary_aspect = float(max_width) / float(max_height)&lt;br /&gt;
    if image_aspect &amp;gt; boundary_aspect:&lt;br /&gt;
        # Width is the limiting factor:&lt;br /&gt;
        new_width = max_width&lt;br /&gt;
        new_height= int(round(  new_width/image_aspect ))&lt;br /&gt;
    else:&lt;br /&gt;
        # Height is the limiting factor:&lt;br /&gt;
        new_height = max_height&lt;br /&gt;
        new_width = int(round(  image_aspect*new_height  ))&lt;br /&gt;
&lt;br /&gt;
    print &amp;quot;Resizing %s:%s to %s:%s&amp;quot; % (width, height, new_width, new_height)&lt;br /&gt;
&lt;br /&gt;
    # At present, documentation does not specify the interpolation--&lt;br /&gt;
    # another tutorial claimed it was cubic:&lt;br /&gt;
    pdb.gimp_image_scale(timg, new_width, new_height)&lt;br /&gt;
&lt;br /&gt;
register(&lt;br /&gt;
        &amp;quot;lazy_scale_image&amp;quot;,&lt;br /&gt;
        &amp;quot;Redimensionne l&amp;#039;image&amp;quot;,&lt;br /&gt;
        &amp;quot;Scale the specified image so that it is no larger than the given dimensions&amp;quot;,&lt;br /&gt;
        &amp;quot;Daniel Zwell&amp;quot;,&lt;br /&gt;
        &amp;quot;Daniel Zwell&amp;quot;,&lt;br /&gt;
        &amp;quot;2008&amp;quot;,&lt;br /&gt;
        &amp;quot;&amp;lt;Image&amp;gt;/_Extensions/_Taille image&amp;quot;,&lt;br /&gt;
        &amp;quot;RGB*, GRAY*&amp;quot;,&lt;br /&gt;
        [&lt;br /&gt;
                (PF_INT, &amp;quot;max_width&amp;quot;, &amp;quot;Largeur maximum&amp;quot;, 1280),&lt;br /&gt;
                (PF_INT, &amp;quot;max_height&amp;quot;, &amp;quot;Hauteur maximum&amp;quot;, 900),&lt;br /&gt;
        ],&lt;br /&gt;
        [],&lt;br /&gt;
        lazy_scale_image)&lt;br /&gt;
&lt;br /&gt;
main()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Fylip22</name></author>
	</entry>
</feed>