social.plus provides comprehensive image handling capabilities with automatic optimization, multiple format support, and accessibility features. This guide covers everything from basic uploads to advanced image processing workflows.
Image Limits: Maximum file size is 100MB per image. Supported formats: JPEG, PNG, GIF, WebP with automatic optimization and multi-resolution generation.

Key Features

Automatic Optimization

Multi-resolution generation with smart compression maintaining visual quality

Accessibility Support

Alt text and metadata for inclusive user experiences

Real-time Processing

Instant thumbnails and progressive loading

Global CDN Delivery

Fast delivery worldwide with automatic format conversion

Image Properties

Each uploaded image contains comprehensive metadata and multiple optimized versions:

Available Image Sizes

social.plus automatically generates optimized versions for different use cases:

Small (160px)

Perfect for thumbnails and grid previews

Medium (600px)

Standard content display and feeds

Large (1500px)

Full-screen viewing and detailed inspection

Original

Unprocessed high-resolution version

Image Upload

Upload images with automatic optimization, compression, and accessibility features. The SDK handles format conversion and generates multiple resolutions automatically.
The upload process includes real-time progress tracking and automatic error handling for a smooth user experience.
func uploadImage(image: UIImage) async {
    do {
        let image = try await fileRepository.uploadImage(image, altText: "<optional-alt-text>", progress: { progress in
            print("upload progress: \(progress)")
        })
        print("finish uploading successfully: fileId \(String(describing: image.fileId))")
    } catch {
        // Handle error here
    }
}

Image Retrieval & Optimization

Retrieve images in the optimal size for your use case. social.plus automatically generates multiple resolutions for efficient loading and bandwidth optimization.
Always choose the appropriate image size for your container to optimize loading performance and user experience.

let fileRepository = AmityFileRepository(client: client)

do {
    // Get AmityRawFile
    let rawFile = try await fileRepository.getFile(fileId: "<image-file-id>")
    
    // Transform AmityRawFile to specific AmityImageData.
    // If AmityRawFile is not the type `image`, it will return nil.
    if rawFile.type == .image {
        guard let imageData = rawFile.mapToImageData() else {
            return
        }
        
        // Download the image by using downloadImage api or
        // You can use any network client to download the image.
        fileRepository.downloadImage(fromURL: imageData.fileURL, size: .medium, completion: { path, error in
            print("Image downloaded to local path: \(path)")
        })
    }
} catch {
    // Handle error here
}

Troubleshooting

Common Image Issues

Next Steps