Comments (6)
@DmitryNakhimovich Currently you can only pass a certain aspectRatio
that you have to define. There is no built in feature for auto-detecting this, yet. I used this component for quite a while now and also think this would be a good idea. We would love to have a PR on that
from material-ui-image.
How are we going to detect the aspect ratio from an image that isn't even loaded yet? 🤔 If we do that, the component size would "jump" after loading.
from material-ui-image.
@leMaik This can be achieved by turning on the 'require'. It is possible to set additional props like 'width' and 'height' by default. I'm not sure, but the capabilities of webpack may solve this problem.
Take a look at this article: https://stackoverflow.com/questions/42118296/dynamically-import-images-from-a-directory-using-webpack#_=_
from material-ui-image.
But this only works with local image not with external ones linked via url if I understand that right
from material-ui-image.
@saschb2b Unfortunately yes, you are right. This is possible only for local files( because we will not be able to find out any information about the picture without receiving it. Probably further development of this topic is not yet possible.
from material-ui-image.
@DmitryNakhimovich then I will close this for now. This magic would be super cool if we can implement it. Reopen if you think you've got an idea on how to solve this issue with local and or external images. I will also think about this more
from material-ui-image.
Related Issues (20)
- Support Lazy loading attribute HOT 1
- Image doesn't display if rendered as a child of a flex
- Image alt text for accessibility requirements HOT 4
- Incompatible with Gatsby Build. HOT 1
- There should be an prop option to whether to stretch the image or not. HOT 2
- Event is not passed to onLoad or onError props handler HOT 1
- Support styling with withStyles() hook.
- Brightness and Saturation filters and transitions don't appear to work HOT 2
- Incorrect exclusion of "ref" prop in TypeScript types HOT 1
- Massive Div Below the Image Import HOT 2
- Sometimes my image doesn't load HOT 9
- Incorrect ImageProps extension of ImgHTMLAttributes HOT 2
- css background support HOT 2
- Console error: React does not recognize the `iconContainerStyle` prop on a DOM element
- No alt text attribute? HOT 2
- React 17+ needs to be supported HOT 2
- Bug if Image as a child of Button component
- Resizing the image HOT 2
- Can you please support Martial UI v5? HOT 10
- Add support for automatic aspect ratio detection HOT 4
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 material-ui-image.