AlamofireImage is an image component library for Alamofire

Related tags

Image AlamofireImage
Overview

AlamofireImage

Build Status CocoaPods Compatible Carthage Compatible Platform Twitter Gitter

AlamofireImage is an image component library for Alamofire.

Features

  • Image Response Serializers
  • UIImage Extensions for Inflation / Scaling / Rounding / CoreImage
  • Single and Multi-Pass Image Filters
  • Auto-Purging In-Memory Image Cache
  • Prioritized Queue Order Image Downloading
  • Authentication with URLCredential
  • UIImageView Async Remote Downloads with Placeholders
  • UIImageView Filters and Transitions
  • Comprehensive Test Coverage
  • Complete Documentation

Requirements

  • iOS 10.0+ / macOS 10.12+ / tvOS 10.0+ / watchOS 3.0+
  • Xcode 11+
  • Swift 5.1+

Migration Guides

Dependencies

Communication

  • If you need to find or understand an API, check our documentation.
  • If you need help with an AlamofireImage feature, use our forum on swift.org.
  • If you'd like to discuss AlamofireImage best practices, use our forum on swift.org.
  • If you'd like to discuss a feature request, use our forum on swift.org.
  • If you found a bug, open an issue and follow the guide. The more detail the better!
  • If you want to contribute, submit a pull request.

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate AlamofireImage into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'AlamofireImage', '~> 4.1'

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To integrate AlamofireImage into your Xcode project using Carthage, specify it in your Cartfile:

github "Alamofire/AlamofireImage" ~> 4.1

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. It is in early development, but AlamofireImage does support its use on supported platforms.

Once you have your Swift package set up, adding AlamofireImage as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "https://github.com/Alamofire/AlamofireImage.git", .upToNextMajor(from: "4.2.0"))
]

Manually

If you prefer not to use either of the aforementioned dependency managers, you can integrate AlamofireImage into your project manually.

Embedded Framework

  • Open up Terminal, cd into your top-level project directory, and run the following command "if" your project is not initialized as a git repository:
$ git init
  • Add AlamofireImage as a git submodule by running the following command:
$ git submodule add https://github.com/Alamofire/AlamofireImage.git
  • Open the new AlamofireImage folder, and drag the AlamofireImage.xcodeproj into the Project Navigator of your application's Xcode project.

    It should appear nested underneath your application's blue project icon. Whether it is above or below all the other Xcode groups does not matter.

  • Select the AlamofireImage.xcodeproj in the Project Navigator and verify the deployment target matches that of your application target.

  • Next, select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the "Targets" heading in the sidebar.

  • In the tab bar at the top of that window, open the "General" panel.

  • Click on the + button under the "Embedded Binaries" section.

  • You will see two different AlamofireImage.xcodeproj folders each with two different versions of the AlamofireImage.framework nested inside a Products folder.

    It does not matter which Products folder you choose from, but it does matter whether you choose the top or bottom AlamofireImage.framework.

  • Select the top AlamofireImage.framework for iOS and the bottom one for OS X.

    You can verify which one you selected by inspecting the build log for your project. The build target for AlamofireImage will be listed as either AlamofireImage iOS, AlamofireImage macOS, AlamofireImage tvOS or AlamofireImage watchOS.

  • And that's it!

    The AlamofireImage.framework is automagically added as a target dependency, linked framework and embedded framework in a copy files build phase which is all you need to build on the simulator and a device.


Usage

Image Response Serializers

import Alamofire
import AlamofireImage

AF.request("https://httpbin.org/image/png").responseImage { response in
	debugPrint(response)

	print(response.request)
	print(response.response)
	debugPrint(response.result)

    if case .success(let image) = response.result {
		print("image downloaded: \(image)")
	}
}

The AlamofireImage response image serializers support a wide range of image types including:

  • image/png
  • image/jpeg
  • image/tiff
  • image/gif
  • image/ico
  • image/x-icon
  • image/bmp
  • image/x-bmp
  • image/x-xbitmap
  • image/x-ms-bmp
  • image/x-win-bitmap
  • image/heic
  • application/octet-stream (added for iOS 13 support)

If the image you are attempting to download is an invalid MIME type not in the list, you can add custom acceptable content types using the addAcceptableImageContentTypes extension on the DataRequest type.

UIImage Extensions

There are several UIImage extensions designed to make the common image manipulation operations as simple as possible.

Inflation

let url = Bundle.main.url(forResource: "unicorn", withExtension: "png")!
let data = try! Data(contentsOf: url)
let image = UIImage(data: data, scale: UIScreen.main.scale)!

image.af.inflate()

Inflating compressed image formats (such as PNG or JPEG) in a background queue can significantly improve drawing performance on the main thread.

Scaling

let image = UIImage(named: "unicorn")!
let size = CGSize(width: 100.0, height: 100.0)

// Scale image to size disregarding aspect ratio
let scaledImage = image.af.imageScaled(to: size)

// Scale image to fit within specified size while maintaining aspect ratio
let aspectScaledToFitImage = image.af.imageAspectScaled(toFit: size)

// Scale image to fill specified size while maintaining aspect ratio
let aspectScaledToFillImage = image.af.imageAspectScaled(toFill: size)

Rounded Corners

let image = UIImage(named: "unicorn")!
let radius: CGFloat = 20.0

let roundedImage = image.af.imageRounded(withCornerRadius: radius)
let circularImage = image.af.imageRoundedIntoCircle()

Core Image Filters

let image = UIImage(named: "unicorn")!

let sepiaImage = image.af.imageFiltered(withCoreImageFilter: "CISepiaTone")

let blurredImage = image.af.imageFiltered(
    withCoreImageFilter: "CIGaussianBlur",
    parameters: ["inputRadius": 25]
)

Image Filters

The ImageFilter protocol was designed to make it easy to apply a filter operation and cache the result after an image finished downloading. It defines two properties to facilitate this functionality.

public protocol ImageFilter {
    var filter: Image -> Image { get }
    var identifier: String { get }
}

The filter closure contains the operation used to create a modified version of the specified image. The identifier property is a string used to uniquely identify the filter operation. This is useful when adding filtered versions of an image to a cache. All identifier properties inside AlamofireImage are implemented using protocol extensions.

Single Pass

The single pass image filters only perform a single operation on the specified image.

let image = UIImage(named: "unicorn")!
let imageFilter = RoundedCornersFilter(radius: 10.0)

let roundedImage = imageFilter.filter(image)

The current list of single pass image filters includes:

  • ScaledToSizeFilter - Scales an image to a specified size.
  • AspectScaledToFitSizeFilter - Scales an image from the center while maintaining the aspect ratio to fit within a specified size.
  • AspectScaledToFillSizeFilter - Scales an image from the center while maintaining the aspect ratio to fill a specified size. Any pixels that fall outside the specified size are clipped.
  • RoundedCornersFilter - Rounds the corners of an image to the specified radius.
  • CircleFilter - Rounds the corners of an image into a circle.
  • BlurFilter - Blurs an image using a CIGaussianBlur filter with the specified blur radius.

