Comments (5)
I played with the library a bit.
By replacing
imgWidth = (imageWidth > imageHeight && contHeight >= contWidth) || ratio * contHeight > contWidth ? contWidth : ratio * contHeight;
with
// Don't stretch images to fill the container
imgWidth = imageWidth;
I get the wanted effect, which is the image showing up at it's native size or zoomed in if a parameter was passed.
Next is the snap view:
- The image needs to be resized to match its position in the container (calculate cont/img ratio and crop to snap view)
- When zooming, the image needs to grow to fill the container, like it is in the main view
- Once the image in the main view is larger than the container, then the snap handle should show
from iv-viewer.
That part of code is required to contain image inside container, changing that may affect on other modes.
I am out town for few days . Will be fixing once i am back.
from iv-viewer.
Yeah, I've noticed that the fullscreen mode has the same problem where images will be stretched to fit.
Just ping me when you're back and have time to work on this :).
from iv-viewer.
Any news? :)
from iv-viewer.
So In ImageViewer now it behaves as backgound-size contain for a given container. And whatever size is coming at that point I am considering it as 100% zoom, which literally is not correct.
There are multiple problems which needs to be figured if image actual dimension to be considered as 100% zoom with current code.
- Right now only it can be zoomed when mouse is above image and not the container. But if we take the actual size of image it should happen on container as well.
- Zoom level can go below 100 when image actual dimension are greater that container, so minimum cap of 100 need to be removed which requires changes in lot of place.
- Need to figure out how to display snapview if zoom level is below 100% .
from iv-viewer.
Related Issues (20)
- pan/slide API HOT 1
- NPM doesn't have latest version HOT 3
- add "zoomPoint" parameter to init options HOT 1
- Angular 9 Update Issue - Already being initiated HOT 1
- How to detect a load failed / 404 event HOT 1
- White background during hi-res image loading in Firefox
- Uncaught ReferenceError: FullScreenViewer is not defined HOT 2
- jquery.min.js:2 Uncaught TypeError: Cannot read property '_imageViewer' of undefined HOT 2
- Hi res image shrink to a small dimension after loading on Android device HOT 1
- EXIF Image orientation
- Possible to make snapView appear on mouseenter?
- Image pixelated
- Spelling error in README.md
- Canvas support? HOT 4
- Image hops on zoom
- Image doesn't render correctly in Safari
- problem with IE
- Scroll doesn't work on mobile devices HOT 1
- Add tutorial to README.md on how to pass in **Options** variables
- how i can add custom zoom in and zoom out functionality HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iv-viewer.