[cairo] invalid value (typically too big) for the size of the input (surface, pattern, etc.)

cu cairouser at yahoo.com
Wed Dec 22 07:13:55 PST 2010


Ah, my bad - I thought the question referred to dimensions of drawn
objects, not the actual size of image surface.

Yes, 32K pixels seems a reasonable limit for a memory-based surface,
although perhaps it would make sense to limit a total size (to allow for
something like 10 x 35000, which is quite a bit smaller than 20000 x 20000).

Jonathan Morton wrote:
> On Wed, 2010-12-22 at 10:02 +0200, M Joonas Pihlaja wrote:
>   
>>> I thought it was 2^24 ? Was this reduced?
>>>       
>> The integer part of the fixed point type used to represent paths is 24
>> bits wide, so the limit there is about +-8M.  The 32767 limit on the
>> width/height dimensions of an image surface is new in 1.10.  In
>> previous versions we'd just render bad things (and sometimes still do,
>> but not so much.)  Other backends can have larger or (typically)
>> smaller limits on width/height due to different hardware limitatons
>> for example.
>>     
>
> Also, 32767x32767 is about a billion pixels.  You'll have trouble
> allocating that much RAM on a 32-bit machine.
>
>   



More information about the cairo mailing list