Each image filter is built ontop of the UIImage extensions.

Multi-Pass

The multi-pass image filters perform multiple operations on the specified image.

let image = UIImage(named: "avatar")!
let size = CGSize(width: 100.0, height: 100.0)
let imageFilter = AspectScaledToFillSizeCircleFilter(size: size)

let avatarImage = imageFilter.filter(image)

The current list of multi-pass image filters includes:

  • ScaledToSizeWithRoundedCornersFilter - Scales an image to a specified size, then rounds the corners to the specified radius.
  • AspectScaledToFillSizeWithRoundedCornersFilter - Scales an image from the center while maintaining the aspect ratio to fit within a specified size, then rounds the corners to the specified radius.
  • ScaledToSizeCircleFilter - Scales an image to a specified size, then rounds the corners into a circle.
  • AspectScaledToFillSizeCircleFilter - Scales an image from the center while maintaining the aspect ratio to fit within a specified size, then rounds the corners into a circle.

Image Cache

Image caching can become complicated when it comes to network images. URLCache is quite powerful and does a great job reasoning through the various cache policies and Cache-Control headers. However, it is not equipped to handle caching multiple modified versions of those images.

For example, let's say you need to download an album of images. Your app needs to display both the thumbnail version as well as the full size version at various times. Due to performance issues, you want to scale down the thumbnails to a reasonable size before rendering them on-screen. You also need to apply a global CoreImage filter to the full size images when displayed. While URLCache can easily handle storing the original downloaded image, it cannot store these different variants. What you really need is another caching layer designed to handle these different variants.

let imageCache = AutoPurgingImageCache(
    memoryCapacity: 100_000_000,
    preferredMemoryUsageAfterPurge: 60_000_000
)

The AutoPurgingImageCache in AlamofireImage fills the role of that additional caching layer. It is an in-memory image cache used to store images up to a given memory capacity. When the memory capacity is reached, the image cache is sorted by last access date, then the oldest image is continuously purged until the preferred memory usage after purge is met. Each time an image is accessed through the cache, the internal access date of the image is updated.

Add / Remove / Fetch Images

Interacting with the ImageCache protocol APIs is very straightforward.

let imageCache = AutoPurgingImageCache()
let avatarImage = UIImage(data: data)!

// Add
imageCache.add(avatarImage, withIdentifier: "avatar")

// Fetch
let cachedAvatar = imageCache.image(withIdentifier: "avatar")

// Remove
imageCache.removeImage(withIdentifier: "avatar")

URL Requests

The ImageRequestCache protocol extends the ImageCache protocol by adding support for URLRequest caching. This allows a URLRequest and an additional identifier to generate the unique identifier for the image in the cache.

let imageCache = AutoPurgingImageCache()

let urlRequest = URLRequest(url: URL(string: "https://httpbin.org/image/png")!)
let avatarImage = UIImage(named: "avatar")!.af.imageRoundedIntoCircle()

// Add
imageCache.add(avatarImage, for: urlRequest, withIdentifier: "circle")

// Fetch
let cachedAvatarImage = imageCache.image(for: urlRequest, withIdentifier: "circle")

// Remove
imageCache.removeImage(for: urlRequest, withIdentifier: "circle")

Auto-Purging

Each time an image is fetched from the cache, the cache internally updates the last access date for that image.

let avatar = imageCache.image(withIdentifier: "avatar")
let circularAvatar = imageCache.image(for: urlRequest, withIdentifier: "circle")

By updating the last access date for each image, the image cache can make more informed decisions about which images to purge when the memory capacity is reached. The AutoPurgingImageCache automatically evicts images from the cache in order from oldest last access date to newest until the memory capacity drops below the preferredMemoryCapacityAfterPurge.

It is important to set reasonable default values for the memoryCapacity and preferredMemoryCapacityAfterPurge when you are initializing your image cache. By default, the memoryCapacity equals 100 MB and the preferredMemoryCapacityAfterPurge equals 60 MB.

Memory Warnings

The AutoPurgingImageCache also listens for memory warnings from your application and will purge all images from the cache if a memory warning is observed.

Image Downloader

The ImageDownloader class is responsible for downloading images in parallel on a prioritized queue. It uses an internal Alamofire SessionManager instance to handle all the downloading and response image serialization. By default, the initialization of an ImageDownloader uses a default URLSessionConfiguration with the most common parameter values.

let imageDownloader = ImageDownloader(
    configuration: ImageDownloader.defaultURLSessionConfiguration(),
    downloadPrioritization: .fifo,
    maximumActiveDownloads: 4,
    imageCache: AutoPurgingImageCache()
)

If you need to customize the URLSessionConfiguration type or parameters, then simply provide your own rather than using the default.

Downloading an Image

let downloader = ImageDownloader()
let urlRequest = URLRequest(url: URL(string: "https://httpbin.org/image/jpeg")!)

downloader.download(urlRequest) { response in
    print(response.request)
    print(response.response)
    debugPrint(response.result)

    if case .success(let image) = response.result {
        print(image)
    }
}

Make sure to keep a strong reference to the ImageDownloader instance, otherwise the completion closure will not be called because the downloader reference will go out of scope before the completion closure can be called.

Applying an ImageFilter

let downloader = ImageDownloader()
let urlRequest = URLRequest(url: URL(string: "https://httpbin.org/image/jpeg")!)
let filter = AspectScaledToFillSizeCircleFilter(size: CGSize(width: 100.0, height: 100.0))

downloader.download(urlRequest, filter: filter) { response in
    print(response.request)
    print(response.response)
    debugPrint(response.result)

    if case .success(let image) = response.result {
        print(image)
    }
}

Authentication

If your images are behind HTTP Basic Auth, you can append the user:password: or the credential to the ImageDownloader instance. The credentials will be applied to all future download requests.

let downloader = ImageDownloader()
downloader.addAuthentication(user: "username", password: "password")

Download Prioritization

The ImageDownloader maintains an internal queue of pending download requests. Depending on your situation, you may want incoming downloads to be inserted at the front or the back of the queue. The DownloadPrioritization enumeration allows you to specify which behavior you would prefer.

public enum DownloadPrioritization {
    case fifo, lifo
}

The ImageDownloader is initialized with a .fifo queue by default.

Image Caching

The ImageDownloader uses a combination of an URLCache and AutoPurgingImageCache to create a very robust, high performance image caching system.

URLCache

