Skip to content

How to read .heic image? #1389

Answered by jinookoo
hungtooc asked this question in Q&A
Feb 24, 2023 · 3 comments · 1 reply
Discussion options

You must be logged in to vote

It's temporary solutions
If you convert image format to jpeg
It works

import {Skia, ImageShader, SkImage, DataSourceParam, useImage} from '@shopify/react-native-skia';
import {SaveFormat, manipulateAsync} from 'expo-image-manipulator';
import {useEffect, useState} from 'react';

import {useCanvasStore} from './context/canvas';

type Props = {
  file: DataSourceParam;
};
export const NextImage = ({file}: Props) => {
  const {width, height} = useCanvasStore();
  const defaultImage = useImage(file);
  const [image, setImage] = useState<SkImage>(defaultImage);
  useEffect(() => {
    if (!defaultImage && typeof file === 'string') {
      manipulateAsync(file, [], {
        compress: 0.8,

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@hungtooc
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by hungtooc
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants