Skip to content

Low-level cairo_image_surface_create error on failed make-bitmap #61

@jasonhemann

Description

@jasonhemann

Hi,

On my Apple M1 Max running 14.3 Sonoma, an overly-large bitmap surfaces a fairly low-level error

#lang racket
(require racket/draw)

(make-bitmap 2147483648 1)
------------------------------------------------------
Welcome to DrRacket, version 9.1 [cs].
Language: racket, with test coverage [custom]; memory limit: 256 MB.
. . cairo_image_surface_create: given value does not fit primitive C type
  C type: _int32
  value: 2147483648
> 

I don't know what the better thing to do is, but this peeks out through the htdp lang image library, and I would think that there we'd want to have a nicer domain-level error message. For instance:

#lang htdp/isl+
(require 2htdp/image)

(save-image
 (rectangle 2147483648 1 "solid" "black")
 "huge.png")

maybe something like "image is too large to render"?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions