Changeset 3020 for libpipi/trunk


Ignore:
Timestamp:
Oct 19, 2008, 1:05:47 PM (12 years ago)
Author:
Jean-Yves Lamoureux
Message:
  • CoreImage? loader fails cleanly when specified image doesn't exist
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpipi/trunk/pipi/codec/coreimage.m

    r3019 r3020  
    3232    CIImage *source;
    3333    NSURL *url = [NSURL fileURLWithPath:n];
     34   
    3435    source = [CIImage imageWithContentsOfURL:url];
     36   
     37    if(source == NULL) return NULL;
     38   
    3539    CGRect extent = [source extent];
    3640    size_t w = (size_t)extent.size.width;
     
    4448    img = pipi_new(w, h);
    4549    img->p[PIPI_PIXELS_RGBA_C].pixels = [myImage bitmapData];
    46     img->p[PIPI_PIXELS_RGBA_C].w = w;
    47     img->p[PIPI_PIXELS_RGBA_C].h = h;
    48     img->p[PIPI_PIXELS_RGBA_C].pitch = ([myImage bytesPerRow]/8) * img->w;
    49     img->p[PIPI_PIXELS_RGBA_C].bpp = [myImage bitsPerPixel];
    50     img->p[PIPI_PIXELS_RGBA_C].bytes = ([myImage bitsPerPixel]/8) * img->w * img->h;
    51     img->last_modified = PIPI_PIXELS_RGBA_C;
     50    img->p[PIPI_PIXELS_RGBA_C].w      = w;
     51    img->p[PIPI_PIXELS_RGBA_C].h      = h;
     52    img->p[PIPI_PIXELS_RGBA_C].pitch  = ([myImage bytesPerRow]/8) * img->w;
     53    img->p[PIPI_PIXELS_RGBA_C].bpp    = [myImage bitsPerPixel];
     54    img->p[PIPI_PIXELS_RGBA_C].bytes  = ([myImage bitsPerPixel]/8) * img->w * img->h;
     55    img->last_modified                = PIPI_PIXELS_RGBA_C;
    5256
    5357    img->codec_priv = (struct pipi_codec_coreimage *) malloc(sizeof(struct pipi_codec_coreimage *));
Note: See TracChangeset for help on using the changeset viewer.