The URLCache is used to cache all the original image content downloaded from the server. By default, it is initialized with a memory capacity of 20 MB and a disk capacity of 150 MB. This allows up to 150 MB of original image data to be stored on disk at any given time. While these defaults have been carefully set, it is very important to consider your application's needs and performance requirements and whether these values are right for you.

If you wish to disable this caching layer, create a custom URLSessionConfiguration with the urlCache property set to nil and use that configuration when initializing the ImageDownloader.

Image Cache

The ImageCache is used to cache all the potentially filtered image content after it has been downloaded from the server. This allows multiple variants of the same image to also be cached, rather than having to re-apply the image filters to the original image each time it is required. By default, an AutoPurgingImageCache is initialized with a memory capacity of 100 MB and a preferred memory usage after purge limit of 60 MB. This allows up to 100 MB of most recently accessed filtered image content to be stored in-memory at a given time.

Setting Ideal Capacity Limits

Determining the ideal the in-memory and on-disk capacity limits of the URLCache and AutoPurgingImageCache requires a bit of forethought. You must carefully consider your application's needs, and tailor the limits accordingly. By default, the combination of caches offers the following storage capacities:

  • 150 MB of on-disk storage (original image only)
  • 20 MB of in-memory original image data storage (original image only)
  • 100 MB of in-memory storage of filtered image content (filtered image if using filters, otherwise original image)
  • 60 MB preferred memory capacity after purge of filtered image content

If you do not use image filters, it is advised to set the memory capacity of the URLCache to zero. Otherwise, you will be storing the original image data in both the URLCache's in-memory store as well as the AlamofireImage in-memory store.

Duplicate Downloads

Sometimes application logic can end up attempting to download an image more than once before the initial download request is complete. Most often, this results in the image being downloaded more than once. AlamofireImage handles this case elegantly by merging the duplicate downloads. The image will only be downloaded once, yet both completion handlers will be called.

Image Filter Reuse

In addition to merging duplicate downloads, AlamofireImage can also merge duplicate image filters. If two image filters with the same identifier are attached to the same download, the image filter is only executed once and both completion handlers are called with the same resulting image. This can save large amounts of time and resources for computationally expensive filters such as ones leveraging CoreImage.

Request Receipts

Sometimes it is necessary to cancel an image download for various reasons. AlamofireImage can intelligently handle cancellation logic in the ImageDownloader by leveraging the RequestReceipt type along with the cancelRequestForRequestReceipt method. Each download request vends a RequestReceipt which can be later used to cancel the request.

By cancelling the request through the ImageDownloader using the RequestReceipt, AlamofireImage is able to determine how to best handle the cancellation. The cancelled download will always receive a cancellation error, while duplicate downloads are allowed to complete. If the download is already active, it is allowed to complete even though the completion handler will be called with a cancellation error. This greatly improves performance of table and collection views displaying large amounts of images.

It is NOT recommended to directly call cancel on the request in the RequestReceipt. Doing so can lead to issues such as duplicate downloads never being allowed to complete.

UIImageView Extension

The UIImage Extensions, Image Filters, Image Cache and Image Downloader were all designed to be flexible and standalone, yet also to provide the foundation of the UIImageView extension. Due to the powerful support of these classes, protocols and extensions, the UIImageView APIs are concise, easy to use and contain a large amount of functionality.

Setting Image with URL

Setting the image with a URL will asynchronously download the image and set it once the request is finished.

let imageView = UIImageView(frame: frame)
let url = URL(string: "https://httpbin.org/image/png")!

imageView.af.setImage(withURL: url)

If the image is cached locally, the image is set immediately.

Placeholder Images

By specifying a placeholder image, the image view uses the placeholder image until the remote image is downloaded.

let imageView = UIImageView(frame: frame)
let url = URL(string: "https://httpbin.org/image/png")!
let placeholderImage = UIImage(named: "placeholder")!

imageView.af.setImage(withURL: url, placeholderImage: placeholderImage)

If the remote image is cached locally, the placeholder image is never set.

Image Filters

If an image filter is specified, it is applied asynchronously after the remote image is downloaded. Once the filter execution is complete, the resulting image is set on the image view.

let imageView = UIImageView(frame: frame)

let url = URL(string: "https://httpbin.org/image/png")!
let placeholderImage = UIImage(named: "placeholder")!

let filter = AspectScaledToFillSizeWithRoundedCornersFilter(
    size: imageView.frame.size,
    radius: 20.0
)

imageView.af.setImage(
    withURL: url,
    placeholderImage: placeholderImage,
    filter: filter
)

If the remote image with the applied filter is cached locally, the image is set immediately.

Image Transitions

By default, there is no image transition animation when setting the image on the image view. If you wish to add a cross dissolve or flip-from-bottom animation, then specify an ImageTransition with the preferred duration.

let imageView = UIImageView(frame: frame)

let url = URL(string: "https://httpbin.org/image/png")!
let placeholderImage = UIImage(named: "placeholder")!

let filter = AspectScaledToFillSizeWithRoundedCornersFilter(
    size: imageView.frame.size,
    radius: 20.0
)

imageView.af.setImage(
    withURL: url,
    placeholderImage: placeholderImage,
    filter: filter,
    imageTransition: .crossDissolve(0.2)
)

If the remote image is cached locally, the image transition is ignored.

Image Downloader

The UIImageView extension is powered by the default ImageDownloader instance. To customize cache capacities, download priorities, request cache policies, timeout durations, etc., please refer to the Image Downloader documentation.

Authentication

If an image requires and authentication credential from the UIImageView extension, it can be provided as follows:

ImageDownloader.default.addAuthentication(user: "user", password: "password")

Credits

Alamofire is owned and maintained by the Alamofire Software Foundation. You can follow them on Twitter at @AlamofireSF for project updates and releases.

Security Disclosure

If you believe you have identified a security vulnerability with AlamofireImage, you should report it as soon as possible via email to [email protected]. Please do not post it to a public issue tracker.

Donations

The ASF is looking to raise money to officially stay registered as a federal non-profit organization. Registering will allow us members to gain some legal protections and also allow us to put donations to use, tax free. Donating to the ASF will enable us to:

  • Pay our yearly legal fees to keep the non-profit in good status
  • Pay for our mail servers to help us stay on top of all questions and security issues
  • Potentially fund test servers to make it easier for us to test the edge cases
  • Potentially fund developers to work on one of our projects full-time

The community adoption of the ASF libraries has been amazing. We are greatly humbled by your enthusiasm around the projects, and want to continue to do everything we can to move the needle forward. With your continued support, the ASF will be able to improve its reach and also provide better legal safety for the core members. If you use any of our libraries for work, see if your employers would be interested in donating. Any amount you can donate today to help us reach our goal would be greatly appreciated.

paypal

License

AlamofireImage is released under the MIT license. See LICENSE for details.

