implement base of image picker
This commit is contained in:
@@ -10,7 +10,9 @@ Pod::Spec.new do |s|
|
||||
s.static_framework = true
|
||||
|
||||
s.dependency 'ExpoModulesCore'
|
||||
|
||||
s.dependency 'SDWebImage', '~> 5.19.1'
|
||||
s.dependency 'SDWebImageWebPCoder', '~> 0.14.6'
|
||||
|
||||
# Swift/Objective-C compatibility
|
||||
s.pod_target_xcconfig = {
|
||||
'DEFINES_MODULE' => 'YES',
|
||||
|
||||
@@ -42,5 +42,9 @@ public class ExpoPlatformInfoModule: Module {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AsyncFunction("isAnimatedImage") { (url: URL) in
|
||||
return ImageInfo.isAnimatedImage(url: url)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// IsAnimatedImage.swift
|
||||
// Pods
|
||||
//
|
||||
// Created by Hailey on 10/27/24.
|
||||
//
|
||||
|
||||
import SDWebImage
|
||||
|
||||
class ImageInfo {
|
||||
static func isAnimatedImage(url: URL) -> Bool {
|
||||
var path: String
|
||||
if #available(iOS 16.0, *) {
|
||||
path = url.path()
|
||||
} else {
|
||||
path = url.path
|
||||
}
|
||||
|
||||
let image = SDAnimatedImage(contentsOfFile: path)
|
||||
return image?.sd_isAnimated ?? false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user