<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>Action Plugins (new threads)</title>
		<link>http://photobatch.wikidot.com/forum/c-23990/action-plugins</link>
		<description>Threads in the forum category &quot;Action Plugins&quot; - Suggest, post, or discuss action plugins for Phatch</description>
				<copyright></copyright>
		<lastBuildDate>Mon, 13 Jul 2026 06:29:41 +0000</lastBuildDate>
		
					<item>
				<guid>http://photobatch.wikidot.com/forum/t-307969</guid>
				<title>EXIF tags not keeped when resizing image</title>
				<link>http://photobatch.wikidot.com/forum/t-307969/exif-tags-not-keeped-when-resizing-image</link>
				<description></description>
				<pubDate>Mon, 14 Feb 2011 18:54:15 +0000</pubDate>
				<wikidot:authorName>lkoP</wikidot:authorName>				<wikidot:authorUserId>709632</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p><strong>sorry, this post is not in the correct section of the forum - i have recreated it in 'support', you can delete this one</strong></p> <p>Hello,</p> <p>I have created a simple phatch action list like this:<br /> - resize (to 1024x1024 keeping proportion)<br /> - save (to _phatch folder)</p> <p>It works but it seems that some EXIF metadata is not copied from the initial file to the processed one. In particular the &quot;Exif.Canon.0x0095&quot; one which I use to access to the Lens information (obviously on a Canon camera).</p> <p>Is this a normal behaviour?</p> <p>I'm using Debian squeeze version 0.2.7, and I have the same problem when reading the tags with the phatch Inspector or another tool (geeqie for example).</p> <p>ps : phatch is a nice tool, thanks for the job done.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://photobatch.wikidot.com/forum/t-252581</guid>
				<title>Watermark : offset + relative width</title>
				<link>http://photobatch.wikidot.com/forum/t-252581/watermark:offset-relative-width</link>
				<description></description>
				<pubDate>Sat, 10 Jul 2010 10:29:24 +0000</pubDate>
				<wikidot:authorName>Djainette</wikidot:authorName>				<wikidot:authorUserId>516540</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>This is what I'm trying to do :<br /> I had a batch of original photos, huge sized. I want to watermark them to upload high-quality versions with a logo in the bottom-right corner, and also have a smaller sized batch for regular websites.<br /> I made my actionlists, including the watermark feature with the offset option.<br /> But some of my photos are cropped, so not every one has the exact same size. Thus the png watermark logo seems to be relatively bigger or smaller depending on the original picture size.</p> <p>A relative width option for the watermark, relative to global picture, on top of the offset option would be very nice.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://photobatch.wikidot.com/forum/t-235555</guid>
				<title>Image name</title>
				<link>http://photobatch.wikidot.com/forum/t-235555/image-name</link>
				<description>How to get the name of an image ?</description>
				<pubDate>Mon, 19 Apr 2010 04:58:43 +0000</pubDate>
				<wikidot:authorName>Jywa</wikidot:authorName>				<wikidot:authorUserId>471573</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>hi,</p> <p>I got a simple question : how to get the name of an image for use it in my script ?</p> <p>And where I can get information about that ? I tried search on the PIL website but I didn't find where this information was.</p> <p>thanks.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://photobatch.wikidot.com/forum/t-213198</guid>
				<title>Medley of issues</title>
				<link>http://photobatch.wikidot.com/forum/t-213198/medley-of-issues</link>
				<description>I have collected some feedback on various items found on these wiki pages. I hope it helps to improve the quality.</description>
				<pubDate>Thu, 21 Jan 2010 19:24:36 +0000</pubDate>
				<wikidot:authorName>rogererens</wikidot:authorName>				<wikidot:authorUserId>430922</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>In the contents side pane 'Developpers' has a typo: it should contain just 1 p. I saw it written like this elsewhere on Phatch-pages, too; maybe you can grep the pages to find them.</p> <hr /> <p>On the Contribute page, you might want to refer to the Extensions page as well.</p> <hr /> <p>After creating a wikidot account I still could'nt edit any page, is this correct? Or did I miss the 'edit this page' link/button?</p> <hr /> <p>The page that explains how to write actions,<br /> <a href="http://photobatch.wikidot.com/writing-actions">http://photobatch.wikidot.com/writing-actions</a></p> <p>states that the user place to store actions is</p> <p><tt>~/.phatch/actions/</tt></p> <p>whereas on my machine (Ubuntu9.10, installed via your ppa) it is</p> <p><tt>~/.local/share/phatch/actions/</tt></p> <p>Below 'Info and metadata', photo.get_info() should be used to look up info. But it is not clear where photo is obtained from. Should this be image.get_info()?<br /> The save.py module in phatch/actions still uses photo.info()</p> <p>Also, when I try to use photo.log in my action, I get an error that it is an unknown attribute. Could you please expand on this 'photo' object?</p> <p>Likewise, how can a developer find out more about the 'image' object? It took me quite some time to find out that it has an attribute size.</p> <p>Some more typos:</p> <ul> <li>custom ReadFileField should be custom ProfileReadFileField</li> <li>ImageReadFileField should be ReadFileField</li> <li>*nver* should be *never*</li> </ul> <p>The tutorial also mentions a web page at<br /> <a href="http://trac.gbiloba.org/phatch">http://trac.gbiloba.org/phatch</a><br /> which is (still ?) unavailable (HTTP 404 error).</p> <hr /> <p>Finally, are user submitted extensions reviewed very, very carefully?<br /> Because it would be very easy for some Evil Person to wipe out all the files of a user by executing a Python script, wouldn't it?</p> <hr /> <p>The user submitted action 'Conditional Transpose' does not work currently.<br /> It wants to import an unknown function 'new' and defines an (IMHO) outdated function 'values' since the function condtitionaltranspose could just query image.size.</p> <hr /> <p>Best regards,</p> <p>Roger</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://photobatch.wikidot.com/forum/t-196183</guid>
				<title>Transparent AND borderless AND position on desktop?</title>
				<link>http://photobatch.wikidot.com/forum/t-196183/transparent-and-borderless-and-position-on-desktop</link>
				<description>Image view while positioning possible?</description>
				<pubDate>Thu, 12 Nov 2009 13:14:10 +0000</pubDate>
				<wikidot:authorName>Provocateur</wikidot:authorName>				<wikidot:authorUserId>401920</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I use linux (elive with e17 as desktop), and I was wondering if phatch can do this: a png with a transparent background, to be positioned at a certain spot, with no window decorations, i.e. borderless would be nice. Don't really need to tilt or anything (image already is). But most viewers/graphics editors (feh, display, qiv, ee) I've had or used only do 2 out of 3, and scripting to do all 3 gets out of hand. Do you think phatch could do it?</p> <p>I have a dual screen setup but if I am able to position the image with the other attributes working even just on the primary display, I'd be glad to have that!</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://photobatch.wikidot.com/forum/t-174690</guid>
				<title>Can you combine images side-by-side</title>
				<link>http://photobatch.wikidot.com/forum/t-174690/can-you-combine-images-side-by-side</link>
				<description>Looking to create a magazine spread format from two images.</description>
				<pubDate>Sun, 09 Aug 2009 02:27:13 +0000</pubDate>
				<wikidot:authorName>johnallan</wikidot:authorName>				<wikidot:authorUserId>361106</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Is it possible to create ganged images with this program?<br /> Like a magazine spread, with two vertical-orientated images side by side?</p> <p>I'm looking for something I can run automatically on our Linux server, that will take two images and create a single ganged image.</p> <p>Thanks.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://photobatch.wikidot.com/forum/t-147285</guid>
				<title>rename with date variable</title>
				<link>http://photobatch.wikidot.com/forum/t-147285/rename-with-date-variable</link>
				<description>Possible for 2digit year?</description>
				<pubDate>Wed, 15 Apr 2009 18:24:51 +0000</pubDate>
				<wikidot:authorName>m^3</wikidot:authorName>				<wikidot:authorUserId>313268</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Trying to get files renamed to: yymmdd, but with &lt;##year&gt;&lt;##month&gt;&lt;##day&gt;: the best I get is 200xmmdd. Is there anyway to get the year variable to show only the last 2 digits of it? ie. 090415 (posting date of this thread) instead of the 20090415 that I get now?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://photobatch.wikidot.com/forum/t-140672</guid>
				<title>Crop</title>
				<link>http://photobatch.wikidot.com/forum/t-140672/crop</link>
				<description></description>
				<pubDate>Mon, 23 Mar 2009 01:27:35 +0000</pubDate>
				<wikidot:authorName>msundman</wikidot:authorName>				<wikidot:authorUserId>302512</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>An action to crop off everything but a specific rectangle, defined either by <em>width, height, top left x</em> and <em>top left y</em> or by <em>top left x, top left y, bottom right x</em> and <em>bottom right y</em>.<br /> There seems to be a bunch of very similar actions, so maybe this crop functionality could be implemented in one of them (or maybe even some of them should be merged).</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://photobatch.wikidot.com/forum/t-119920</guid>
				<title>[OT] Plugin framework</title>
				<link>http://photobatch.wikidot.com/forum/t-119920/ot-plugin-framework</link>
				<description>Looking for documentation</description>
				<pubDate>Wed, 14 Jan 2009 10:14:43 +0000</pubDate>
								<wikidot:authorUserId>82859</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Hello Stani,</p> <p>Since 1 year, I'm developping a motorized panohead control software, call Papywizard (PAnoramic PYthon WIZARD):</p> <p><a href="http://trac.gbiloba.org/papywizard">http://trac.gbiloba.org/papywizard</a></p> <p>I'm at the end of the 1.x branch (about to release the last stable version, 1.6). This branch is build against PyGTK, because my first target is Nokia internet tablets (770, N80 and N810). But I have many issues with PyGTK maemo port, so I decided to switch to PyQt for the v2, which will open much more plateforms support (but drop 770 compatibility).</p> <p>This v2 is an ambitious project, where I plan to write a robust framework, in order to be able to add new features and other hardware panohead support more easily. So, I think it will be build arround a plugins framework.</p> <p>As Phatch is using a great plugin architecture, I would like to know if you have some links to documentations on this subject, or if there are books I should buy?</p> <p>Thanks,</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://photobatch.wikidot.com/forum/t-114359</guid>
				<title>FTP action with ftplib</title>
				<link>http://photobatch.wikidot.com/forum/t-114359/ftp-action-with-ftplib</link>
				<description>Add an FTP action using ftplib to transfer images after processing and saving.</description>
				<pubDate>Fri, 19 Dec 2008 17:02:37 +0000</pubDate>
				<wikidot:authorName>GreatScott</wikidot:authorName>				<wikidot:authorUserId>143421</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I think that adding an FTP action would add great functionality to Phatch, and could be accomplished using python's ftplib. This would allow web gallery maintainers to use Phatch for processing images and uploading to their web galleries in one step. This would simplify maintaining galleries in CMSs like Drupal, Joomla, etc. and would allow web developers to give their clients a single cross platform program to maintain their galleries, with all batch processing an upload already configured in a handy action list.</p> <p>I can add a blueprint for this if desired, at first glance it looks like it can be accomplished with ftplib. I am not suggesting that Phatch become yet another FTP client, but I think it could become the standard for maintaining image galleries, I would certainly add detailed instructions to the Drupal handbook on using this feature.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://photobatch.wikidot.com/forum/t-67837</guid>
				<title>Keep orientation</title>
				<link>http://photobatch.wikidot.com/forum/t-67837/keep-orientation</link>
				<description>When scaling images, take into account the original orientation.</description>
				<pubDate>Mon, 16 Jun 2008 21:50:39 +0000</pubDate>
				<wikidot:authorName>mwinarto</wikidot:authorName>				<wikidot:authorUserId>146456</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>In reply to <a href="http://ubuntuforums.org/showpost.php?p=5198803">this post on the Ubuntu forums</a> (regarding imagemagick's convert, but Phatch has the shows the same behavior) I made a small change to the Scale action.</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-number">53</span><span class="hl-identifier">a54</span><span class="hl-code"> &gt; </span><span class="hl-identifier">fields</span><span class="hl-brackets">[</span><span class="hl-identifier">_t</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">Keep Orientation</span><span class="hl-quotes">'</span><span class="hl-brackets">)]</span><span class="hl-code"> = </span><span class="hl-identifier">self</span><span class="hl-code">.</span><span class="hl-identifier">BooleanField</span><span class="hl-brackets">(</span><span class="hl-reserved">False</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-number">70</span><span class="hl-code">,</span><span class="hl-number">71</span><span class="hl-identifier">c71</span><span class="hl-code">,</span><span class="hl-number">81</span><span class="hl-code"> &lt; </span><span class="hl-comment">#check if image size has changed</span><span class="hl-code"> &lt; </span><span class="hl-identifier">scaleDownOnly</span><span class="hl-code"> = </span><span class="hl-identifier">self</span><span class="hl-code">.</span><span class="hl-identifier">get_field</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">Scale down only</span><span class="hl-quotes">'</span><span class="hl-code">,</span><span class="hl-identifier">info</span><span class="hl-brackets">)</span><span class="hl-code"> --- &gt; &gt; </span><span class="hl-identifier">scaleDownOnly</span><span class="hl-code"> = </span><span class="hl-identifier">self</span><span class="hl-code">.</span><span class="hl-identifier">get_field</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">Scale down only</span><span class="hl-quotes">'</span><span class="hl-code">,</span><span class="hl-identifier">info</span><span class="hl-brackets">)</span><span class="hl-code"> &gt; </span><span class="hl-identifier">keepOrientation</span><span class="hl-code"> = </span><span class="hl-identifier">self</span><span class="hl-code">.</span><span class="hl-identifier">get_field</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">Keep Orientation</span><span class="hl-quotes">'</span><span class="hl-code">,</span><span class="hl-identifier">info</span><span class="hl-brackets">)</span><span class="hl-code"> &gt; &gt; </span><span class="hl-comment"># swap x1 and y1 values if necessary for &quot;keep orientation&quot;</span><span class="hl-code"> &gt; </span><span class="hl-identifier">if</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-identifier">keepOrientation</span><span class="hl-code"> </span><span class="hl-identifier">and</span><span class="hl-code"> </span><span class="hl-brackets">((</span><span class="hl-identifier">x0</span><span class="hl-code"> &lt; </span><span class="hl-identifier">y0</span><span class="hl-code"> </span><span class="hl-reserved">and</span><span class="hl-code"> </span><span class="hl-identifier">x1</span><span class="hl-code"> &gt; </span><span class="hl-identifier">y1</span><span class="hl-brackets">)</span><span class="hl-code"> &gt; </span><span class="hl-identifier">or</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-identifier">x0</span><span class="hl-code"> &gt; </span><span class="hl-identifier">y0</span><span class="hl-code"> </span><span class="hl-reserved">and</span><span class="hl-code"> </span><span class="hl-identifier">x1</span><span class="hl-code"> &lt; </span><span class="hl-identifier">y1</span><span class="hl-brackets">)))</span><span class="hl-code">: &gt; </span><span class="hl-identifier">temp</span><span class="hl-code"> = </span><span class="hl-identifier">x1</span><span class="hl-code"> &gt; </span><span class="hl-identifier">x1</span><span class="hl-code"> = </span><span class="hl-identifier">y1</span><span class="hl-code"> &gt; </span><span class="hl-identifier">y1</span><span class="hl-code"> = </span><span class="hl-identifier">temp</span><span class="hl-code"> &gt;</span></pre></div> </div> <p>The problem in short:<br /> <em>when resizing a bunch of picture to 600x400 for example (using convert -resize 600x400), the pictures which are &quot;landscape&quot; oriented will effectively be resized to these dimensions, whilst the &quot;portrait&quot; oriented pics will be resized to 269x400, instead of 400x600 as expected</em></p> <p>When the option &quot;keep orientation&quot; is selected, the long side of the picture will be resized according to the largest value for width/height, and the short side will be resized according to the smallest value.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://photobatch.wikidot.com/forum/t-66764</guid>
				<title>Square canvas option</title>
				<link>http://photobatch.wikidot.com/forum/t-66764/square-canvas-option</link>
				<description>Add canvas to an image so that it is square. A 400x500 image becomes 500x500, and a 345x230 image becomes 345x345.</description>
				<pubDate>Thu, 12 Jun 2008 21:36:28 +0000</pubDate>
				<wikidot:authorName>GreatScott</wikidot:authorName>				<wikidot:authorUserId>143421</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>It would be great if there was a canvas option to make the image square by increasing the canvas size. Whichever dimension is largest, increase the other dimension to that size (along with current alignment and offset options). This way a 400x500 image becomes 500x500, and a 345x230 image becomes 345x345.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://photobatch.wikidot.com/forum/t-57940</guid>
				<title>Conditional transpose</title>
				<link>http://photobatch.wikidot.com/forum/t-57940/conditional-transpose</link>
				<description>conditional transpose action script</description>
				<pubDate>Mon, 05 May 2008 14:16:28 +0000</pubDate>
				<wikidot:authorName>nEJC</wikidot:authorName>				<wikidot:authorUserId>123100</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p><a href="http://www.nejc.info/phatch/conditionaltranspose.py">Here</a> is the action for <strong>conditional transpose</strong>.</p> <p>There are now only 2 conditions (only two I needed):</p> <ul> <li>if image is wider than high</li> <li>if image is higher than wide</li> </ul> <p>Hope this is of some use to someone else &#8230;</p> <p>NOTE: this doesn't work well with scale action - see my patch for getting around this <a href="http://photobatch.wikidot.com/forum/t-42606/improved-scale-action#post-157895">here</a> (forum topic: Improved scale action).</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://photobatch.wikidot.com/forum/t-46943</guid>
				<title>Conditional action plugins</title>
				<link>http://photobatch.wikidot.com/forum/t-46943/conditional-action-plugins</link>
				<description>Sometimes you want an action to occur only if certain conditions obtain.</description>
				<pubDate>Fri, 14 Mar 2008 21:57:09 +0000</pubDate>
				<wikidot:authorName>kwhitefoot</wikidot:authorName>				<wikidot:authorUserId>90079</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Imagine that you have a directory full of images and you want to resize them so that they are no larger than m x n pixels.</p> <p>This means that images that are already smaller than m x n should be untouched. It would be possible to modify each action plugin to make this decision but this would be very inflexible. A better way might be to allow a plugin to suppress the action of the following plugin by setting a flag.</p> <p>The simplest method would be to allow the user to simply type a Python expression in a text box; Phatch would execute this expression in a local environment consisting of all the usual variables. If the result is false then the succeeding action would be suppressed.</p> <p>In principle a generic plugin could be created that would allow the user to add UI elements for each of the defined variables but this would be considerably more complicated.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://photobatch.wikidot.com/forum/t-42606</guid>
				<title>Improved scale action</title>
				<link>http://photobatch.wikidot.com/forum/t-42606/improved-scale-action</link>
				<description></description>
				<pubDate>Thu, 21 Feb 2008 08:43:18 +0000</pubDate>
								<wikidot:authorUserId>82859</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Here is a patch for the <strong>scale</strong> action which adds a '<tt>Scale down only</tt>' parameter.</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-code">--- /</span><span class="hl-identifier">usr</span><span class="hl-code">/</span><span class="hl-identifier">local</span><span class="hl-code">/</span><span class="hl-identifier">src</span><span class="hl-code">/</span><span class="hl-identifier">phatch</span><span class="hl-code">-</span><span class="hl-number">0.1</span><span class="hl-code">.</span><span class="hl-identifier">bzr385</span><span class="hl-code">/</span><span class="hl-identifier">phatch</span><span class="hl-code">/</span><span class="hl-identifier">actions</span><span class="hl-code">/</span><span class="hl-identifier">scale</span><span class="hl-code">.</span><span class="hl-identifier">py</span><span class="hl-code"> </span><span class="hl-number">2008</span><span class="hl-code">-</span><span class="hl-number">02</span><span class="hl-code">-</span><span class="hl-number">21</span><span class="hl-code"> </span><span class="hl-number">09</span><span class="hl-code">:</span><span class="hl-number">32</span><span class="hl-code">:</span><span class="hl-number">48.000000000</span><span class="hl-code"> +</span><span class="hl-number">0100</span><span class="hl-code"> +++ /</span><span class="hl-identifier">home</span><span class="hl-code">/</span><span class="hl-identifier">fma</span><span class="hl-code">/.</span><span class="hl-identifier">phatch</span><span class="hl-code">/</span><span class="hl-identifier">actions</span><span class="hl-code">/</span><span class="hl-identifier">scale</span><span class="hl-code">.</span><span class="hl-identifier">py</span><span class="hl-code"> </span><span class="hl-number">2008</span><span class="hl-code">-</span><span class="hl-number">02</span><span class="hl-code">-</span><span class="hl-number">21</span><span class="hl-code"> </span><span class="hl-number">09</span><span class="hl-code">:</span><span class="hl-number">33</span><span class="hl-code">:</span><span class="hl-number">16.000000000</span><span class="hl-code"> +</span><span class="hl-number">0100</span><span class="hl-code"> @@ -</span><span class="hl-number">50</span><span class="hl-code">,</span><span class="hl-number">6</span><span class="hl-code"> +</span><span class="hl-number">50</span><span class="hl-code">,</span><span class="hl-number">7</span><span class="hl-code"> @@ </span><span class="hl-identifier">fields</span><span class="hl-brackets">[</span><span class="hl-identifier">_t</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">Resolution</span><span class="hl-quotes">'</span><span class="hl-brackets">)]</span><span class="hl-code"> = </span><span class="hl-identifier">self</span><span class="hl-code">.</span><span class="hl-identifier">DpiField</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">&lt;%s&gt;</span><span class="hl-quotes">'</span><span class="hl-code">%</span><span class="hl-identifier">_t</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">dpi</span><span class="hl-quotes">'</span><span class="hl-brackets">))</span><span class="hl-code"> </span><span class="hl-identifier">fields</span><span class="hl-brackets">[</span><span class="hl-identifier">_t</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">Constrain Proportions</span><span class="hl-quotes">'</span><span class="hl-brackets">)]</span><span class="hl-code"> = </span><span class="hl-identifier">self</span><span class="hl-code">.</span><span class="hl-identifier">BooleanField</span><span class="hl-brackets">(</span><span class="hl-reserved">True</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-identifier">fields</span><span class="hl-brackets">[</span><span class="hl-identifier">_t</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">Resample Image</span><span class="hl-quotes">'</span><span class="hl-brackets">)]</span><span class="hl-code"> = </span><span class="hl-identifier">self</span><span class="hl-code">.</span><span class="hl-identifier">ImageResampleField</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">bicubic</span><span class="hl-quotes">'</span><span class="hl-brackets">)</span><span class="hl-code"> + </span><span class="hl-identifier">fields</span><span class="hl-brackets">[</span><span class="hl-identifier">_t</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">Scale down only</span><span class="hl-quotes">'</span><span class="hl-brackets">)]</span><span class="hl-code"> = </span><span class="hl-identifier">self</span><span class="hl-code">.</span><span class="hl-identifier">BooleanField</span><span class="hl-brackets">(</span><span class="hl-reserved">True</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-reserved">def</span><span class="hl-code"> </span><span class="hl-identifier">apply_pil</span><span class="hl-brackets">(</span><span class="hl-identifier">self</span><span class="hl-code">,</span><span class="hl-identifier">image</span><span class="hl-brackets">)</span><span class="hl-code">: </span><span class="hl-reserved">return</span><span class="hl-code"> </span><span class="hl-identifier">image</span><span class="hl-code"> @@ -</span><span class="hl-number">64</span><span class="hl-code">,</span><span class="hl-number">8</span><span class="hl-code"> +</span><span class="hl-number">65</span><span class="hl-code">,</span><span class="hl-number">9</span><span class="hl-code"> @@ </span><span class="hl-identifier">x0</span><span class="hl-code">, </span><span class="hl-identifier">y0</span><span class="hl-code"> = </span><span class="hl-identifier">info</span><span class="hl-brackets">[</span><span class="hl-identifier">new</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">Pil.Size</span><span class="hl-quotes">'</span><span class="hl-brackets">)]</span><span class="hl-code"> </span><span class="hl-identifier">x1</span><span class="hl-code"> = </span><span class="hl-identifier">self</span><span class="hl-code">.</span><span class="hl-identifier">get_field_size</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">Width</span><span class="hl-quotes">'</span><span class="hl-code">,</span><span class="hl-identifier">info</span><span class="hl-code">,</span><span class="hl-identifier">x0</span><span class="hl-code">,</span><span class="hl-identifier">dpi</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-identifier">y1</span><span class="hl-code"> = </span><span class="hl-identifier">self</span><span class="hl-code">.</span><span class="hl-identifier">get_field_size</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">Height</span><span class="hl-quotes">'</span><span class="hl-code">,</span><span class="hl-identifier">info</span><span class="hl-code">,</span><span class="hl-identifier">y0</span><span class="hl-code">,</span><span class="hl-identifier">dpi</span><span class="hl-brackets">)</span><span class="hl-code"> - </span><span class="hl-comment">#check if image size has changed</span><span class="hl-code"> - </span><span class="hl-reserved">if</span><span class="hl-code"> </span><span class="hl-identifier">x0</span><span class="hl-code">!=</span><span class="hl-identifier">x1</span><span class="hl-code"> </span><span class="hl-reserved">or</span><span class="hl-code"> </span><span class="hl-identifier">y0</span><span class="hl-code">!=</span><span class="hl-identifier">y1</span><span class="hl-code">: + </span><span class="hl-identifier">scaleDownOnly</span><span class="hl-code"> = </span><span class="hl-identifier">self</span><span class="hl-code">.</span><span class="hl-identifier">get_field</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">Scale down only</span><span class="hl-quotes">'</span><span class="hl-code">,</span><span class="hl-identifier">info</span><span class="hl-brackets">)</span><span class="hl-code"> + </span><span class="hl-comment"># check if image size has changed</span><span class="hl-code"> + </span><span class="hl-identifier">if</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-identifier">x0</span><span class="hl-code">!=</span><span class="hl-identifier">x1</span><span class="hl-code"> </span><span class="hl-reserved">or</span><span class="hl-code"> </span><span class="hl-identifier">y0</span><span class="hl-code">!=</span><span class="hl-identifier">y1</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-identifier">and</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-reserved">not</span><span class="hl-code"> </span><span class="hl-identifier">scaleDownOnly</span><span class="hl-code"> </span><span class="hl-identifier">or</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-identifier">scaleDownOnly</span><span class="hl-code"> </span><span class="hl-identifier">and</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-identifier">x1</span><span class="hl-code">&lt;</span><span class="hl-identifier">x0</span><span class="hl-code"> </span><span class="hl-reserved">or</span><span class="hl-code"> </span><span class="hl-identifier">y1</span><span class="hl-code">&lt;</span><span class="hl-identifier">y0</span><span class="hl-brackets">)))</span><span class="hl-code">: </span><span class="hl-identifier">proportions</span><span class="hl-code"> = </span><span class="hl-identifier">self</span><span class="hl-code">.</span><span class="hl-identifier">get_field</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">Constrain Proportions</span><span class="hl-quotes">'</span><span class="hl-code">,</span><span class="hl-identifier">info</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-identifier">method</span><span class="hl-code"> = </span><span class="hl-identifier">self</span><span class="hl-code">.</span><span class="hl-identifier">get_field</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">Resample Image</span><span class="hl-quotes">'</span><span class="hl-code">,</span><span class="hl-identifier">info</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-identifier">method</span><span class="hl-code"> = </span><span class="hl-builtin">getattr</span><span class="hl-brackets">(</span><span class="hl-identifier">Image</span><span class="hl-code">,</span><span class="hl-identifier">method</span><span class="hl-brackets">)</span></pre></div> </div> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://photobatch.wikidot.com/forum/t-41633</guid>
				<title>Color management action</title>
				<link>http://photobatch.wikidot.com/forum/t-41633/color-management-action</link>
				<description></description>
				<pubDate>Sat, 16 Feb 2008 15:01:09 +0000</pubDate>
								<wikidot:authorUserId>82859</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Hi!</p> <p>I started to write an action to do color space conversions (I use an updated pyCMS module &lt;<a href="http://www.cazabon.com/pyCMS">http://www.cazabon.com/pyCMS</a>&gt;).</p> <p>For this action, I have to select source/destination profiles; so, I tried to use ReadFileField widget, but when I click on it, Phatch says:</p> <p>TypeError: <span style="text-decoration: underline;">init</span>() got an unexpected keyword argument 'extensions'</p> <p>I guess I have to add the class attribute extensions, with all available file extensions, but I don't know how to do that. I even tried to create my own widget based on this one, and add it to the Form class, but nothing worked.</p> <p>Any idea?</p> 
				 	]]>
				</content:encoded>							</item>
				</channel>
</rss>