public static function storeImagesToLocalFile($imageSrcs, bool $returnAll, Configuration $config): array {
        $localImages = self::handleEntity($imageSrcs, $returnAll, $config);

        if (empty($localImages)) {
            return [];
        }

        $locallyStoredImages = [];

        foreach ($localImages as $localImage) {
            if (empty($localImage->file) || !filesize($localImage->file)) {
                continue;
            }

            $imageDetails = self::getImageDimensions($localImage->file);

            if ($imageDetails !== null) {
                $locallyStoredImages[] = new LocallyStoredImage([
                    'imgSrc' => $localImage->url,
                    'localFileName' => $localImage->file,
                    'bytes' => filesize($localImage->file),
                    'height' => $imageDetails->height,
                    'width' => $imageDetails->width,
                    'fileExtension' => self::getFileExtensionName($imageDetails),
                ]);
            }
        }

        return $locallyStoredImages;
    }
public static function storeImagesToLocalFile($imageSrcs, bool $returnAll, Configuration $config): array {
        $localImages = self::handleEntity($imageSrcs, $returnAll, $config);

        if (empty($localImages)) {
            return [];
        }

        $locallyStoredImages = [];

        foreach ($localImages as $localImage) {
            if (empty($localImage->file) || !filesize($localImage->file)) {
                continue;
            }

            $imageDetails = self::getImageDimensions($localImage->file);

            if ($imageDetails !== null) {
                $locallyStoredImages[] = new LocallyStoredImage([
                    'imgSrc' => $localImage->url,
                    'localFileName' => $localImage->file,
                    'bytes' => filesize($localImage->file),
                    'height' => $imageDetails->height,
                    'width' => $imageDetails->width,
                    'fileExtension' => self::getFileExtensionName($imageDetails),
                ]);
            }
        }

        return $locallyStoredImages;
    }
public static function storeImagesToLocalFile ( $ imageSrcs , bool $ returnAll , Configuration $ config ) : array { $ localImages = self :: handleEntity ( $ imageSrcs , $ returnAll , $ config ) ; if ( empty ( $ localImages ) ) { return [ ] ; } $ locallyStoredImages = [ ] ; foreach ( $ localImages as $ localImage ) { if ( empty ( $ localImage -> file ) || ! filesize ( $ localImage -> file ) ) { continue ; } $ imageDetails = self :: getImageDimensions ( $ localImage -> file ) ; if ( $ imageDetails !== null ) { $ locallyStoredImages [ ] = new LocallyStoredImage ( [ 'imgSrc' => $ localImage -> url , 'localFileName' => $ localImage -> file , 'bytes' => filesize ( $ localImage -> file ) , 'height' => $ imageDetails -> height , 'width' => $ imageDetails -> width , 'fileExtension' => self :: getFileExtensionName ( $ imageDetails ) , ] ) ; } } return $ locallyStoredImages ; }
Writes an image src http string to disk as a temporary file and returns the LocallyStoredImage object that has the info you should need
on the image

@param string[] $imageSrcs
@param bool $returnAll
@param Configuration $config

@return LocallyStoredImage[]
Writes an image src http string to disk as a temporary file and returns the LocallyStoredImage object that has the info you should need on the image