Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow diff view to display images? #444

Closed
mkonecny opened this issue May 1, 2015 · 7 comments
Closed

Allow diff view to display images? #444

mkonecny opened this issue May 1, 2015 · 7 comments

Comments

@mkonecny
Copy link

mkonecny commented May 1, 2015

When working on a project with a lot of image assets and preparing a commit, I find myself leaving the git-cola UI and switching windows back and forth often to see which images I should stage.

I think it would be great if I could simply preview the image within git-cola itself. I wouldn't mind providing this via a pull request if anyone else thinks this would be useful.

@Vdragon
Copy link
Contributor

Vdragon commented May 1, 2015

Maybe upgrade diff view to diff/preview?

@mkonecny
Copy link
Author

mkonecny commented May 2, 2015

@Vdragon exactly more of a preview in the case of an image.

@Vdragon
Copy link
Contributor

Vdragon commented May 5, 2015

@mkonecny Thus diff/preview not diff&preview :P

@davvid
Copy link
Member

davvid commented Jul 17, 2015

This would be supercool. The diff viewer already has a little header menu, so we could add a little eye icon to the header that's only active when an image file supported by Qt is selected.

Enabling the eye toggle would put cola into the image diff mode.

That mode could have a few different layouts for how it shows the image.
It could show them side-by-side, and vertically.

Super fancy would be a mode that rendered them in a single view with a slider to wipe or blend between the images.

Zoom controls would be helpful too, with the same mousewheel interaction we have in git-dag.

QGraphicsScene would probably be the "lightest" way to implement it. QtWebkit would be an interesting way.. we'd basically render it using html + javascript, in an embedded web view.

Thoughts?

@Vdragon
Copy link
Contributor

Vdragon commented Jul 17, 2015

I wonder if the toggle is really needed when we already know the file is a picture...

@davvid
Copy link
Member

davvid commented Jul 18, 2015

@Vdragon that's true.

@davvid davvid self-assigned this Mar 8, 2018
davvid added a commit to davvid/git-cola that referenced this issue Mar 8, 2018
The diff viewer can now display images.

Ideas for improvement:
- side by side image diffs
- a, b hotkeys to quickly swap between old and new
- overlayed alpha blend diffs
- actual image diff ~ D = (B - A) * pow(e, gamma)

Closes git-cola#444
Suggested-by: Martin Konecny <martin.konecny@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
davvid added a commit to davvid/git-cola that referenced this issue Mar 8, 2018
This command gathers images from git and emits notification.

Related-to: git-cola#444
Signed-off-by: David Aguilar <davvid@gmail.com>
davvid added a commit to davvid/git-cola that referenced this issue Mar 8, 2018
Teach the Viewer to respond to notifications about the diff type and
images to display.

Related-to: git-cola#444
Signed-off-by: David Aguilar <davvid@gmail.com>
davvid added a commit to davvid/git-cola that referenced this issue Mar 8, 2018
Refactor how the commands are generated when responding to selection
changes.  This refactoring introduces the use of the DiffImage command.

By calling DiffImage we prepare image files that are displayed by image
diff viewer.  Future commits will add composite modes for inspecting
image diffs.

Related-to: git-cola#444
Signed-off-by: David Aguilar <davvid@gmail.com>
davvid added a commit to davvid/git-cola that referenced this issue Mar 8, 2018
Add a side-by-side image diff viewer.  Display a lineup of the old and
new images when navigating the staged, unmerged, and modified files.

Next we can add a single-image pixel diff.

Closes git-cola#444
Signed-off-by: David Aguilar <davvid@gmail.com>
@davvid
Copy link
Member

davvid commented Mar 8, 2018

I have a prototype in the works in case anyone wants to test an early version. It should be closer to what'll ship in master by this weekend, but until then experimental versions are in my fork's imagediff branch.

davvid added a commit to davvid/git-cola that referenced this issue Mar 8, 2018
This command gathers images from git and emits notification.

