Code Monkey home page Code Monkey logo

Comments (6)

saschb2b avatar saschb2b commented on August 11, 2024

@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.

leMaik avatar leMaik commented on August 11, 2024

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.

DmitryNakhimovich avatar DmitryNakhimovich commented on August 11, 2024

@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.

saschb2b avatar saschb2b commented on August 11, 2024

But this only works with local image not with external ones linked via url if I understand that right

from material-ui-image.

DmitryNakhimovich avatar DmitryNakhimovich commented on August 11, 2024

@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.

saschb2b avatar saschb2b commented on August 11, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.