Comments
  • on disk caching weird behavior

    on disk caching weird behavior

    Hello, I just encountered an issue will using the pod. First of all, some images are fetched then written to disk at the correct path which is {app_identifier}/com.alamofire.imagedownloader/NsCachedData which is perfect as these images are not even downloaded again when the app is in offline mode. But the issue is that sometimes images are written to {app_identifier}/NsCachedData which I believe is the path for NSURLCache.sharedURLCache and not the path specified in the cache used by alamofireImage so these images are not seen by ImageDownloader and are re downloaded if they are not found in-memory. Also sometimes images are not even written to the disk which is weird.

    All these Images where fetched using the same method with the same approach tried removing their filters and nothing happened still the same behavior. I used ImageDownloader.defaultInstance.downloadImage method to fetch these Images.

    Any help will be appreciated, thanks In advance!

    opened by ysholqamy 39
  • On disk cache instead of in memory cache

    On disk cache instead of in memory cache

    I'm wondering if it would be at all possible to create an on disk cache rather than an in memory cache for handling images.

    The use case I'm thinking of is small custom images (emoji) that don't change regularly but are often used throughout an app.

    What would be the best approach of extending the current image caching to allow for an on disk cache?

    feature request image cache 
    opened by cuteiosdev 37
  • af_setImage doesn't work well with iOS 13

    af_setImage doesn't work well with iOS 13

    What did you do?

    I'm having problems with Alamofire image with iOS 13, some images are loaded and placed, but other not. Is this a known problem with iOS 13? How can I fix it?

    Alamofire Environment

    **Alamofire version: 4.8.2 **Alamofire Image version: 3.5.2 **Xcode version: 11 **Swift version: 4 **Platform(s) running AlamofireImage: iOS 13 macOS version running Xcode:

    Demo Project

    ℹ Please link to or upload a project we can download that reproduces the issue.

    bug uiimageview uibutton 
    opened by fabios9702 28
  • Crash in af_inflate

    Crash in af_inflate

    Crashed: NSOperationQueue 0x17e84a130 :: NSOperation 0x17e8449c0 (QOS: UTILITY) 0 CoreGraphics 0x182347bc4 CGDataProviderCopyData + 236 1 CoreGraphics 0x182347bc4 CGDataProviderCopyData + 236 2 InfatuationSwift 0x100185be0 @objc UIImage.af_inflate() -> () (UIImage+AlamofireImage.swift:110) 3 InfatuationSwift 0x10021a47c static Request.(imageResponseSerializer(imageScale : CGFloat, inflateResponseImage : Bool) -> ResponseSerializer<UIImage, NSError>).(closure #1) (Request+AlamofireImage.swift:99) 4 InfatuationSwift 0x10021a0f8 partial apply for thunk (Request+AlamofireImage.swift) 5 Alamofire 0x10073a390 TFFC9Alamofire7Request8responseuRxS_22ResponseSerializerTyperFT5queueGSqPSo17OS_dispatch_queue__18responseSerializerx17completionHandlerFGVS_8Responsewx16SerializedObjectwx11ErrorObject_T__DS0_U_FT_T + 436 6 Alamofire 0x100737cfc TPA__TFFC9Alamofire7Request8responseuRxS_22ResponseSerializerTyperFT5queueGSqPSo17OS_dispatch_queue__18responseSerializerx17completionHandlerFGVS_8Responsewx16SerializedObjectwx11ErrorObject_T__DS0_U_FT_T + 144 7 Foundation 0x181958510 NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK + 16 8 Foundation 0x1818aa900 -[NSBlockOperation main] + 96 9 Foundation 0x18189aed8 -[__NSOperationInternal _start:] + 604 10 Foundation 0x18195a904 __NSOQSchedule_f + 224 11 libdispatch.dylib 0x1809e947c _dispatch_client_callout + 16 12 libdispatch.dylib 0x1809f54c0 _dispatch_queue_drain + 864 13 libdispatch.dylib 0x1809ecf80 _dispatch_queue_invoke + 464 14 libdispatch.dylib 0x1809f7390 _dispatch_root_queue_drain + 728 15 libdispatch.dylib 0x1809f70b0 _dispatch_worker_thread3 + 112 16 libsystem_pthread.dylib 0x180c01470 _pthread_wqthread + 1092 17 libsystem_pthread.dylib 0x180c01020 start_wqthread + 4

    Not sure exactly when the crash occurred, but I got this from Crashlytics. Appears to be after the line CGDataProviderCopyData(CGImageGetDataProvider(CGImage))

    uiimage 
    opened by mlchild 22
  • af_setImage on ios13 causes app to crash

    af_setImage on ios13 causes app to crash

    Hi also have the same problem. the af_setImage cause my app to crash. in xcode 10 it worked fine. version from the store works great on ios13. in xcode11 (official) it crashes. (phone and simulator). if i run earlier simulators (ios10,11) the code works. the debugger points on UIImage+AlamofireImage.swift extension UIImage

    public static func af_threadSafeImage(with data: Data, scale: CGFloat) -> UIImage? {
       lock.lock()
       let image = UIImage(data: data, scale: scale) //the debugger stops here
       lock.unlock()
       return image
    }
    

    and in the console i see seek:285: *** IIOScanner::seek reached EOF getVal16:139: *** IIOScanner::getVal16 reached EOF

    Alamofire Environment

    Alamofire version: 4.9.0 AlamofireImage version: 3.5.2 Xcode version: 11 Swift version: 4.2 Platform(s) running AlamofireImage: iphone ios13 macOS version running Xcode: 10.14.6

    bug response serializers 
    opened by tomeron11 21
  • iOS 12 Crash

    iOS 12 Crash

    What did you do?

    I tried to download images on iOS 12.

    What did you expect to happen?

    The images should download and display without crashing.

    What happened instead?

    The application crashed. Stack trace shows the issue happening within the Alamofire SDK, but we can make requests directly using Alamofire in our app without any issues. So the crash seems to be related specifically to AlamofireImage.

    Alamofire Environment

    Alamofire version: 4.7.3 Xcode version: 10.0 beta 6 (10L232m) Swift version: 3 Platform(s) running AlamofireImage: iOS 12 macOS version running Xcode: High Sierra 10.13.6 (17G65)

    Demo Project

    I reproduced on the AlamofireImage Example project. Build and run on the iOS simulator using XCode 10 beta.

    Attachments

    Here is a screenshot of XCode hitting exception with a malloc error in the console: screen shot 2018-09-11 at 11 33 39 am

    Stack trace (I redacted user and password by replacing with "..."): strack_trace.txt

    needs feedback 
    opened by ghost 21
  • af_setImage withurl throws deleted method error on 'request.resume()' in ImageDownloader.start method

    af_setImage withurl throws deleted method error on 'request.resume()' in ImageDownloader.start method

    Hi,

    I'm running Alamofire 4.1.0 and AlamofireImage 3.1.0 using carthage and swift 3.0.1

    I've juste updated to swift 3.0.1 and update carthage alamofires libraries. And all my af_setImage method calls throws deleted method error on 'request.resume()' in ImageDownloader.start method

    Code line

    I don't know if I can simply delete this line or need I to use other method instead of af_setImage?

    Is it a new version, a rapid fix or something I can do while waiting for next release to continue using alamofireImage for getting images from web?

    Thanks by advance

    bug carthage 
    opened by tuxtux59 20
  • Feature request: Image download progress information

    Feature request: Image download progress information

    As stated in this Stack Overflow question, I'd like to show some kind of progress indicator when downloading images in lists (tableviews…) or in —big— image viewers. I know I can achieve this by using regular Alamofire.request + responseImage but I'd like to keep things simple and make use of the UIImageView Extension and the extra features it provides (cache, filters…).

    I'm currently working on an app that shows a news feed view controller which shows one highlighted news with a big photo followed by a list of "smaller" views with their own smaller photos. Each news detail view controller shows a gallery of related photos (1 to 50 or even more) and when the user taps one of them we load the big version of the photo in a custom photo viewer.

    It'd nice to show some kind of progress indicator to the user. Or perhaps I'm mistaken and its better to use the image-placeholder-only approach followed by the current implementation of AlamofireImage.

    Either way, thank you for your hard work ;-)

    help wanted feature request uiimageview 
    opened by sendoa 20
  • Need API to set inflateResponseImage to false

    Need API to set inflateResponseImage to false

    Hi. I noticed the line 'CGDataProviderCopyData(CGImageGetDataProvider(CGImage))' of function af_inflate uses a lot of memory especially when I load a large image on a cell (like 3000x3000 and file size is 2MB) and then scroll the pages quickly. This blows up the memory usage and crashes my app

    Disabling the inflation works for me

    feature request 
    opened by iad24 13
  • added support for Project Catalyst, running on macOS

    added support for Project Catalyst, running on macOS

    Goals :soccer:

    Bring support for macOS (project catalyst) iPad apps can run on macOS Catalina, this PR bring support to that.

    Implementation Details :construction:

    simply implement targetEnvironment around default cache, so it works with URLCache constructor provided on macOS / UIKit

    Testing Details :mag:

    No test added

    image cache 
    opened by sonique6784 12
  • On disk cache

    On disk cache

    This pull request add a new ImageCache implementation called PersistentAutoPurgingImageCache which is a subclass of AutoPurgingImageCache. On add the image is asynchronously saved on disk, and on fetch if the image is not available in memory, it will be fetched from disk (if present). A time to live is associated with the image, and a cleanup logic will keep tidy the chosen cache folder.

    The feature is fully unit tested.

    This PR was made to address the issue https://github.com/Alamofire/AlamofireImage/issues/5

    For testability purposes a version of the add method with a completion block was added.

    image cache 
    opened by gringoireDM 12
  • Update Testing, Add AVIF Support

    Update Testing, Add AVIF Support

    Issue Link :link:

    #461

    Goals :soccer:

    This PR adds AVIF support and refactors the testing support for the framework to match Alamofire.

    Implementation Details :construction:

    AVIF has been added to the supported headers. Tests have been rebuilt with test plans. watchOS testing has been enabled.

    Testing Details :mag:

    No new tests, some tests refactored to use a single image scale definition.

    opened by jshier 0
  • Does AlamofireImage support resizing animated GIF?

    Does AlamofireImage support resizing animated GIF?

    Someone recommended me to use AlamofireImage for this purpose. But after reading some of the documentation, there's no words on whether or not the UIImage or Scaling work for animated GIFs.

    Specifically I would like to use this method for scaling animated GIFs. https://alamofire.github.io/AlamofireImage/Extensions/UIImage.html#/s:So7UIImageC14AlamofireImageE20af_imageAspectScaled5toFit5scaleABSo6CGSizeV_12CoreGraphics7CGFloatVSgtF

    Thanks.

    opened by Jeanno 0
  • App crash on ios 11.0.2, xcode 14.0.1

    App crash on ios 11.0.2, xcode 14.0.1

    What did you do?

    ℹ I run my app on xcode 14.0.1. iOS version 11.0.2

    What did you expect to happen?

    ℹ My app should run without problems

    What happened instead?

    ℹ My app is crashed. There is logs: Library not loaded: /usr/lib/swift/libswiftCoreGraphics.dylib

    Alamofire Environment

    Alamofire version: 5.2 AlamofireImage version: 4.1 Xcode version:14.0.1 Swift version:5 Platform(s) running AlamofireImage:iOS 11.0.2 macOS version running Xcode:Ventura 13.0 (22A380)

    Demo Project

    ℹ I can't provide you with a link to the repository. but I can show you my Podfile where I import this library. pod 'AlamofireImage', '~> 4.1'

    opened by Hudayberdyyev 0
  • Feature request: Support `image/avif` to Accept header for iOS 16, macOS Ventura and more.

    Feature request: Support `image/avif` to Accept header for iOS 16, macOS Ventura and more.

    What did you do?

    iOS 16 and macOS Ventura start support AVIF image type so this feature request want adding image/avif to request Accept header as dynamic similar to image/webp support.

    • https://github.com/Alamofire/AlamofireImage/pull/434
    • https://caniuse.com/avif

    I'm not sure about tvOS and watchOS are support AVIF on latest version.

    What did you expect to happen?

    image/avif string contained in accept header when running OS is iOS 16 or macOS Ventura.

    What happened instead?

    Not yet added.

    Alamofire Environment

    Alamofire Image version: 4.2.0

    Demo Project

    N/A

    feature request 
    opened by r-plus 4
  • How do you cancel all pending and current image download requests in AlamofireImage?  (Possible Feature Request)

    How do you cancel all pending and current image download requests in AlamofireImage? (Possible Feature Request)

    Introduction:

    Hello, I'm currently using AlamofireImage to download images in my app. I'm primarily using its ImageDownloader to download images and am using a singleton instance of this ImageDownloader to download images in a custom URLImageView I built in SwiftUI.

    As far as I can tell, there doesn't seem to be a cancelAll method on the ImageDownloader class. The best there is, is a cancelRequest(with requestReceipt: RequestReceipt) method, but this requires keeping track of RequestsReceipts which is overhead I'd prefer not to manage. I've played around with this as well but it doesn't seem to cancel currently downloading images, only pending in the queue (from what I've found in testing)

    Problem I'm trying to solve:

    I'm running into an issue in my app where I have a few screens back to back that are VERY image heavy and display many images. When a user is on a slow cell service connection (not wifi), I see that theres a bottleneck that begins to happen where when a user goes to the next screen, it can't begin downloading the new images because its bogged down waiting for the previous screens images to complete downloading.

    I'd love for a way to have a generic cancelAll method I can call that just cancels everything already pending/downloading since as I don't need previous screens to continue downloading - I need the new screen to have all the bandwidth priority to download new images.

    Solutions I've Tried:

    The closest I've come to replicate the behavior I want is with the following method:

    func cancelAll() {
    
    	// invalidate and cancel session
    	alamofireImageDownloader.sessionManager.session.invalidateAndCancel()
    
    	// re-init alamofire image downloader
    	alamofireImageDownloader = ImageDownloader(
    		configuration: ImageDownloader.defaultURLSessionConfiguration(),
            downloadPrioritization: .fifo,
            maximumActiveDownloads: 4,
            imageCache: cache
        )
    
    }
    

    This solution makes me nervous however because it feels weird to have to re-init the ImageDownloader every time I go to a new screen in order to cancel all pending and current image downloads.

    That said this solution does work, and it allows new screens to get the full bandwidth to download images and is no longer blocked by previous screen images.

    Would love some thoughts on best practice on how to do this or comments on whether my current solution is safe/smart to do.

    feature request 
    opened by xanderbuck 1
  • Expose acceptableImageContentTypes

    Expose acceptableImageContentTypes

    Goals :soccer:

    Expose ImageResponseSerializer.acceptableImageContentTypes for read-only consumption by API consumers.

    Implementation Details :construction:

    I have had a few instances where I need to express valid content types. The most recent use case was within a SwiftUI view where I wanted to download an image directly.

    Testing Details :mag:

    n/a

    opened by lickel 7
Releases(4.2.0)
  • 4.2.0(Apr 4, 2021)

  • 4.1.0(Apr 6, 2020)

  • 4.0.3(Mar 7, 2020)

    Released on 2020-03-07. All issues associated with this milestone can be found using this filter.

    Fixed

    • Missing nil default for completionHandler parameter of download method.
    • Swift Package Manager compatibility with local submodules, for real this time.
    Source code(tar.gz)
    Source code(zip)
  • 4.0.2(Feb 29, 2020)

  • 4.0.1(Feb 24, 2020)

  • 4.0.0(Feb 23, 2020)

    Released on 2020-02-23. All issues associated with this milestone can be found using this filter.

    Added

    • Custom cacheKey support to ImageDownloader and UIImageView and UIButton extensions.
    • The application/octet-stream to the list of acceptable image content types to support iOS 13.
    • Custom ImageResponseSerializer support to ImageDownloader and UIImageView and UIButton extensions.
    • Tests to various types to verify they can handle URLRequestConvertible types that throw.
    • AlamofireExtended support to UIImage, UIImageView, and UIButton types to use af. prefixing instead of af_.
    • A 4.0 migration guide to the project and linked in the README.
    • SwiftFormat support to the project.

    Updated

    • The license section of the README to link to the actual LICENSE file.
    • The ImageDownloader download image logic by removing variable shadowing to simplify logic flow.
    • The image cache capacity section in the README to improve in-memory setting recommendations.
    • The Alamofire dependency to ~> 5.0 across dependency management files.
    • The README to match all the newer conventions with the Alamofire 5 changes and af. prefixing on extensions.

    Deprecated

    • The af_ APIs on UIImage, UIImageView, and UIButton in favor of the new af. equivalent APIs. These APIs will be removed in AFI5.

    Fixed

    • Issue in the README where the documentation link was incorrect.
    • Issue where af_setBackgroundImage was not setting the filter correctly on the image download.
    • Issue where runImageTransitionIfCached on UIImageView was not setting the placeholder image correctly.
    Source code(tar.gz)
    Source code(zip)
  • 4.0.0-beta.6(Oct 27, 2019)

  • 3.6.0(Oct 27, 2019)

  • 4.0.0-beta.5(Sep 17, 2019)

  • 4.0.0-beta.4(Aug 28, 2019)

    Released on 2019-08-27. All issues associated with this milestone can be found using this filter.

    Fixed

    • Issue where ImageDownloader was not dequeuing and cancelling requests correctly in certain race conditions due to Alamofire switching to async request creation.
    Source code(tar.gz)
    Source code(zip)
  • 4.0.0-beta.3(May 4, 2019)

    Released on 2019-05-04. All issues associated with this milestone can be found using this filter.

    Fixed

    • Issue with AppStore submissions where the pre-release version in the bundle short versions string was being rejected when built with Carthage or as a submodule.
    Source code(tar.gz)
    Source code(zip)
  • 4.0.0-beta.2(Apr 13, 2019)

  • 4.0.0-beta.1(Apr 10, 2019)

  • 3.5.2(Mar 28, 2019)

  • 3.5.1(Mar 28, 2019)

  • 3.5.0(Nov 28, 2018)

  • 3.4.1(Sep 17, 2018)

    Released on 2018-09-17. All issues associated with this milestone can be found using this filter.

    Updated

    • The Xcode project configuration to use workspace linking instead of nested projects.

    Fixed

    • A minor CIGaussianBlur typo in one of the README examples.
    Source code(tar.gz)
    Source code(zip)
  • 3.4.0(Sep 13, 2018)

  • 3.3.1(Apr 1, 2018)

    Released on 2018-03-31. All issues associated with this milestone can be found using this filter.

    Added

    • Jazzy docs and configuration.
    • Ruby environment settings that match Alamofire's.

    Updated

    • Project configuration and files for Xcode 9.3 and Swift 4.1.
    • Copyrights to 2018 for all files.
    • TravisCI configuration for Xcode 9.3.

    Fixed

    • Gravatar API usage in example code.
    Source code(tar.gz)
    Source code(zip)
  • 3.3.0(Sep 6, 2017)

    Released on 2017-09-06. All issues associated with this milestone can be found using this filter.

    Added

    • Gitter badge to the README to direct users to the group.
    • Optional queue parameter to responseImage function.
    • Asserts to scaling functions as well as production fallbacks.
    • GitHub templates for issues and pull requests.

    Updated

    • Alamofire submodule and dependency to ~> 4.5.
    • The project and codebase to support Swift 3 / 4 simultaneously.
    • The README to use the current version throughout the installation section.
    • Image response serializers code sample in the README to import Alamofire.

    Fixed

    • The Swift Package Manager (SPM) integration by excluding Tests folder.
    • Issue in the embedded framework section of the README where bash specifier was incorrect.
    • Various typos throughout the project using misspell.
    Source code(tar.gz)
    Source code(zip)
  • 3.2.0(Nov 21, 2016)

    All issues associated with this milestone can be found using this filter.

    Added

    • A new imageResponseSerializer property to the ImageDownloader.
    • New embedded framework installation instructions to the README.
    • A new iOS 8.1 target to the Travis CI device matrix.

    Updated

    • The AutoPurgingImageCache APIs to an open ACL where applicable.
    • The ImageDownloader and RequestReceipt APIs to an open ACL where applicable.
    • The Xcode project to Xcode 8.1 and made all suggested project updates.
    • UIButton and UIImageView completion closures to be called after image is set.
    • The deployment targets to iOS 8.0 and macOS 10.10 to match core Alamofire project.
    • The Cartfile and pulled in Alamofire 4.2.0 submodule.

    Removed

    • CoreImage filters on iOS 8.x due to runtime mapping issue with CIContext.
    Source code(tar.gz)
    Source code(zip)
  • 3.1.0(Oct 2, 2016)

    All issues associated with this milestone can be found using this filter.

    Added

    • New .swift-version file to repo and reactivated pod lib lint in Travis file.
    • The OS_ACTIVITY_MODE environment variable to disable excessive logging.
    • The new CoreImageFilter protocol and updated BlurFilter to conform to it.
    • The ability to the AutoPurgingImageCache to remove all images matching a URL request.
    • ImageFilter support to the UIButton extension.
    • MJPEG support to DataRequest extension for streaming images.
    • Stream image test for DataRequest extension and updated docstrings.

    Updated

    • The Alamofire submodule to the 4.0.1 release.
    • All cases of OSX to macOS throughout the project.
    • Project settings by removing duplicate settings for individual targets.
    • Project and podspec so all files are compiled on all platforms.

    Fixed

    • A typo in placeholderImage parameter in several UIButton APIs.
    • A CIGuassianBlur typo in one of the README code samples.

    Upgrade Notes

    This release contains a non-backwards compatible change that fixes a typo in the UIButton extension where placeholderImage was misspelled in two APIs. Rather than push a MAJOR version release for a typo that people are generally getting incorrect, we decided to break semver here and fix the typo for everyone. Please note that we always try to follow semver as strictly as possible. However, this seemed like the best option given that users would continue to struggle with the typo throughout the lifespan of the 3.x releases.

    Source code(tar.gz)
    Source code(zip)
  • 3.0.0(Sep 11, 2016)

    All issues associated with this milestone can be found using this filter.

    Added

    • An AFI 3.0 Migration Guide and updated the README to match new APIs.

    Updated

    • All source, test and example logic as well as project settings to compile against the Xcode 8 beta releases.
    • Deployment targets to iOS 9.0, macOS 10.11, tvOS 9.0 and watchOS 2.0.
    • All instances of com.alamofire with org.alamofire throughout project.
    • Copyright headers to match Alamofire formatting.
    • Updated the travis yaml file for Xcode 8.
    • All source, test and example APIs to match Swift 3 design guidelines.
    • All docstrings to use new Swift 3 syntax.
    • All AssociatedKey names to be lowercased to match Swift 3 guidelines.
    • The podspec for the 3.0.0 release and bumped deployment targets.
    • Code signing to now automatic with an empty team.
    • Number of large image test iterations to 200 to attempt to stabilize travis.

    Removed

    • DispatchWorkItemFlags implementation with async flags.
    • ReleaseTest configuration by enabling testability in travis yaml file.
    • An NSURL extension from the test suite that wasn’t used.

    Fixed

    • Issue where removeImage API on the image cache would not remove the image.
    • Compilation errors due to AFError refactors in Alamofire.
    Source code(tar.gz)
    Source code(zip)
  • 2.5.0(Sep 8, 2016)

    All issues associated with this milestone can be found using this filter.

    Added

    • Cleanup Whitespace aggregate target and scheme and removed all excess whitespace.

    Updated

    • The source, test and example code along with project settings to support Swift 2.2 and Swift 2.3 simultaneously.
    • Updated the travis yaml file for Swift 2.3 and the new OS target versions.
    • Updated the Cartfile and Alamofire submodule to the 3.5.0 release.
    • Updated Xcode project settings based on Xcode 8 GM recommendations.
    • Code coverage generation is now disabled on framework targets to improve stability.

    Fixed

    • Issue where image download cancellation error was thrown in incorrect domain.
    • Image download cancellation and restart race condition.
    Source code(tar.gz)
    Source code(zip)
  • 2.4.1(Jul 19, 2016)

    All issues associated with this milestone can be found using this filter.

    Updated

    • The dependency requirement in the README to Alamofire 3.3+.
    • The Alamofire submodule to the 3.4.1 release.
    • The Travis CI yaml file to use the xcode7.3 build.

    Fixed

    • Issue where queue names were not using hex formatters properly.
    • Deprecation warning from errorWithCode usage by switching to explicit NSError creation logic.
    Source code(tar.gz)
    Source code(zip)
  • 2.4.0(Mar 24, 2016)

    All issues associated with this milestone can be found using this filter.

    Added

    • The image/x-ms-bmp as an acceptable Content-Type.
    • The ability to track download progress in the ImageDownloader as well as the UIButton and UIImageView extensions.
    • The UIButton extension and tests to the tvOS targets.

    Updated

    • The Alamofire submodule to the 3.3.0 release along with the Cartfile and Podspec dependencies.
    • All source code, tests and example logic to use Swift 2.2 conventions.
    • The required version of Xcode to 7.3 in the README.
    • The AutoPurgingImageCache to purge cache during memory warnings on tvOS.
    • Several Request and ImageDownloader tests on tvOS that were previously disabled.
    Source code(tar.gz)
    Source code(zip)
  • 2.3.1(Feb 8, 2016)

    All issues associated with this milestone can be found using this filter.

    Added

    • Default value to completion parameter in downloadImage API in `ImageDownloader.

    Updated

    • The Alamofire submodule to the 3.2.0 release.

    Removed

    • Superfluous APIs on ImageDownloader, UIButton and UIImageView extensions and replaced with default parameter values.

    Fixed

    • Issue in UIImage extension where CoreImage filters were using the incorrect output frame.
    • All blur filter tests across all devices and OS's.
    • Issue where image response serializer was not thread-safe by switching over to thread-safe UIImage initializer.
    • Build warnings in Xcode 7.3 beta 2 for Swift 2.2.
    Source code(tar.gz)
    Source code(zip)
  • 2.3.0(Jan 18, 2016)

    All issues associated with this milestone can be found using this filter.

    Added

    • Alpha properties to UIImage extension along with unit tests.
    • Condition to UIImageView test to verify active request receipt is reset.
    • UIButton extension supporting remote image downloads.
    • Tests verifying Accept header is set properly for button image downloads.
    • UIButton extension tests around cancelling and restarting image downloads.
    • iOS 9.2 devices to the travis yaml device matrix.
    • Carthage/Build ignore flag to the .gitignore file to match Alamofire.
    • Package.swift file to support Swift Package Manager (SPM).

    Updated

    • UIImage scaling now uses af_isOpaque property where applicable.
    • Refactored UIButton extension and tests to more closely follow coding standards.
    • Simplified UIImageView tests replacing KVO by overriding the image property.
    • Excluded the UIButton extension from osx and watchOS targets in podspec.
    • Copyright headers to include 2016! 🎉🎉🎉
    • The default parameters in AutoPurgingImageCache initializer with correct MB values.
    • Several UIImageView APIs to public ACL to allow for better reuse.
    • Alamofire submodule to 3.1.5 release.
    Source code(tar.gz)
    Source code(zip)
  • 2.2.0(Dec 17, 2015)

    All issues associated with this milestone can be found using this filter.

    Added

    • Ability for ImageDownloader to enqueue multiple image downloads at once.
    • Tests to verify image view can cancel and restart the same request.
    • Precondition to ImageCache ensuring memory capacity is GTE preferred usage after purge.
    • Ability for image transitions to run when image is cached if specified.
    • Test to verify Accept header is set correctly on UIImageView extension.
    • Added ReleaseTest configuration to allow running tests against optimized build.

    Updated

    • Project to disable testability on release and to only build tests on when testing.
    • The Travis-CI configuration to Xcode 7.2, iOS 9.2, tvOS 9.1 and watchOS 2.1.

    Fixed

    • Issue where image was not downloaded when cancelled and restarted.
    • Issue where af_setImageWithURL was not using acceptable content types.
    Source code(tar.gz)
    Source code(zip)
  • 2.1.1(Nov 22, 2015)

    All issues associated with this milestone can be found using this filter.

    Added

    • Note to the README about storing a strong ref to image downloaders.
    • Custom Info.plist for tvOS setting the UIRequiredDeviceCapabilities to arm64.

    Updated

    • The sessionManager ACL in the ImageDownloader to allow access to the underlying session and configuration.
    • The Alamofire submodule to the Alamofire 3.1.3 release.
    Source code(tar.gz)
    Source code(zip)
Owner
Alamofire
Elegant Networking in Swift
Alamofire
📷 A composable image editor using Core Image and Metal.

Brightroom - Composable image editor - building your own UI Classic Image Editor PhotosCrop Face detection Masking component ?? v2.0.0-alpha now open!

Muukii 2.8k Jan 3, 2023
An image download extension of the image view written in Swift for iOS, tvOS and macOS.

Moa, an image downloader written in Swift for iOS, tvOS and macOS Moa is an image download library written in Swift. It allows to download and show an

Evgenii Neumerzhitckii 330 Sep 9, 2022
📷 A composable image editor using Core Image and Metal.

Brightroom - Composable image editor - building your own UI Classic Image Editor PhotosCrop Face detection Masking component ?? v2.0.0-alpha now open!

Muukii 2.8k Jan 2, 2023
AsyncImage before iOS 15. Lightweight, pure SwiftUI Image view, that displays an image downloaded from URL, with auxiliary views and local cache.

URLImage URLImage is a SwiftUI view that displays an image downloaded from provided URL. URLImage manages downloading remote image and caching it loca

Dmytro Anokhin 1k Jan 4, 2023
A complete Mac App: drag an image file to the top section and the bottom section will show you the text of any QRCodes in the image.

QRDecode A complete Mac App: drag an image file to the top section and the bottom section will show you the text of any QRCodes in the image. QRDecode

David Phillip Oster 2 Oct 28, 2022
Convert the image to hexadecimal to send the image to e-paper

ConvertImageToHex Convert the image to hexadecimal to send the image to e-paper Conversion Order // 0. hex로 변환할 이미지 var image = UIImage(named: "sample

Hankyeol Park 0 Feb 26, 2022
Twitter Image Pipeline is a robust and performant image loading and caching framework for iOS clients

Twitter Image Pipeline (a.k.a. TIP) Background The Twitter Image Pipeline is a streamlined framework for fetching and storing images in an application

Twitter 1.8k Dec 17, 2022
Image-cropper - Image cropper for iOS

Image-cropper Example To run the example project, clone the repo, and run pod in

Song Vuthy 0 Jan 6, 2022
An instagram-like image editor that can apply preset filters passed to it and customized editings to a binded image.

CZImageEditor CZImageEditor is an instagram-like image editor with clean and intuitive UI. It is pure swift and can apply preset filters and customize

null 8 Dec 16, 2022
GIFImage component for your SwiftUI app!

SwiftUI GIF Lightweight SwiftUI component for rendering GIFs from data or assets, with no external dependencies. As a bonus, there's an extension that

Gordan Glavaš 17 Dec 6, 2022
ImageView - Component for loading and displaying different images aka SVG/PNG/JPG/JPEG

ImageView Component that loads and displays images(.svg/.png/.jpg/.jpeg) form as

Sergei 1 Mar 23, 2022
A SwiftUI component for launching custom picture-in-picture experiences

Pipify for SwiftUI This library introduces a new SwiftUI modifier that enables a view to be shown within a Picture in Picture overlay. This overlay al

Sidetrack 99 Dec 16, 2022
🍁🥓 Lightweight and fast Swift library for image downloading, caching and transformations

MapleBacon Introduction MapleBacon is a lightweight and fast Swift library for downloading and caching images. Example The folder Example contains a s

Jan Gorman 335 Nov 1, 2022
Image filtering UI library like Instagram.

Sharaku Usage How to present SHViewController let imageToBeFiltered = UIImage(named: "targetImage") let vc = SHViewController(image: imageToBeFiltered

Makoto Mori 1.5k Dec 20, 2022
A high-performance image library for downloading, caching, and processing images in Swift.

Features Asynchronous image downloader with priority queuing Advanced memory and database caching using YapDatabase (SQLite) Guarantee of only one ima

Yap Studios 72 Sep 19, 2022
Swift Image Slider library for iOS

Banana - ImageSlider for Swift Image slider with very simple interface. At a Glance @IBOutlet weak var imageScrollView: UIScrollView! // Here imageArr

Gaurav Katoch 17 Apr 20, 2021
A apple music cover picture shadow style image library

ShadowImageView A apple music cover picture shadow style image library ShadowImageView is a iOS 10 Apple Music style image view, help you create elege

Old Donkey 794 Dec 17, 2022
Slide image viewer library similar to Twitter and LINE.

Overview You can use it simply by passing the necessary information! Serrata is a UI library that allows you to intuitively view images. Features King

Takuma Horiuchi 324 Dec 9, 2022
A very useful and unique iOS library to open image picker in just few lines of code.

ImagePickerEasy A very simple solution to implement UIImagePickerController() in your application. Requirements Swift 4.2 and above Installation Image

wajeehulhassan 6 May 13, 2022