Recent

Author Topic: Broken Icon Display on macOS  (Read 1944 times)

msintle

  • Full Member
  • ***
  • Posts: 135
Re: Broken Icon Display on macOS
« Reply #15 on: September 12, 2024, 04:46:35 pm »
If you use Lazarus/FPC in production you should not base your software on the main (trunk) versions. They are in active development, and it is always possible that bugs creep in.

That is absolutely correct, but our software actually only runs on the trunk version (for now at least), so we're in a bit of a bind.

The good news is that the response here at the forums - and at GitLab - has been absolutely commendable, this is greatly appreciated.

Thank you very much once again to everyone involved - I can say easily no commercial company today is likely to match this level of support!!!

circular

  • Hero Member
  • *****
  • Posts: 4348
    • Personal webpage
Re: Broken Icon Display on macOS
« Reply #16 on: September 13, 2024, 07:06:36 am »
Regarding regressions, this could be avoided with some level of unit testing. Of course writing tests takes time, so we may not have the bandwidth to implement them.

There is a framework for unit testing. So it is possible to create unit tests with Lazarus:
https://sergworks.wordpress.com/2012/08/31/introduction-to-unit-testing-with-lazarus/

I don't know if there are some for the LCL.

ETA = estimated time of arrival?

Don't ask, we're all volunteers without payment. You could help by working on the issue yourself and send a patch. That's "open source".
While I get your point and agree that we may not be able to solve issues quickly, bugs may impact various people and so there is some motivation to take care of bugs.

Regarding the ETA, I guess the answer is simply that we don't have time estimates. And making time estimates... does take time.
Conscience is the debugger of the mind

dsiders

  • Hero Member
  • *****
  • Posts: 1238
Re: Broken Icon Display on macOS
« Reply #17 on: September 13, 2024, 07:31:54 am »
I don't know if there are some for the LCL.

See $(LazarusDir)/test/.
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

circular

  • Hero Member
  • *****
  • Posts: 4348
    • Personal webpage
Re: Broken Icon Display on macOS
« Reply #18 on: September 14, 2024, 02:15:01 am »
Thanks dsiders for locating the test folder.

So there is a base structure for testing, however very few tests are implemented.
Conscience is the debugger of the mind

wp

  • Hero Member
  • *****
  • Posts: 12345
Re: Broken Icon Display on macOS
« Reply #19 on: September 14, 2024, 01:09:13 pm »
How would you write a test for visual issues like this one?

dsiders

  • Hero Member
  • *****
  • Posts: 1238
Re: Broken Icon Display on macOS
« Reply #20 on: September 14, 2024, 10:07:24 pm »
How would you write a test for visual issues like this one?

Exactly.
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

lainz

  • Hero Member
  • *****
  • Posts: 4593
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Broken Icon Display on macOS
« Reply #21 on: September 14, 2024, 10:26:31 pm »
Take a screenshot of the bitmap area, and compare pixel by pixel with some other bitmap.

wp

  • Hero Member
  • *****
  • Posts: 12345
Re: Broken Icon Display on macOS
« Reply #22 on: September 14, 2024, 10:40:43 pm »
How would you handle transparency then (alpha channel of png images, or mask of ico images)?

lainz

  • Hero Member
  • *****
  • Posts: 4593
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Broken Icon Display on macOS
« Reply #23 on: September 14, 2024, 10:54:02 pm »
How would you handle transparency then (alpha channel of png images, or mask of ico images)?

Easy. Blend the example bitmap (that's the same as the target ico) with a background, that's the same background of the form where is placed the icon.

You need to use the same technique used by the LCL to compute the alpha.

circular

  • Hero Member
  • *****
  • Posts: 4348
    • Personal webpage
Re: Broken Icon Display on macOS
« Reply #24 on: September 16, 2024, 09:51:47 am »
How would you handle transparency then (alpha channel of png images, or mask of ico images)?
You need to use the same technique used by the LCL to compute the alpha.
Indeed, that would be a linear blend (dmLinearBlend in BGRABitmap). Though as you said before, one can rely on a screenshot, to have minimal dependencies.
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4593
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Broken Icon Display on macOS
« Reply #25 on: September 16, 2024, 06:29:55 pm »
How would you handle transparency then (alpha channel of png images, or mask of ico images)?
You need to use the same technique used by the LCL to compute the alpha.
Indeed, that would be a linear blend (dmLinearBlend in BGRABitmap). Though as you said before, one can rely on a screenshot, to have minimal dependencies.

And what about the gamma correction? in BGRABitmap?

circular

  • Hero Member
  • *****
  • Posts: 4348
    • Personal webpage
Re: Broken Icon Display on macOS
« Reply #26 on: September 16, 2024, 07:40:20 pm »
The gamma correction is when the blend is not linear. When drawing on the canvas, it is using system rendering that is always linear in my experience, so no gamma involved.
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4593
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Broken Icon Display on macOS
« Reply #27 on: September 16, 2024, 07:53:29 pm »
The gamma correction is when the blend is not linear. When drawing on the canvas, it is using system rendering that is always linear in my experience, so no gamma involved.

Ok thanks. So BGRABitmap can be used to make the test.

circular

  • Hero Member
  • *****
  • Posts: 4348
    • Personal webpage
Re: Broken Icon Display on macOS
« Reply #28 on: September 17, 2024, 09:46:52 am »
Well in this case, this could be done purely with the LCL as follows:
- on a canvas, fill with a color
- then draw the icon (in dev, save the result into a file as BMP)
- compare the result with the BMP (pixel by pixel or byte by byte)

BGRABitmap could help for the pixel by pixel comparison, though it is not necessary. In fact, in the test, it would be better to have minimal dependencies, to test for the LCL itself. Also BGRABitmap could override the icon format handlers and hide the problem away somehow.
Conscience is the debugger of the mind

msintle

  • Full Member
  • ***
  • Posts: 135
Re: Broken Icon Display on macOS
« Reply #29 on: September 17, 2024, 10:09:18 pm »
This issue has been definitively resolved - thank you all, including rich of course!

 

TinyPortal © 2005-2018