Closed naturalmechanics closed 1 year ago
Yes, it seems that integer overflow occurs while computing index
with such large values. I've never tested such extreme cases, so it's possible that images exceeding int.max
in size are not manageable adequately. This is a bug, but unfortunately it can't be fixed in no time and needs careful code audit.
I've decided to close this, because allocating and managing arrays that don't fit in memory is outside the scope of dlib.image
. While theoretically possible, implementing such a system means a complete overhaul of how dlib handles images. This looks like too much work to support a rarely used/too specific case.
If i want to create an image with this code:
where
[ width, height ] = [299341, 270985]
, I run into the error :core.exception.RangeError@../../../../.dub/packages/dlib-0.20.0/dlib/dlib/image/image.d(288): Range violation
I looked in the image.d file. The relevant code is :
I notice, that for a large value of x or y, the value of
index
explodes. I presume that it has something to do with the_pixelSize
parameter. I cant find any documentation on this regard.Any help would be appreciated.