If anybody needs animated webP support with Expo (Custom Dev Client) for the native <Image />
and <FastImage />
(read comments):
// create a file like plugins/withAnimatedWebPSupport.js -> this is for the native <Image />
const {
import { useEffect, useRef } from "react"; | |
import { View } from "react-native"; | |
import Animated, { | |
useAnimatedStyle, | |
useSharedValue, | |
} from "react-native-reanimated"; | |
// Example | |
export default function App() { |
import React from "react"; | |
import { Dimensions, TextInput, ScrollView } from "react-native"; | |
import Animated, { | |
useAnimatedKeyboard, | |
useAnimatedReaction, | |
runOnJS, | |
KeyboardState, | |
useAnimatedProps, | |
useAnimatedScrollHandler, |
If anybody needs animated webP support with Expo (Custom Dev Client) for the native <Image />
and <FastImage />
(read comments):
// create a file like plugins/withAnimatedWebPSupport.js -> this is for the native <Image />
const {
// DEPRECATED | |
const { | |
withDangerousMod, | |
WarningAggregator, | |
AndroidConfig, | |
withAppBuildGradle, | |
} = require("@expo/config-plugins"); | |
const path = require("path"); | |
const fs = require("fs"); |
// credit to https://gist.github.com/ianmartorell/32bb7df95e5eff0a5ee2b2f55095e6a6 | |
// this file was repurosed from there | |
// via this issue https://gist.github.com/necolas/1c494e44e23eb7f8c5864a2fac66299a | |
// because RNW's pressable doesn't bubble events to parent pressables: https://github.com/necolas/react-native-web/issues/1875 | |
/* eslint-disable no-inner-declarations */ | |
import { canUseDOM } from 'fbjs/lib/ExecutionEnvironment' | |
let isEnabled = false |
// Expo SDK40 | |
// expo-blur: ~8.2.2 | |
// expo-haptics: ~8.4.0 | |
// react-native-gesture-handler: ~1.8.0 | |
// react-native-reanimated: ^2.0.0-rc.0 | |
// react-native-safe-area-context: 3.1.9 | |
import React, { useState } from 'react'; | |
import { | |
Image, |
// Based on: https://stackoverflow.com/a/46814952/283851 | |
/** | |
* Create a Base64 Image URL, with rotation applied to compensate for EXIF orientation, if needed. | |
* | |
* Optionally resize to a smaller maximum width - to improve performance for larger image thumbnails. | |
*/ | |
export async function getImageUrl(file: File, maxWidth: number|undefined) { | |
return readOrientation(file).then(orientation => applyRotation(file, orientation || 1, maxWidth || 999999)); | |
} |
<?php | |
/** | |
* @author Atanas Vasilev | |
* @link http://pastebin.com/dHbqjUNy | |
*/ | |
define('STR_BOM', "\xEF\xBB\xBF"); | |
$file = null; | |
$directory = getcwd(); |