<?xml version="1.0" encoding="UTF-8"?>
<ticket>
  <assigned-user-id type="integer" nil="true"></assigned-user-id>
  <attachments-count type="integer">1</attachments-count>
  <closed type="boolean">true</closed>
  <created-at type="datetime">2008-04-03T13:08:16-05:00</created-at>
  <creator-id type="integer">8760</creator-id>
  <milestone-due-on type="datetime" nil="true"></milestone-due-on>
  <milestone-id type="integer" nil="true"></milestone-id>
  <number type="integer">24</number>
  <permalink>patch-coreimage-resizes-main-attachment-as-well-as-thumbnails</permalink>
  <priority type="integer">8528</priority>
  <project-id type="integer">35</project-id>
  <raw-data type="binary" nil="true" encoding="base64"></raw-data>
  <state>resolved</state>
  <tag>attachment_fu core_image patch</tag>
  <title>CoreImage Resizes Main Attachment As Well As Thumbnails</title>
  <updated-at type="datetime">2008-05-22T20:27:24-05:00</updated-at>
  <user-id type="integer">1</user-id>
  <user-name>Rick</user-name>
  <creator-name>Paul Mucur</creator-name>
  <url>http://ar-code.lighthouseapp.com/projects/35/tickets/24</url>
  <original-body>When using the CoreImage processor and specifying a thumbnail, attachment_fu will both create a thumbnail with the specified dimensions and resize the *original image* to the thumbnail size. Manually setting resize_to does not seem to affect it and it is down to the CoreImage processor's resizing method.

The fix is a simple one: adding &quot;self.temp_path = random_tempfile_filename&quot; to the resize_image method so that it does not overwrite the original file.

You can see the change in my forked version of the plugin: http://github.com/mudge/attachment_fu/commit/801dc755af806cf5b58b34408791ee66b143a8e9</original-body>
  <latest-body>When using the CoreImage processor and specifying a thumbnail, attachment_fu will both create a thumbnail with the specified dimensions and resize the *original image* to the thumbnail size. Manually setting resize_to does not seem to affect it and it is down to the CoreImage processor's resizing method.

The fix is a simple one: adding &quot;self.temp_path = random_tempfile_filename&quot; to the resize_image method so that it does not overwrite the original file.

You can see the change in my forked version of the plugin: http://github.com/mudge/attachment_fu/commit/801dc755af806cf5b58b34408791ee66b143a8e9</latest-body>
  <original-body-html>&lt;div&gt;&lt;p&gt;
When using the CoreImage processor and specifying a thumbnail, attachment_fu will both create a thumbnail with the specified dimensions and resize the &lt;strong&gt;original image&lt;/strong&gt; to the thumbnail size. Manually setting resize_to does not seem to affect it and it is down to the CoreImage processor's resizing method.
&lt;/p&gt;&lt;p&gt;
The fix is a simple one: adding &quot;self.temp_path = random_tempfile_filename&quot; to the resize_image method so that it does not overwrite the original file.
&lt;/p&gt;&lt;p&gt;
You can see the change in my forked version of the plugin: &lt;a href=&quot;http://github.com/mudge/attachment_fu/commit/801dc755af806cf5b58b34408791ee66b143a8e9&quot;&gt;http://github.com/mudge/attachme...&lt;/a&gt;
&lt;/p&gt;&lt;/div&gt;</original-body-html>
  <versions type="array">
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>When using the CoreImage processor and specifying a thumbnail, attachment_fu will both create a thumbnail with the specified dimensions and resize the *original image* to the thumbnail size. Manually setting resize_to does not seem to affect it and it seems to be down to the CoreImage processor's resizing method.

I tried adding &quot;self.temp_path = random_tempfile_filename&quot; to the resize_image method and, while this seemed to fix it, a duplicate thumbnail was created at RAILS_ROOT.

I am using the plugin as of commit 9610d9cc764026727 on Mac OS X 10.5.2 with Rails 2.0.2 and no other image processors installed.</body>
      <body-html>&lt;div&gt;&lt;p&gt;
When using the CoreImage processor and specifying a thumbnail, attachment_fu will both create a thumbnail with the specified dimensions and resize the &lt;strong&gt;original image&lt;/strong&gt; to the thumbnail size. Manually setting resize_to does not seem to affect it and it seems to be down to the CoreImage processor's resizing method.
&lt;/p&gt;&lt;p&gt;
I tried adding &quot;self.temp_path = random_tempfile_filename&quot; to the resize_image method and, while this seemed to fix it, a duplicate thumbnail was created at RAILS_ROOT.
&lt;/p&gt;&lt;p&gt;
I am using the plugin as of commit 9610d9cc764026727 on Mac OS X 10.5.2 with Rails 2.0.2 and no other image processors installed.
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-04-04T06:20:02-05:00</created-at>
      <creator-id type="integer">8760</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">24</number>
      <permalink>patch-coreimage-resizes-main-attachment-as-well-as-thumbnails</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">35</project-id>
      <state>new</state>
      <tag nil="true"></tag>
      <title>CoreImage Resizes Main Attachment As Well As Thumbnails</title>
      <updated-at type="datetime">2008-04-04T06:20:02-05:00</updated-at>
      <user-id type="integer">8760</user-id>
      <user-name>Paul Mucur</user-name>
      <creator-name>Paul Mucur</creator-name>
      <url>http://ar-code.lighthouseapp.com/projects/35/tickets/24</url>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Had the same problem and attached a patch (including a test).

