bgrabitmap / lazpaint

🎨 Cross-platform image editor with raster and vector layers similar to Paint.Net written in Lazarus (Free Pascal)
https://lazpaint.github.io/
GNU General Public License v3.0
405 stars 57 forks source link

EIntOverflow with 32 bit binary #26

Closed lainz closed 5 years ago

lainz commented 6 years ago

lazpaint

        {$hints off}
        ec.red := (ec.red*($FFFF-gray)+level*gray) shr 16;
        ec.green := (ec.green*($FFFF-gray)+level*gray) shr 16;
        ec.blue := (ec.blue*($FFFF-gray)+level*gray) shr 16;
        {$hints on} 

Hi, this happens when I run LazPaint 'Debug' 32 bit, compiled with Lazarus Trunk and FPC Trunk. When compiled in 'Debug' 64 bit it works fine.

I don't know if is still a good idea to mantain 32 bit Windows, since only really old PC still uses 32 bit.

lainz commented 6 years ago

Some statistics (mainly gamers, but I think graphic editing should be the same) https://store.steampowered.com/hwsurvey/

Also I have a Windows 10 VM with only 1.5 GB of RAM, so the myth that it requires at least 4 gb is not true. Of course is recommended, but not neccessary.

circular17 commented 5 years ago

Oops it seems I missed this issue. I fixed it with on dev branch:

        {$hints off}
        ec.red := (ec.red*(not gray)+level*gray) shr 16;
        ec.green := (ec.green*(not gray)+level*gray) shr 16;
        ec.blue := (ec.blue*(not gray)+level*gray) shr 16;
        {$hints on}