macfeh icon indicating copy to clipboard operation
macfeh copied to clipboard

imageView not resized to image size

Open takeiteasy opened this issue 8 years ago • 10 comments
trafficstars

Sup, when an image is loaded the imageView isn't resizing to the window size, it leaves a massive grey border

I'm terrible with Swift, but I had a look and tried putting

self.imageView.zoomImageToActualSize(self);

From the zoomToActualSize() function at the end of the display() function and that seems to work

I don't know it that's intentional or not, but it doesn't seem like it from the screens

takeiteasy avatar Dec 22 '16 03:12 takeiteasy

No that's not what should be happening at all. Does putting self.zoomToFit(); at the end of display instead of self.imageView.zoomImageToActualSize(self); fix anything?

DrabWeb avatar Dec 22 '16 03:12 DrabWeb

self.zoomToFit(); doesn't change anything, but self.zoomImageToActualSize(); works. I don't know why self.zoomToFit(); doesn't work. Very odd. Here is a screenshot with self.zoomToFit(); the function seems to do nothing http://www.tiikoni.com/tis/view/?id=e2f5c09

takeiteasy avatar Dec 23 '16 12:12 takeiteasy

Could you upload the image? I want to see if I can recreate this issue

DrabWeb avatar Dec 24 '16 03:12 DrabWeb

It happens with all images, maybe it's different version of something? Or because of the scaling of the retina displays? I'm on 10.12.2, 2015 15" MacBook Pro, xcode version 8.2.1

takeiteasy avatar Dec 24 '16 12:12 takeiteasy

Although this maybe a while ago I have the same problem here, although I've seen you already added self.imageView.zoomImageToActualSize(self); at the end of display(). But yet it's still left with the grey scroll borders on the bottom and right sides when viewing 'zoom to fit' for some reason. Super confusing.

GLAlVE avatar May 07 '17 14:05 GLAlVE

I added self.zoomImageToActualSize(); to the end of display() Like this

 // Update the defaults to match the preferences
self.showBackground((NSApp.delegate as! AppDelegate).preferences.viewerDefaultsShowBackground);
self.showShadow((NSApp.delegate as! AppDelegate).preferences.viewerDefaultsEnableShadow);
self.zoomImageToActualSize();

// Set `representedImage`
self.representedImage = image;

That worked for me

takeiteasy avatar May 08 '17 03:05 takeiteasy

i have the same issue only adding the text to the line did nothing, in the log i get this though Unknown Window class (null) in Interface Builder file, creating generic Window instead

oxycantha avatar Jan 10 '18 00:01 oxycantha

that seems to be a bug with the latest version of xcode

https://stackoverflow.com/questions/47051682/unknown-window-class-null-in-interface-builder-file-creating-generic-window-i

tunnels avatar Jan 12 '18 18:01 tunnels

The unknown window class thing is unrelated, I've experienced it in multiple other projects when using Xcode 9.

~~Can anyone else that used the fix posted by @takeiteasy confirm that it's still working for them? Odd that it would work for most but not @oxycantha.~~

Scratch that, working on a proper fix now.

DrabWeb avatar Jan 12 '18 20:01 DrabWeb

Given that the last update on this project was just under two years ago, I have forked it and created a proper fix myself.

If this repository isn't dead please let me know and I will be happy to make a pull request.

Edit: Scratch that, adding a pull request anyway.

ghost avatar Jan 01 '20 18:01 ghost