Skip to content
/ GIF Public

Objective-C Wrapper for a GIF C++ library

Notifications You must be signed in to change notification settings

okipol88/GIF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GIF - Objective-C wrapper for a C++ GIF library

Carthage compatible

This framework is based on the Android NDK GIF Library, forked and hooked up as a submodule, that can be found here. Small adjustments to the C++ code have been made to make it compilable as Objective-C++.

The project currently only supports encoding. But with little effort decoding can also be added. Two modes are available:

  • ENCODING_TYPE_SIMPLE_FAST
  • ENCODING_TYPE_NORMAL_LOW_MEMORY

The original project also includes ENCODING_TYPE_STABLE_HIGH_MEMORY but currently there are some problems with it.

Example usgae can be found in the GIFExample project:

...
        var encoder: GIFEncoder? = nil
        for path in paths {
            guard let image = UIImage(contentsOfFile: path) else {
                print("Could not acquire image at path \(path)")
                continue
            }
            if encoder == nil {
                encoder = GIFEncoder(mode: .NormalLowMemory, width: UInt(image.size.width), height: UInt(image.size.height), filePath: gifPath)
            }
            do {
                try encoder?.encodeFrame(image, frameDelay: 250)
            } catch {
                print("Could not create frame for image at path \(path)")
            }
        }

        encoder?.closeGif()

Helpfull articles:

About

Objective-C Wrapper for a GIF C++ library

Resources

Stars

Watchers

Forks

Packages

No packages published