GithubHelp home page GithubHelp logo

Image for native not shown when using SolitoImage with source from expo-image-picker (web works fine) ; ImageBackground query and Nextjs issue (Image... has either width or height modified, but not the other ) about solito HOT 4 OPEN

ammarfaris avatar ammarfaris commented on June 30, 2024
Image for native not shown when using SolitoImage with source from expo-image-picker (web works fine) ; ImageBackground query and Nextjs issue (Image... has either width or height modified, but not the other )

from solito.

Comments (4)

ammarfaris avatar ammarfaris commented on June 30, 2024

okay actually the Versions section got me thinking that my Solito version is quite old; so I upgraded to the latest Solito of 4.2.0 and now it works as expected ; one issue down

While I am at this, I have two questions @nandorojo :

  1. I saw that expo-image has ImageBackground implementation to mimick https://reactnative.dev/docs/imagebackground ; does SolitoImage also implements ImageBackground ? if so, how can i access it / have similar implementation ? not sure if there is a nextjs-image equivalent or not

  2. Nextjs issue (Image... has either width or height modified, but not the other )

Looking at this similar issue (see comments in link) => vercel/next.js#40762 ; is there a workaroud when using SolitoImage so that i don't have to add style={{ width: 400, height: 400 }} like below:

            <SolitoImage
                src={`data:image/;base64,${pickedImage.base64}`}
                height={400}
                width={400}
                // code below needed https://github.com/vercel/next.js/issues/40762
                style={{ width: 400, height: 400, marginTop: 10 }}
                alt="picked image"

            />

from solito.

nandorojo avatar nandorojo commented on June 30, 2024

Try the unoptimized prop.

from solito.

ammarfaris avatar ammarfaris commented on June 30, 2024

Try the unoptimized prop.

I tried adding unoptimized but still got the same error below:

Image with src
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgQAAAFfCAYAAAAxo
9Q/AAABXWlDQ1BJQ0MgUHJvZmlsZQAAKJF1kMFKAlEUhv8xTbKBXEhBRMwqCExEW......
v/HX+nfDd6ioD5P//SlU+68/vf5cAAAAASUVORK5CYII=" has either width or height modified, but not the other. 
If you use CSS to change the size of your image, 
also include the styles 'width: "auto"' or 'height: "auto"' to maintain the aspect ratio.

Is it related to vercel/next.js#40762 somehow?

As for my question number 1 ; Does Solito have ImageBackground component implementation?

Because we can technically do import { ImageBackground } from 'expo-image' ; but maybe for nextjs we need to adjust Image to have {children} component overlay on top of it

from solito.

nandorojo avatar nandorojo commented on June 30, 2024

Rather than ImageBackground, you can simply pass fill={true} and render it before the items it should go behind.

from solito.

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.