Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 362067 - Use online editor to edit images
Summary: Use online editor to edit images
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Client (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 0.5 M1   Edit
Assignee: Susan McCourt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 372914 373443 373450
Blocks:
  Show dependency tree
 
Reported: 2011-10-26 09:48 EDT by Tomasz Zarna CLA
Modified: 2012-03-17 01:25 EDT (History)
6 users (show)

See Also:


Attachments
screenshot so far.... (89.36 KB, image/png)
2012-03-06 01:27 EST, Susan McCourt CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz Zarna CLA 2011-10-26 09:48:38 EDT
Allow to edit images with online editors like Pixlr (http://pixlr.com/) or Picnik (http://www.picnik.com/).

I took just a quick look at these sites but it was enough to see that some of them have API (http://pixlr.com/developer/api) that we could leverage in Orion. The "only" problem is uploading password secured images to the editor and saving them back in Orion.
Comment 1 John Arthorne CLA 2011-10-26 10:43:44 EDT
This would be an excellent cross-site integration example for 0.4.
Comment 2 Susan McCourt CLA 2011-10-26 12:12:51 EDT
The API for pixlr defaults to using a get, so at least we don't have the "pixlr must host the plug-in to post" issue.  

If we can set an Orion "site" to be world readable, then getting the image into the editor is not an issue.
Comment 3 John Arthorne CLA 2011-10-26 13:16:05 EDT
(In reply to comment #2)
> The API for pixlr defaults to using a get, so at least we don't have the "pixlr
> must host the plug-in to post" issue.  
> 
> If we can set an Orion "site" to be world readable, then getting the image into
> the editor is not an issue.

Yes, pixlr could read the image directly from the Orion file server. For example:

http://pixlr.com/editor/?image=http://orionhub.org/file/k/bundles/org.eclipse.orion.client.core/web/images/orion.png

Saving the editor is a problem though.
Comment 4 Susan McCourt CLA 2011-10-26 14:42:40 EDT
(In reply to comment #3)

> Yes, pixlr could read the image directly from the Orion file server. For
> example:
> 
> http://pixlr.com/editor/?image=http://orionhub.org/file/k/bundles/org.eclipse.orion.client.core/web/images/orion.png

orionhub is world readable, but is orion.eclipse.org?  Wouldn't we need some kind of "make my site world readable" option in order to work directly from there? 

> Saving the editor is a problem though.

Don't we just need to be willing to have some weird get-based API for importing a file?  using your orionhub example, something like....

http://orionhub.org/import/file/k/bundles/org.eclipse.orion.client.core/web/images/orion.png?image=http://somepixlrurl
Comment 5 Susan McCourt CLA 2012-03-06 01:23:05 EST
I'm working on this as way of pushing on bug 372914 and details in bug 349531.
So far I'm able to embed pixlr as an iframe into an Orion page.  I've got it hooked up to an open with command so that this pixlr page opens on any image. That part is working.  You get the breadcrumb, related pages, etc. so that you can edit the image and still be linked to other parts of Orion.  (I'll attach a snapshot).

Since the page is working from within Orion, I should be able to save.  I'm just trying to work out the most general way to get this working so that it's not hardcoded to the pixlr case.  I think we can implement a save command that accepts a URL and saves the contents of a GET on that URL back to the file system.  Then we would set up pixlr to use our URL.  We could use the command/slideout functionality to perform the save. I imagine the slideout might say:

Save contents: [some pixlr URL] to: [the orion workspace path]

This would be prefilled in, and the user could even fill in a different workspace path on the second parameter in order to achieve "save as"
Comment 6 Susan McCourt CLA 2012-03-06 01:27:41 EST
Created attachment 212112 [details]
screenshot so far....
Comment 7 Tomasz Zarna CLA 2012-03-06 04:46:22 EST
(In reply to comment #6)
> screenshot so far....

Sweet!
Comment 8 libing wang CLA 2012-03-06 10:16:44 EST
(In reply to comment #6)
> Created attachment 212112 [details]
> screenshot so far....

Ken and I were talking about comparing images in 0.5. Bug 368984.
Susan, is it possible make it a component so that it can be embedded to any DIV, similar to how textview works?
I am not sure how to diff two images yet but the bottom line is to render two read-only images in the side by side compare widget.
Comment 9 Susan McCourt CLA 2012-03-06 17:18:42 EST
(In reply to comment #8)
> (In reply to comment #6)
> > Created attachment 212112 [details]
> > screenshot so far....
> 
> Ken and I were talking about comparing images in 0.5. Bug 368984.
> Susan, is it possible make it a component so that it can be embedded to any
> DIV, similar to how textview works?
> I am not sure how to diff two images yet but the bottom line is to render two
> read-only images in the side by side compare widget.

This bug is about integrating an online image editor into Orion.  We aren't trying to show any comparisons here, just invoke another site to do the editing.
Comment 10 Susan McCourt CLA 2012-03-06 17:21:18 EST
the plot thickens with respect to "save."
I figured out how to get all the communication going between the hosting page and the iframe so that we know where the content has been stored by the iframe.  So we've jumped over the "user must download and reupload" hoop but the problem is that we can't do an xhrGet on a URL from another domain.

I opened bug 373443 for this.  In my opinion, solving that bug would open up a bunch of scenarios that were previously blocked on the "you must save, download, upload, import" workflow.  Such as initialzr, css generation, sprite generation, etc. etc.
Comment 11 Susan McCourt CLA 2012-03-06 20:02:02 EST
I've released the support for bug 372914 (orion.page.content extension) and a first cut at a pixlr plugin at

http://sfmccourt.github.com/plugins/pixlr/pixlrPlugin.html

For the plugin to work you have to be running the code in HEAD

It doesn't save yet, so one could argue it's pretty useless.  On the other hand, it's already illuminating some issues (see blocking bugs) and is helping us prove that an integrator could try to tie together Orion and some pre-existing web app API.  When you try to save, you'll get a page telling you where the file was saved.  This is basically proving that the communication is in place for the plugin to tell the web app how to tell orion where the data is.

The save challenges will be discussed in bug 373443.
Comment 12 libing wang CLA 2012-03-07 08:49:07 EST
(In reply to comment #9)
> (In reply to comment #8)
> > (In reply to comment #6)
> > > Created attachment 212112 [details]
> > > screenshot so far....
> > 
> > Ken and I were talking about comparing images in 0.5. Bug 368984.
> > Susan, is it possible make it a component so that it can be embedded to any
> > DIV, similar to how textview works?
> > I am not sure how to diff two images yet but the bottom line is to render two
> > read-only images in the side by side compare widget.
> 
> This bug is about integrating an online image editor into Orion.  We aren't
> trying to show any comparisons here, just invoke another site to do the
> editing.

Ok, we will just "paste" the 2 versions of the images into the left and right DIVs. To edit the left side, we will just invoke the site.
Comment 13 Susan McCourt CLA 2012-03-07 11:51:14 EST
hmmm...tried it in the build.  The plugin is working on FF and IE9, but not on Chrome.  On Chrome the editor is launched but fails to read the file.  I saw this kind of thing happening yesterday when there were some encoding/decoding issues, it could be something like that...
Comment 14 Susan McCourt CLA 2012-03-07 11:57:58 EST
(In reply to comment #13)
> hmmm...tried it in the build.  The plugin is working on FF and IE9, but not on
> Chrome.  On Chrome the editor is launched but fails to read the file.  I saw
> this kind of thing happening yesterday when there were some encoding/decoding
> issues, it could be something like that...

the problem is stale plugin data on chrome.  I tried localStorage.clear() and even delete/reload the plugin...hmmm....
Comment 15 Susan McCourt CLA 2012-03-17 01:25:29 EDT
We now have an initial implementation.
The workflow is not ideal, but the basics are there.

You can use "open with" to open pixlr or pixlr express.
You can edit the file.
Closing it empties the content area on the page but keeps you there.
Saving it invokes a save hook that allows you to optionally look at the data and then decide if you want to save to Orion.  At that point you can choose to either stay in the editor or go back to the navigator.

The workflow is pretty laborious if your intention is to save many times while still editing...you'll have to click twice each time, to confirm the save to Orion and then to go back to editing.

But we can open new bugs on improving the workflow.