Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 368984

Summary: [Compare]Comparing images
Product: [ECD] Orion Reporter: Szymon Brandys <Szymon.Brandys>
Component: ClientAssignee: libing wang <libingw>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bokowski, ken_walker, libingw, susan
Version: 0.3   
Target Milestone: 5.0 M1   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Image comparison now
none
Screen cap from git status page for the fix none

Description Szymon Brandys CLA 2012-01-18 11:02:20 EST
I think that we should handle image comparisons somehow in .4. I think that side-by-side compare view could show two versions next to each other but I'm not sure what the inline compare view could do. Maybe just show the new version of the image? I wonder if jsDiff.js can help us here?

I'm attaching a screenshot showing how image comparisons look now.
Comment 1 Szymon Brandys CLA 2012-01-18 11:03:47 EST
Created attachment 209688 [details]
Image comparison now
Comment 2 Ken Walker CLA 2012-01-18 12:01:47 EST
I think this is a more generic problem.  Comparing images might be one but do we likely have the same problem with .doc ,  .pdfs or other files where we might just display the binary contents?
Comment 3 libing wang CLA 2012-01-18 12:52:44 EST
(In reply to comment #2)
> I think this is a more generic problem.  Comparing images might be one but do
> we likely have the same problem with .doc ,  .pdfs or other files where we
> might just display the binary contents?

I agree. Actually the scope can be wider:
1.How do we open a binary file from the navigator? Currently we are always using Orion editor for most of the cases. We should use other services or browser plugins to do so.
2.The diff presentation for non text file will be hard. But if we can resolve the issue @1, at least we can kind of render two contents in two divs(iframe? not sure)
Comment 4 Susan McCourt CLA 2012-03-07 11:17:02 EST
(In reply to comment #3)
> (In reply to comment #2)
> > I think this is a more generic problem.  Comparing images might be one but do
> > we likely have the same problem with .doc ,  .pdfs or other files where we
> > might just display the binary contents?
> 
> I agree. Actually the scope can be wider:
> 1.How do we open a binary file from the navigator? Currently we are always
> using Orion editor for most of the cases. We should use other services or
> browser plugins to do so.

I think the approach needs to be using the open with commands.  Basically we take the code that is currently in explorer-table.js and generalize it so that any method can call it.  We also need to make sure the open with commands are registered.  I can do this work in bug 360996.
Comment 5 libing wang CLA 2012-03-07 12:28:23 EST
(In reply to comment #4)
> (In reply to comment #3)
> > (In reply to comment #2)
> > > I think this is a more generic problem.  Comparing images might be one but do
> > > we likely have the same problem with .doc ,  .pdfs or other files where we
> > > might just display the binary contents?
> > 
> > I agree. Actually the scope can be wider:
> > 1.How do we open a binary file from the navigator? Currently we are always
> > using Orion editor for most of the cases. We should use other services or
> > browser plugins to do so.
> 
> I think the approach needs to be using the open with commands.  Basically we
> take the code that is currently in explorer-table.js and generalize it so that
> any method can call it.  We also need to make sure the open with commands are
> registered.  I can do this work in bug 360996.

As the consumer of the command, I would like to require that the binary contents can be rendered in any DIV by passing the resource URI.
The compare-feature that generates nested border conatiners and the compare-container are separated now. If we can have such "open with" generalization I can easily load the binary contents into the left and right DIVs without bothering compare-container.
Comment 6 libing wang CLA 2012-05-22 10:00:50 EDT
Will be nice if we have it for 0.5 but I am not sure how hard it is, Putting to RC1 for now.
Comment 7 libing wang CLA 2012-05-31 10:08:08 EDT
We need a generic design for binary compare. This is not reasonable for 0.5.
Comment 8 libing wang CLA 2012-10-04 16:48:34 EDT
Triage in 2.0M1.
Comment 9 libing wang CLA 2013-11-12 16:22:45 EST
*** Bug 339046 has been marked as a duplicate of this bug. ***
Comment 10 libing wang CLA 2013-11-12 16:30:37 EST
(In reply to Szymon Brandys from comment #0)
> I think that we should handle image comparisons somehow in .4. I think that
> side-by-side compare view could show two versions next to each other 

Ok, finally we got a solution. the side by side shows two versions.

> but I'mnot sure what the inline compare view could do. Maybe just show the new
> version of the image? 
> 
Inline mode still show two versions of the image. The top one is the newer version and the bottom one is the older version. In between there is an "hr" dom element to separate them.
Inline mode is good for small image compare, to my opinion.

Pushed fix with http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=6968c7c4f1d22c5f46bddd417f063990158322a5.
Comment 11 libing wang CLA 2013-11-12 16:37:27 EST
Created attachment 237407 [details]
Screen cap from git status page for the fix