Giter VIP home page Giter VIP logo

ios-webp's People

Contributors

autom8er avatar brandons avatar emilwojtaszek avatar makimoto avatar sagarsdagdu avatar seanooi avatar weibel avatar zld 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  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  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

ios-webp's Issues

result Zero bytes

Picture size is 1242x18909, UIImage conversion WebP,result Zero bytes.

When I set alpah parameter to 1, some colors lose

I met an strange question which is that I compressed an UIImage to WebP, but some colors lose, and I also try to use other quality and WEBP_PRESET but fianlly I find the problem is casued by ALPHA parameter. I tried use other numbers less than 1 all are correct. And I try to edit some source code:

if (alpha <= 1) {
    image = [self webPImage:image withAlpha:alpha];
}

to enforce call webPImage:withAlpha method first and will fix this problem. I don't why, so could you help to fix this issue?

THX

Unknown process name ????

[Unknown process name] CGDataProviderCreateDirect: Invalid size = 0
[Unknown process name] CGImageCreate: invalid image provider: NULL.
[Unknown process name] CGDataProviderCreateDirect: Invalid size = 0
[Unknown process name] CGImageCreate: invalid image provider: NULL.

Webp results not smaller than png, suggestions?

I have an app which imports pngs from the user's photolibray. I store these in a sub-folder hierarchy in my documents directory.

I was hoping that storing them in webP format would give me a significant savings. I rarely need to access these images but need them around for reference.

Basially, I want no-alpha lossless. Also of note are that these images are screenshots from an iPhone app, so graphical not photographic.

But my webP images end up less then %10 smaller, and often larger. I downloaded the free utility "PhotoConvert Lite" and it manages to output web that are 40% smaller. I assume it is respecting my lossless setting.

