gl-react icon indicating copy to clipboard operation
gl-react copied to clipboard

Is it possible to apply transformations/filtering without rendering component

Open Orxcle-xx opened this issue 7 years ago • 4 comments

Hi,

Lets suppose I have an uri to a local file and/or base64 of an image.

I want to apply contrast / saturation / brightness transformation to the image without showing anything to the user and then save it to Camera Roll.

Basically, I want to do something with a Surface without rendering Surface.

Is it possible?

P.S I will show the results of the transformation to the user, but using another library: https://github.com/iyegoroff/react-native-color-matrix-image-filters As gl-react is unable to show my image in a proper angle ( it gets rotated ). So that's why I am looking for a hack.

Thank you in advance.

Best Regards

Orxcle-xx avatar Dec 04 '18 18:12 Orxcle-xx

Have you tried hiding it from the user by rendering it off the screen?

superandrew213 avatar Dec 04 '18 22:12 superandrew213

As @superandrew213 suggested hiding the element or wrapping it in a div with display: 'none' should be enough for the hack you are after.

Sounds like it would be easier to simply rotate the image however. Using a different lib for the sole purpose of displaying a filtered image seems counter-intuitive, particularly because for example, the same value for saturation may not render the same result in both libs.

brysonandrew avatar Jan 15 '19 12:01 brysonandrew

@Orxcle-xx I would like to update my comment, as the rotation of the image is likely due to the image size, try and resize the image by half. For some reason when the image is too big ~3000 - 4000px it gets rotated. I had the same issue.

brysonandrew avatar Mar 13 '19 22:03 brysonandrew

Be carefull with JPEG images, check if there are some strange exif orientation in the metadata. I got some weird similar problems like your.

b3nab avatar Jun 30 '19 19:06 b3nab