rageworx / fl_imgtk

FLTK image toolkit for some useful effects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rotate180 may be hard-coded for 24-bit

fire-eggs opened this issue · comments

I've been having some problems with rotate180.

  1. Images of depth 4 (e.g. PNG with transparency), the transparent bits aren't rotated properly.
  2. Images of depth 1 seem to result in a memory corruption crash when displayed.

I believe these lines:

            fl_imgtk_swap_mem( &buff[ cnt * d ],
                               &buff[ (imgmax - cnt - 1) * d ],
                               3);

should be:

            fl_imgtk_swap_mem( &buff[ cnt * d ],
                               &buff[ (imgmax - cnt - 1) * d ],
                               d);

I.e. not hard-coding 24 bits of image depth.

Here is a depth 1 PNG file:
3016021.png.zip

And here is a depth 4 PNG:
19000.png.zip

Dear Kevin,
Thank you for your advice, it must be my fault ( maybe it belong to merge from old source ).
I will just fix it now.

Latest change tested with 32bit PNG:
image
You can refer to these prebuilt win64pe image zip:
fltk_fl_imgtk_test_gee_techdemo_win64.zip

Commited this issue for 1cdf2bf..272e2ff.
You can pull, and test it agian.
FL_IMGTK version build may increased to 26 from 25.

Update : fixed some RGBA source issues, commit of 272e2ff..528aa48.
Please check latest changes.
(plus)
Here latest version of fl_imgtk tech demo (build 15)
fltk_fl_imgtk_test_gee_techdemo_win64-15.zip

Looks good to me, I'll try out the other changes soon!