Giter Club home page Giter Club logo

libwebp-xcode's Introduction

libwebp + Xcode

A wrapper for libwebp + Xcode project. This enables Carthage support This also contains the Swift Package Manager support

CI Status Carthage compatible SwiftPM compatible

Requirements

  • iOS 8
  • macOS 10.11
  • tvOS 9.0
  • watchOS 2.0

Installation

CocoaPods

libwebp is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'libwebp'

Carthage

libwebp is (via this repo) available through Carthage.

github "SDWebImage/libwebp-Xcode"

SwiftPM

Libwebp is available through Swift Package Manager.

let package = Package(
    dependencies: [
        .package(url: "https://github.com/SDWebImage/libwebp-Xcode", from: "1.1.0")
    ],
    // ...
)

Usage

Use libwebp as you would normally, this is just a repo that adds an Xcode proj.

For Swift Package Manager user, it's recommended to use the modular import instead of C headers.

  • Objective-C
@import libwebp;
// or if you don't use module
#import <webp/decode.h>
#import <webp/encode.h>
  • Swift
import libwebp

About sharpyuv

From libwebp v1.2.3, Google separate some functions into a new standalone lib called sharpyuv. However, it dependeny source code from libwebp repo's src as implementation. Like llvm-project monorepo, one repo host multiple targets.

Before v1.3.0, we hide these headers as internal headers.

From v1.3.0, we expose the sharpyuv public headers, but not a standalone CocoaPods/SPM/Carthage Target. (In the future we may consider separate targets)

If you want to use sharpyuv functions, do something like this:

  • Objective-C
// This does not supports module include
#if __has_include(<sharpyuv/sharpyuv.h>)
#import <sharpyuv/sharpyuv.h>
#else
#import <libwebp/sharpyuv.h> // bundled in libwebp's modulemap
#endif
  • Swift
#if canImport(sharpyuv)
import sharpyuv
#else
import libwebp // bundled in libwebp's modulemap
#endif

License

libwebp is available under the BSD-3 license. See the LICENSE file for more info.

libwebp-xcode's People

Contributors

1conan avatar bpoplauschi avatar dreampiggy avatar trilliwon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libwebp-xcode's Issues

Variable 'xx' may be unitialized when used here

Can you fix this warning?

First is in backward_references_enc
Variable 'best_offset' may be uninitialized when used here

Rest are in dec_neon
Variable 'sum_left' may be uninitialized when used here Variable 'sum_top' may be uninitialized when used here

Support libweb 1.3.1 version

There is a new version, 1.3.1 of libwebp
From the release note:

  • 6/23/2023: version 1.3.1
    This is a binary compatible release.
  • security fixes for lossless encoder (#603, chromium: #1420107, #1455619,
    CVE-2023-1999)

It resolves a security issue CVE-2023-1999.
Can libwebp-Xcode support libwebp 1.3.1 ?

Thanks for your support.

Error while importing headers: 'webp/decode.h' file not found

The Swift Package Manager is used to pull libwebp into an Objective-C project. When attempting to use import the headers, the search path doesn't appear to be used.

#import <webp/decode.h>

  • Is there a setting that needs to occur in the Target Build Settings to update either the Header Search Path or User Header Search Paths?
  • Do you have a public Objective-C repo that makes use of Swift PM?
  • The files under include/web/*.h are symbolic links back to libwebp/src/webp/*.h (which we also tried), is there an issue with Swift PM following those links?

The error is

util/webp_reader.cpp:7:9: fatal error: 'webp/decode.h' file not found
#import <webp/decode.h>

The project cannot use the preferred @import libwebp. Thank you for supporting Swift PM in this project, as it is very useful.

call gif2webp from swift file

I was able to add the package and call WebPGetDecoderVersion()
I would like to call the function to convert a GIF data to webp Data that is see in gif2webp.c

Would this be possible?

A building error about inttypes.h.

If someone gets a building error about 'inttypes.h', replace 'inttypes.h' with 'xlocale/_inttypes.h' maybe make it works.

Error Messages:
...../Carthage/Build/iOS/libwebp.framework/Headers/types.h:20:10: Include of non-modular header inside framework module 'libwebp.types': '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/clang/include/inttypes.h'

podspec error.

According to libwep.podspec, src directory is not located at the current directory, when I use this pod library as a local pod. It will occur errors. when I move the src directory from libwebp directory to the current directory, it's ok.

iOS 15 / Xcode 13 - min target conflict

Hey all!
We bumped our project to iOS 15 / Xcode 13, but we got the following on Jenkins:

../SourcePackages/checkouts/libwebp-Xcode/Package.swift: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.0.99. (in target 'libwebp' from project 'libwebp')

Can I open a PR with a min version bump?

Thanks!

Can we put the original libwebp.podspec (not json format) here for maintain ?

See all the third party C/C++ image decoding library we used for custom decoder:

They are contains the both Xcode project (using for Carthage or user who need the framework), and the podspec for CocoaPods.

Making the podspec public can make it easier for future maintain. Especially when you don't want to maintain the repo and need another people to take the relay.

I current could not find the original podspec files for https://cocoapods.org/pods/libwebp. Could you please upload it here ? @bpoplauschi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.