Related-to: git-cola#444
Signed-off-by: David Aguilar <davvid@gmail.com>
davvid added a commit to davvid/git-cola that referenced this issue Mar 8, 2018
Teach the Viewer to respond to notifications about the diff type and
images to display.

Related-to: git-cola#444
Signed-off-by: David Aguilar <davvid@gmail.com>
davvid added a commit to davvid/git-cola that referenced this issue Mar 8, 2018
Refactor how the commands are generated when responding to selection
changes.  This refactoring introduces the use of the DiffImage command.

By calling DiffImage we prepare image files that are displayed by image
diff viewer.  Future commits will add composite modes for inspecting
image diffs.

Related-to: git-cola#444
Signed-off-by: David Aguilar <davvid@gmail.com>
davvid added a commit to davvid/git-cola that referenced this issue Mar 8, 2018
Add a side-by-side image diff viewer.  Display a lineup of the old and
new images when navigating the staged, unmerged, and modified files.

Next we can add a single-image pixel diff.

Closes git-cola#444
Signed-off-by: David Aguilar <davvid@gmail.com>
davvid added a commit to davvid/git-cola that referenced this issue Mar 8, 2018
This command gathers images from git and emits notification.

Related-to: git-cola#444
Signed-off-by: David Aguilar <davvid@gmail.com>
davvid added a commit to davvid/git-cola that referenced this issue Mar 8, 2018
Teach the Viewer to respond to notifications about the diff type and
images to display.

Related-to: git-cola#444
Signed-off-by: David Aguilar <davvid@gmail.com>
davvid added a commit to davvid/git-cola that referenced this issue Mar 8, 2018
Refactor how the commands are generated when responding to selection
changes.  This refactoring introduces the use of the DiffImage command.

By calling DiffImage we prepare image files that are displayed by image
diff viewer.  Future commits will add composite modes for inspecting
image diffs.

Related-to: git-cola#444
Signed-off-by: David Aguilar <davvid@gmail.com>
davvid added a commit to davvid/git-cola that referenced this issue Mar 8, 2018
Add a side-by-side image diff viewer.  Display a lineup of the old and
new images when navigating the staged, unmerged, and modified files.

Next we can add a single-image pixel diff.

Closes git-cola#444
Signed-off-by: David Aguilar <davvid@gmail.com>
davvid added a commit to davvid/git-cola that referenced this issue Mar 8, 2018
Add an image diff mode that shows a pixel-level diff.

Related-to: git-cola#444
Signed-off-by: David Aguilar <davvid@gmail.com>
davvid added a commit to davvid/git-cola that referenced this issue Mar 8, 2018
Related-to: git-cola#444
Signed-off-by: David Aguilar <davvid@gmail.com>
davvid added a commit to davvid/git-cola that referenced this issue Mar 8, 2018
Add an integrated image diff viewer to the diff tool.

* imagediff: (33 commits)
  imageview: dial down the mousewheel zoom
  diff: never give the imageview widget focus
  doc/relnotes: update v3.1 release notes draft
  main: save and restore the image diff mode
  diff: add a pixel diff mode
  archive: use qtutils.combo()
  qtutils: add a combo() helper function
  diff: add side-by-side image diffing
  diff: remove intermediate widget
  diff: refactor out an Options widget
  diff: simplify imports
  branch: move the titlebar dependency into the parent
  status: make the search order consistent
  status: refactor selection changes to allow image diffs
  diff: respond to diff_type_changed and images_changed messages
  cmds: add a DiffImage command to diff images
  utils: allow specifying a suffix in tmp_filename()
  models: add an "images" attribute to the main model
  cmds: add "diff_type" to the model
  gitcmds: add a constant for the missing blob sha1
  ...

Closes git-cola#444
Suggested-by: Martin Konecny <martin.konecny@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
@davvid davvid closed this as completed in cd88add Mar 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants