Ticket #486 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

The image opened is very small

Reported by: erikos Owned by: sayamindu
Priority: Unspecified by Maintainer Milestone: 0.84
Component: Imageviewer Version: 0.84.x
Severity: Blocker Keywords: r+
Cc: Distribution/OS: Unspecified
Bug Status: New

Description

- take a screenshot
- open it in Imageviewer
- it is very small
- is full canvas in Browse

Change History

Changed 4 years ago by erikos

  • version changed from Unspecified to 0.84.x

Changed 4 years ago by erikos

  • status_field changed from Unconfimed to New
  • milestone changed from Unspecified by Release Team to 0.84

So the width and height of the canvas are reported to be very small. So the image is zoomed down to fit. It happens as well, only when opening the image directly - not when using the object chooser dialog.

Looks like introduced by #428

Changed 4 years ago by tomeu

This seems to work fine:

diff --git a/ImageViewerActivity.py b/ImageViewerActivity.py
index b72d617..91de299 100644
--- a/ImageViewerActivity.py
+++ b/ImageViewerActivity.py
@@ -93,13 +93,17 @@ class ImageViewerActivity(activity.Activity):
             'tmp%i' % time.time())
        
         os.link(file_path, tempfile)
-        
-        self.view.set_file_location(tempfile)
+        gobject.idle_add(self.__set_file_idle_cb, tempfile)
+
+    def __set_file_idle_cb(self, file_path):
+        self.view.set_file_location(file_path)
 
         self.zoom = int(self.metadata.get('zoom', '0'))
         if self.zoom > 0:
             self.view.set_zoom(self.zoom)
 
+        return True
+
     def write_file(self, file_path):
         self.metadata['zoom'] = str(self.zoom)
 

Changed 4 years ago by tomeu

  • keywords r? added

Changed 4 years ago by sayamindu

  • keywords r+ added; r? removed

Patch looks good. Please commit.

Changed 4 years ago by sayamindu

  • status changed from new to closed
  • resolution set to fixed

Ok, committed to master and cherry-picked to 0.84. Closing this. Thanks to Tomeu for stepping in and fixing this.

Note: See TracTickets for help on using tickets.