My code looks like this:

    [UIImage imageToWebP:image quality:100 alpha:1
                  preset:WEBP_PRESET_DEFAULT
             configBlock:^(WebPConfig* config)
             {
                 config->lossless     = 1;
                 config->image_hint   = WEBP_HINT_GRAPH;
             }
         completionBlock:^(NSData* result)
         {
          // save file
         } failureBlock:^(NSError* error)

iOS 11.2 Beta

Is it just me or it does not work anymore on iOS 11.2 Beta? The imageRef in:
CGImageRef imageRef = CGImageCreate(width, height, 8, 32, 4 * width, colorSpaceRef, bitmapInfo, provider, NULL, YES, renderingIntent);
always return nil.
I think this issue worth checking since it can potentially break everyone code when Apple officially release 11.2...
screen shot 2017-11-07 at 9 10 02 pm

Error on decoding on device

I'm trying your library, it works on simulator (32 and 64 bit) but it doesn't work on device. Your demo project crashes after about one second if is runned on device (ios 7.1 iphone 5)
The application crashes on CGSConvertAlphaByte

Any advices?

Decoding error

Hello!

I'm having this error when I'm trying to decode my NSData:

App(568,0x3c88418c) malloc: *** error for object 0x312eac: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

I cant decode my image... :(

Speed and CPU

Hi I found the lib is bit slow and utilise more cpu when encode to WebP
Am i right..?

Color shift when encoding UIImage files

[This was posted as part of another topic, which was closed....not by me). So I moved it here

Here are two images, JPEG and webP. Notice the big color shift. The UIImage that's given to the JPEG and webP compressors is generated from a cocos2D openGL layer that gets rendered into a UIImage. I'm not sure if that's affecting the webP encoder, but as you can see, the color shift is noticeable. Again, If I decompress the JEPG and then recompress with webP, I have no problem--there is no color shift

m4

screen shot 2014-05-01 at 10 42 16 am

问题

@seanooi
您好!请问framework的代码可以开源的嘛?

Jack

Crashing Abruptly with Pointer being freed was not allocated

malloc: *** error for object 0x70000021c7d0: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

void WebPSafeFree(void* const ptr) {
if (ptr != NULL) {
Increment(&num_free_calls);
SubMem(ptr);
}
** free(ptr);
**
Crashing in last line.

let me know if anything else is required .
Xcode: 7.1.2
Sim: iPhone6S Plus
iOS: 9.2

Thanks in advance !

Only encodes BGRA images

Images that are not in BGRA format don't work, you have hard-coded the encoder to:

WebPPictureImportRGBA(&pic, webPImageData, (int)webPBytesPerRow);
WebPPictureARGBToYUVA(&pic, WEBP_YUV420);

ENABLE_BITCODE = "No", no more supportive with Xcode 7.1

WebP.framework has build with Enable Bitcode = "No",When I have added this library with latest Xcode,throwing this error:
WebP.framework/WebP(libwebpdecode_la-webp.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64.

Can you provide latest library with ENABLE_BITCODE = YES

armv7k architecture is not supported

We want to use this framework with WatchOS2 but get an error for the framework file: file is universal (5 slices) but does not contain a(n) armv7k slice

can't install with pod

because I am in the wall(built by the great PRC) ?how can I fix that .

[!] Error installing libwebp
[!] /usr/bin/git clone https://chromium.googlesource.com/webm/libwebp /var/folders/5v/nwy8rsn57gv54vswtjbx1_sr0000gn/T/d20180405-24822-1tunis3 --template= --single-branch --depth 1 --branch v0.5.0

Cloning into '/var/folders/5v/nwy8rsn57gv54vswtjbx1_sr0000gn/T/d20180405-24822-1tunis3'...
fatal: unable to access 'https://chromium.googlesource.com/webm/libwebp/': Failed to connect to chromium.googlesource.com port 443: Operation timed out

Memory leak

If you profile the Demo app with the Leaks instrument, it shows a leak, in the line where it calls WebPEncode. I am using the latest release version of Xcode.

Demo isn't working.

Right now if you download the repo and run the demo (iOS-WebP.xcodeproj) it doesn't work. There's just a blank white space where the image should be. I spent about an hour trying to debug it but didn't get anywhere.

img_0358

Why create a local variable queue in asynchronous methods?

In your asynchronous decoding methods (imageWithWebP:completionBlock:failureBlock: and imageToWebP:quality:alpha:preset:configBlock:completionBlock:failureBlock:), you create a local variable dispatch queue "toWebPQueue". What's the point of creating a local dispatch queue that is going to be used just once? Why not just use a global queue?

out of memory , when change images

it's out of memory , when I change some images to webp .

dispatch_queue_t changeToWebp = dispatch_queue_create("changeToWebp", NULL);
dispatch_async(changeToWebp, ^{
    NSData *data = [UIImage imageToWebP:img quality:75];
});

Library for Mac OS?

@seanooi

Hi,

Is it possible to convert this iOS-WebP library to use in Mac OS?
I would like to use this library to convert image to WebP format in Mac OS.

Thanks.

when i get UIImage from ALAssetsLibrary,then use "imageToWebP"method, the image color is change

ALAssetRepresentation *assetRep = [currentAsset defaultRepresentation];
CGImageRef imgRef = [assetRep fullResolutionImage];
UIImage *postImage = [UIImage imageWithCGImage:imgRef scale:assetRep.scale orientation:UIImageOrientationUp];
NSData *imageData = [UIImage imageToWebP:postImg quality:50.f];

then show this imageData in the app, the image Color is wrong. but if I convert native png or jpg to NSData ,it is right. I don't know why.

like this ,it is right.
UIImage *image = [UIImage imageNamed:@"xxx.png"];
NSData *imageData = [UIImage imageToWebP:image quality:50.f];

'WebP/decode.h' file not found

Hi,
I am having the same issue as #1 when installed via cocoapods:

$ pod install
[...]
Using iOS-WebP (0.4)
//
//  UIImage+WebP.h
//  iOS-WebP
//
//  Created by Sean Ooi on 12/21/13.
//  Copyright (c) 2013 Sean Ooi. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <WebP/decode.h>

=> 'WebP/decode.h' file not found

Regards,

UIImageWriteToSavedPhotosAlbum() failed

    UIImageView *currentImageView  = xxx // this is a iOS webp image
// then:
    UIImageWriteToSavedPhotosAlbum(currentImageView.image, self, @selector(image:didFinishSavingWithError:contextInfo:), NULL);

- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo;
{
// error is:
//There was a problem writing this asset because the write failed.
}

Push a new release.

It does not look like v. 0.5 has made it into the cocoapods repository yet,

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.