[racket] 2htdp/image: Silent cropping?

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Sat Jan 24 15:45:36 EST 2015

Well, I couldn't just do that, because I had implemented the
limitation in a stupid way.  So I changed the limitation so that it
limits the area instead of the width and height (the point is to limit
the memory use and the memory use is proportional to the area). So the
example upthread now works fine, as it should.

I've also documented the limitation in the 2hdtp/images docs.

Robby


On Sat, Jan 24, 2015 at 12:56 PM, Jordan Johnson <jmj at fellowhuman.com> wrote:
> I'd be fine with that solution.
>
> Best,
> Jordan
>
>> On Jan 24, 2015, at 7:10 AM, Matthias Felleisen <matthias at ccs.neu.edu> wrote:
>>
>>
>> I prefer leaving it alone but documenting the limitation -- Matthias
>>
>>
>>
>>
>>
>>> On Jan 23, 2015, at 9:30 PM, Robby Findler wrote:
>>>
>>> Maybe the right thing to do is leave the arbitrary limit in there, but
>>> make it based on the area, not based independently on the width and
>>> height. Then your example would work, but (ellipse 5050 5050)
>>> wouldn't.
>>>
>>> Robby
>>>
>>>
>>> On Fri, Jan 23, 2015 at 8:22 PM, Robby Findler
>>> <robby at eecs.northwestern.edu> wrote:
>>>> Yes, 2htdp/image truncates the images to 5000x5000 when building a bitmap.
>>>>
>>>> I did that in response to this PR:
>>>>
>>>> http://bugs.racket-lang.org/query/?debug=&database=default&cmd=view+audit-trail&cmd=view&pr=12277
>>>>
>>>> but I'm not sure what's the right answer here. I'm hesitant to add
>>>> errors but maybe that's the best thing.
>>>>
>>>> Robby
>>>>
>>>>
>>>>> On Fri, Jan 23, 2015 at 7:52 PM, Jordan Johnson <jmj at fellowhuman.com> wrote:
>>>>> Hi all,
>>>>>
>>>>> A student of mine noticed yesterday that part of an image was getting
>>>>> truncated. Some further experimentation in BSL yielded this example:
>>>>>
>>>>> (ellipse 5050 100 'solid 'blue) ; => image with 50 pixels missing at right
>>>>> end
>>>>> (ellipse 100 5050 'solid 'blue) ; => image with 50 pixels missing at bottom
>>>>>
>>>>> For both images, the image-{width,height} functions produce 100 and 5050;
>>>>> the library simply doesn't draw the entire ellipse, although click-and-drag
>>>>> highlighting does show the image as having 50 extra blank pixels at the end.
>>>>>
>>>>> I can't find documentation of the size limits. Is this intended behavior? If
>>>>> so, an error might be more student-friendly.
>>>>>
>>>>> Cheers,
>>>>> Jordan
>>>>>
>>>>>
>>>>> ____________________
>>>>> Racket Users list:
>>>>> http://lists.racket-lang.org/users
>>> ____________________
>>> Racket Users list:
>>> http://lists.racket-lang.org/users
>>

Posted on the users mailing list.