Sean | 21 Dec 02:03 2010
Picon

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

Hi Cairo Developers,

I got the error from below's code in latest cairo version(1.10.0). My height and width is more that 32767.
Is there a limited size for surface? Thanks.

_image =  new unsigned char[height * pitch];
memset(_image, 0, height * pitch * sizeof(unsigned char));
_surface = ::cairo_image_surface_create_for_data(_image
, CAIRO_FORMAT_A8
, width
, height
, pitch);

From,
Sean

"naughty in the way of creative, not mischief"

--
cairo mailing list
cairo <at> cairographics.org
http://lists.cairographics.org/mailman/listinfo/cairo
M Joonas Pihlaja | 21 Dec 08:23 2010
Picon
Picon

Re: invalid value (typically too big) for the size of the input (surface, pattern, etc.)


On Tue, 21 Dec 2010, Sean wrote:

> I got the error from below's code in latest cairo version(1.10.0). My height
> and width is more that 32767.
> Is there a limited size for surface? Thanks.

Yes.  It depends on the surface type, but for image surfaces it's
32767.

Cheers,

Joonas
--
cairo mailing list
cairo <at> cairographics.org
http://lists.cairographics.org/mailman/listinfo/cairo

cu | 22 Dec 01:28 2010
Picon

Re: invalid value (typically too big) for the size of the input (surface, pattern, etc.)

I thought it was 2^24 ? Was this reduced?

M Joonas Pihlaja wrote:
> On Tue, 21 Dec 2010, Sean wrote:
>
>   
> Yes.  It depends on the surface type, but for image surfaces it's
> 32767.
>
> Cheers,
>
> Joonas
> --
> cairo mailing list
> cairo <at> cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo
>   

--
cairo mailing list
cairo <at> cairographics.org
http://lists.cairographics.org/mailman/listinfo/cairo

M Joonas Pihlaja | 22 Dec 09:02 2010
Picon
Picon

Re: invalid value (typically too big) for the size of the input (surface, pattern, etc.)


On Tue, 21 Dec 2010, cu 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.

Cheers,

Joonas
--
cairo mailing list
cairo <at> cairographics.org
http://lists.cairographics.org/mailman/listinfo/cairo

Jonathan Morton | 22 Dec 10:34 2010

Re: invalid value (typically too big) for the size of the input (surface, pattern, etc.)

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.

--

-- 
------
From: Jonathan Morton
      jonathan.morton <at> movial.com

--
cairo mailing list
cairo <at> cairographics.org
http://lists.cairographics.org/mailman/listinfo/cairo

cu | 22 Dec 16:13 2010
Picon

Re: invalid value (typically too big) for the size of the input (surface, pattern, etc.)

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.
>
>   

--
cairo mailing list
cairo <at> cairographics.org
http://lists.cairographics.org/mailman/listinfo/cairo


Gmane