/[emacs]/emacs/src/image.c
ViewVC logotype

Diff of /emacs/src/image.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.38 by kfstorm, Wed Oct 19 21:52:13 2005 UTC revision 1.39 by mituharu, Tue Oct 25 08:12:44 2005 UTC
# Line 2291  image_load_qt_1 (f, img, type, fss, dh) Line 2291  image_load_qt_1 (f, img, type, fss, dh)
2291    GraphicsImportComponent gi;    GraphicsImportComponent gi;
2292    Rect rect;    Rect rect;
2293    int width, height;    int width, height;
2294      ImageDescriptionHandle desc_handle;
2295    short draw_all_pixels;    short draw_all_pixels;
2296    Lisp_Object specified_bg;    Lisp_Object specified_bg;
2297    XColor color;    XColor color;
# Line 2326  image_load_qt_1 (f, img, type, fss, dh) Line 2327  image_load_qt_1 (f, img, type, fss, dh)
2327            goto error;            goto error;
2328          }          }
2329      }      }
2330    err = GraphicsImportGetNaturalBounds (gi, &rect);    err = GraphicsImportGetImageDescription (gi, &desc_handle);
2331    if (err != noErr)    if (err != noErr || desc_handle == NULL)
2332      {      {
2333        image_error ("Error reading `%s'", img->spec, Qnil);        image_error ("Error reading `%s'", img->spec, Qnil);
2334        goto error;        goto error;
2335      }      }
2336    width = img->width = rect.right - rect.left;    width = img->width = (*desc_handle)->width;
2337    height = img->height = rect.bottom - rect.top;    height = img->height = (*desc_handle)->height;
2338      DisposeHandle ((Handle)desc_handle);
2339    
2340      if (!check_image_size (f, width, height))
2341        {
2342          image_error ("Invalid image size", Qnil, Qnil);
2343          goto error;
2344        }
2345    
2346    err = GraphicsImportDoesDrawAllPixels (gi, &draw_all_pixels);    err = GraphicsImportDoesDrawAllPixels (gi, &draw_all_pixels);
2347  #if 0  #if 0
2348    /* Don't check the error code here.  It may have an undocumented    /* Don't check the error code here.  It may have an undocumented
# Line 2535  image_load_quartz2d (f, img, png_p) Line 2544  image_load_quartz2d (f, img, png_p)
2544        image_error ("Error reading image `%s'", img->spec, Qnil);        image_error ("Error reading image `%s'", img->spec, Qnil);
2545        return 0;        return 0;
2546      }      }
2547      width = img->width = CGImageGetWidth (image);
2548      height = img->height = CGImageGetHeight (image);
2549    
2550      if (!check_image_size (f, width, height))
2551        {
2552          UNGCPRO;
2553          image_error ("Invalid image size", Qnil, Qnil);
2554          return 0;
2555        }
2556    
2557    if (png_p)    if (png_p)
2558      {      {
# Line 2548  image_load_quartz2d (f, img, png_p) Line 2566  image_load_quartz2d (f, img, png_p)
2566            color.blue = BLUE16_FROM_ULONG (color.pixel);            color.blue = BLUE16_FROM_ULONG (color.pixel);
2567          }          }
2568      }      }
2569    width = img->width = CGImageGetWidth (image);  
   height = img->height = CGImageGetHeight (image);  
2570    if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap))    if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap))
2571      {      {
2572        CGImageRelease (image);        CGImageRelease (image);
# Line 4190  xpm_load_image (f, img, contents, end) Line 4207  xpm_load_image (f, img, contents, end)
4207        || width <= 0 || height <= 0        || width <= 0 || height <= 0
4208        || num_colors <= 0 || chars_per_pixel <= 0)        || num_colors <= 0 || chars_per_pixel <= 0)
4209      goto failure;      goto failure;
4210    
4211      if (!check_image_size (f, width, height))
4212        {
4213          image_error ("Invalid image size", Qnil, Qnil);
4214          goto failure;
4215        }
4216    
4217    expect (',');    expect (',');
4218    
4219    XSETFRAME (frame, f);    XSETFRAME (frame, f);

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.39

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26