Low-level `cairo_image_surface_create` error on failed `make-bitmap`
Nobody has claimed this yet.
- Dominant language
- Racket
- Stars
- 19
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Description
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"?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the make-bitmap example and the 2htdp/image save-image example on the reported oversized dimensions. Trace how the low-level cairo_image_surface_create error reaches these entry points, then define and test a clearer domain-level error for images that are too large to render.
Written by the indexing model from the issue text.
Assessment
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100