This project provides a React Native package for building optimized image URLs using ImageEngine. It includes utility functions and components to handle responsive images efficiently.
npm install imageengine-reactnative
-
generateOptimizedImageUrl
: Constructs an optimized image URL based on the providedsrcSet
,deliveryAddress
, and other parameters. -
chooseAppropriateImage
: Selects the best image from asrcSet
that fits the available screen width. -
processUrl
: Cleans up the URL by removing unwanted parts and checks for supported image formats. -
constructUrl
: Builds the final image URL using the provided source and directives.
-
ResponsiveImage
: A React component that renders an image optimized for the current screen size. It usesgenerateOptimizedImageUrl
to determine the best image URL to use.
-
App
: Demonstrates the usage of theResponsiveImage
component with a predefinedsrcSet
. It logs when the component is rendered and displays a sample image.
-
IEFormat
: Enum for supported image formats. -
IEFit
: Enum for image fit options. -
IEDirectives
: Class defining image transformation directives.