<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.caminobrowser.org/index.php?action=history&amp;feed=atom&amp;title=User%3AHendy%3AImageToIPhoto</id>
	<title>User:Hendy:ImageToIPhoto - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.caminobrowser.org/index.php?action=history&amp;feed=atom&amp;title=User%3AHendy%3AImageToIPhoto"/>
	<link rel="alternate" type="text/html" href="http://wiki.caminobrowser.org/index.php?title=User:Hendy:ImageToIPhoto&amp;action=history"/>
	<updated>2026-05-20T16:22:36Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.4</generator>
	<entry>
		<id>http://wiki.caminobrowser.org/index.php?title=User:Hendy:ImageToIPhoto&amp;diff=9853&amp;oldid=prev</id>
		<title>Hendy at 03:49, 9 May 2009</title>
		<link rel="alternate" type="text/html" href="http://wiki.caminobrowser.org/index.php?title=User:Hendy:ImageToIPhoto&amp;diff=9853&amp;oldid=prev"/>
		<updated>2009-05-09T03:49:11Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&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;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 03:49, 9 May 2009&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-l22&quot; &gt;Line 22:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 22:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;We wouldn&amp;#039;t need to remove the file after iPhoto imports it either, as &amp;lt;pre&amp;gt;~/Caches/TemporaryItems&amp;lt;/pre&amp;gt; is automatically cleared each reboot, as is the directory that Safari uses.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;We wouldn&amp;#039;t need to remove the file after iPhoto imports it either, as &amp;lt;pre&amp;gt;~/Caches/TemporaryItems&amp;lt;/pre&amp;gt; is automatically cleared each reboot, as is the directory that Safari uses.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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;== Apple Events ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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;Smokey has [[User_talk:Hendy:ImageToIPhoto|documented]] the Apple Events that Safari uses.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Hendy</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.caminobrowser.org/index.php?title=User:Hendy:ImageToIPhoto&amp;diff=9464&amp;oldid=prev</id>
		<title>Hendy at 04:28, 15 November 2008</title>
		<link rel="alternate" type="text/html" href="http://wiki.caminobrowser.org/index.php?title=User:Hendy:ImageToIPhoto&amp;diff=9464&amp;oldid=prev"/>
		<updated>2008-11-15T04:28:15Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[https://bugzilla.mozilla.org/show_bug.cgi?id=311621 Add &amp;quot;Add Image to iPhoto Library&amp;quot; to contextual menu]&lt;br /&gt;
&lt;br /&gt;
Safari has this feature. It downloads the image to a folder in /private/tmp, like /private/tmp/SafariiPhoto6ImagesSuudKO, and then somehow adds it to iPhoto.&lt;br /&gt;
&lt;br /&gt;
We can do a similar thing, by saving it to a temporary folder and using something like the following Applescript:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tell application &amp;quot;iPhoto&amp;quot;&lt;br /&gt;
    import from &amp;quot;/path/to/temp/folder/lolcat.jpg&amp;quot;&lt;br /&gt;
end tell&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main issue is to get the image into that temporary folder. Our present Save Image… command eventually gets to &amp;#039;&amp;#039;&amp;#039;CHBrowserView&amp;#039;&amp;#039;&amp;#039;&amp;#039;s &amp;lt;pre&amp;gt;saveInternal: withDocument: suggestedFilename: bypassCache: filterView:&amp;lt;/pre&amp;gt; method. This is the method that sets up an &amp;#039;&amp;#039;&amp;#039;nsHeaderSniffer&amp;#039;&amp;#039;&amp;#039;, which then gives us the Save dialog and pops up the Downloads window. We don&amp;#039;t want either of those, since we want to make the process seamless for the user.&lt;br /&gt;
&lt;br /&gt;
Removing the &amp;#039;&amp;#039;&amp;#039;nsHeaderSniffer&amp;#039;&amp;#039;&amp;#039; from the method, for example by commenting out the line&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;webPersist-&amp;gt;SetProgressListener(sniffer);  // owned&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
gets us partway there. If you save an image using the context menu, neither the save dialog nor the downloads window comes up. The download image isn&amp;#039;t in any of the places you&amp;#039;d expect, either. You&amp;#039;ll find it in &amp;lt;pre&amp;gt;~/Caches/TemporaryItems&amp;lt;/pre&amp;gt; with a name like -sav0tmp. That&amp;#039;s set up earlier in the method.&lt;br /&gt;
&lt;br /&gt;
What we could do is write a similar method, that sets up a temporary file with the same name as the src attribute of the image. We can tell Gecko to grab it from the cache. It doesn&amp;#039;t seem to matter if the file name doesn&amp;#039;t have an extension on it, since iPhoto will happily import a test PNG with the name -sav0tmp. It&amp;#039;s all about the magic numbers, apparently.&lt;br /&gt;
&lt;br /&gt;
We wouldn&amp;#039;t need to remove the file after iPhoto imports it either, as &amp;lt;pre&amp;gt;~/Caches/TemporaryItems&amp;lt;/pre&amp;gt; is automatically cleared each reboot, as is the directory that Safari uses.&lt;/div&gt;</summary>
		<author><name>Hendy</name></author>
		
	</entry>
</feed>