react-native-fast-image icon indicating copy to clipboard operation
react-native-fast-image copied to clipboard

Fixed graphics context allocation issue

Open aman32767 opened this issue 1 year ago • 12 comments

Title: Resolved Graphics Context Allocation Issue

Description:

Proposed Changes This PR resolves an issue pertaining to graphics context allocation in the FFFastImageViewManager. The previous implementation utilized older graphics context handling methods, which could potentially lead to errors. This PR updates the code to leverage the newer UIGraphicsImageRenderer API, mitigating any context allocation problems.

Changes Made

  • Updated FFFastImageViewManager.m to utilize UIGraphicsImageRenderer for managing image context.
  • Eliminated manual handling of context creation and cleanup, reducing the likelihood of errors.

Graphics Context Handling: It now employs UIGraphicsImageRenderer, a more modern API introduced in iOS 10. This API handles the creation, rendering, and cleanup of the image context automatically.

Renderer Usage: It now creates a UIGraphicsImageRenderer object (renderer) and employs it to execute the drawing operations.

Error Handling: It leverages a more modern API that is less susceptible to context allocation errors.

This PR addresses: #1006

aman32767 avatar Sep 25 '23 13:09 aman32767

Works well for me on iOS 17

AdamGerthel avatar Sep 25 '23 14:09 AdamGerthel

Working fine on iOS 17. Thanks

MuhammadMuzammilQadri avatar Sep 26 '23 09:09 MuhammadMuzammilQadri

@DylanVann Please merge

johanholm avatar Sep 27 '23 08:09 johanholm

someone please tell me how to install this pull by npm

fukemy avatar Oct 07 '23 03:10 fukemy

someone please tell me how to install this pull by npm

You can apply a patch, see https://github.com/DylanVann/react-native-fast-image/issues/1002#issuecomment-1742663000

AdamGerthel avatar Oct 07 '23 08:10 AdamGerthel

@AdamGerthel I already have a patch applied for fast image in podsec file. Can u tell how can we apply multiple patches to same lib ?

mohitarora777 avatar Oct 10 '23 07:10 mohitarora777

@AdamGerthel I already have a patch applied for fast image in podsec file. Can u tell how can we apply multiple patches to same lib ?

I don't understand exactly what you mean by "I already have a patch applied for fast image in podsec file" - could you be a bit more specific? If you want to understand how to apply a patch for an npm package, the best way is to read the usage instructions for patch-package.

AdamGerthel avatar Oct 10 '23 07:10 AdamGerthel

Got it thanx @AdamGerthel

mohitarora777 avatar Oct 10 '23 07:10 mohitarora777

Thank you for this!

Strate avatar Nov 09 '23 13:11 Strate

@DylanVann please, man, merge this.

hadnet avatar Jan 14 '24 02:01 hadnet

@DylanVann please, merge this.

Nazim-hasan avatar May 30 '24 07:05 Nazim-hasan

having the same issue in flutter, how can we solve that?

youssefalaaramadan avatar Jul 28 '24 07:07 youssefalaaramadan