The problem was that the original image file was overwritten by the thumbnails.</body>
      <body-html>&lt;div&gt;&lt;p&gt;
Had the same problem and attached a patch (including a test).
&lt;/p&gt;&lt;p&gt;
The problem was that the original image file was overwritten by the thumbnails.
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-05-18T09:30:57-05:00</created-at>
      <creator-id type="integer">8760</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">24</number>
      <permalink>patch-coreimage-resizes-main-attachment-as-well-as-thumbnails</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">35</project-id>
      <state>new</state>
      <tag nil="true"></tag>
      <title>CoreImage Resizes Main Attachment As Well As Thumbnails</title>
      <updated-at type="datetime">2008-05-18T09:30:57-05:00</updated-at>
      <user-id type="integer">20611</user-id>
      <user-name>Christoph Lupprich</user-name>
      <creator-name>Paul Mucur</creator-name>
      <url>http://ar-code.lighthouseapp.com/projects/35/tickets/24</url>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>Hi All,

Thanks for the information and patch. Christoph, I've just applied your patch to http://github.com/crafterm/attachment_fu/ and sent a pull request to Technoweenie to integrate upstream.

Much appreciated guys, good find.

Cheers,

Marcus</body>
      <body-html>&lt;div&gt;&lt;p&gt;
Hi All,
&lt;/p&gt;&lt;p&gt;
Thanks for the information and patch. Christoph, I've just applied your patch to &lt;a href=&quot;http://github.com/crafterm/attachment_fu/&quot;&gt;http://github.com/crafterm/attac...&lt;/a&gt; and sent a pull request to Technoweenie to integrate upstream.
&lt;/p&gt;&lt;p&gt;
Much appreciated guys, good find.
&lt;/p&gt;&lt;p&gt;
Cheers,
&lt;/p&gt;&lt;p&gt;
Marcus
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-05-21T22:51:51-05:00</created-at>
      <creator-id type="integer">8760</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">24</number>
      <permalink>patch-coreimage-resizes-main-attachment-as-well-as-thumbnails</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">35</project-id>
      <state>new</state>
      <tag nil="true"></tag>
      <title>CoreImage Resizes Main Attachment As Well As Thumbnails</title>
      <updated-at type="datetime">2008-05-21T22:51:51-05:00</updated-at>
      <user-id type="integer">8621</user-id>
      <user-name>crafterm</user-name>
      <creator-name>Paul Mucur</creator-name>
      <url>http://ar-code.lighthouseapp.com/projects/35/tickets/24</url>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>Pushed to github: http://github.com/technoweenie/attachment_fu/commit/834553ad3d876541b986ed6de115ea0023070bb5

Thanks everyone!</body>
      <body-html>&lt;div&gt;&lt;p&gt;
Pushed to github: &lt;a href=&quot;http://github.com/technoweenie/attachment_fu/commit/834553ad3d876541b986ed6de115ea0023070bb5&quot;&gt;http://github.com/technoweenie/a...&lt;/a&gt;
&lt;/p&gt;&lt;p&gt;
Thanks everyone!
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2008-05-22T20:27:24-05:00</created-at>
      <creator-id type="integer">8760</creator-id>
      <diffable-attributes type="yaml">--- 
:state: new
</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">24</number>
      <permalink>patch-coreimage-resizes-main-attachment-as-well-as-thumbnails</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">35</project-id>
      <state>resolved</state>
      <tag nil="true"></tag>
      <title>CoreImage Resizes Main Attachment As Well As Thumbnails</title>
      <updated-at type="datetime">2008-05-22T20:27:24-05:00</updated-at>
      <user-id type="integer">1</user-id>
      <user-name>Rick</user-name>
      <creator-name>Paul Mucur</creator-name>
      <url>http://ar-code.lighthouseapp.com/projects/35/tickets/24</url>
    </version>
  </versions>
  <attachments type="array">
    <attachment type="Attachment">
      <code>374bf151e51fc5881021760bb2f6c4d5f1096b36</code>
      <content-type>text/plain</content-type>
      <created-at type="datetime">2008-05-18T09:30:57-05:00</created-at>
      <filename>patch_core_image.diff</filename>
      <height type="integer" nil="true"></height>
      <id type="integer">23423</id>
      <size type="integer">1468</size>
      <uploader-id type="integer">20611</uploader-id>
      <width type="integer" nil="true"></width>
      <url>http://ar-code.lighthouseapp.com/attachments/23423/patch_core_image.diff</url>
    </attachment>
  </attachments>
</ticket>
