Closed pkrinesh closed 1 year ago
Fixed, Try now
Yes, It is working. Thank you.
Again, when pass imageSrcProps = window.URL.createObjectURL(file)
it changes its format to .jpeg
. And passing a file directly does not work as it only accepts string
. Is there another way?
No from the moment. The imgSrcProp only accepts the string url of the img. It's designed to support when you load a image from your backend or from the web. But you always can fork the project an provide a solution to address your problem as a PR
I have an Array of images to edit on Click of a image I need to open the image with image-editor. but it is not working it is only pointing to the 1st clicked image regardless of the state change I am doing
Please provide the code to see the state management that you are performing. Without the code I cannot help you
consider this simple code my image is changing with state but editor image is not changing
import logocar from "../image/Teams-Leader_Eric-Barnes.webp"; import logocar2 from "../image/logo_car.png"
const [check,setCheck]=useState(logocar)
<button onClick={()=>setCheck(logocar2)}>Change Click</button>
<img src={check}/>
<ReactImagePickerEditor config={config2} imageSrcProp={check} imageChanged={(newDataUri) => setImageSrc(newDataUri)} />
And what is the issue related to ?
And what is the issue related to ?
The issue is relate to react-image-picker-editor is somehow keeping the previous state value which is given at 1st
Ok I will have a look at it
Done, here in the demo it put exacly your kind of example https://react-image-picker-editor.surge.sh/
Can I get the code base of it It look's some what to my scenario?
I have updated the package, first update the npm package, then just fork the project from GitHub, but you only have to update the package and it will work when you change the initial image
Thanks Man It Worked!
Leave a ⭐ and share it. That helps me 🚀🚀🚀
According to the source code, Quality is aggressively set to 92 when
imageSrcProp
is provided and not be able to set viaconfig.compressInitial
. But forimageSrcProps = ""
we can set quality byconfig.compressInitial
.