-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Custom icon support #1129
Custom icon support #1129
Conversation
In the first place, this is an attempt to handle symbol icons from OCD files. However, I still don't know how to deal with OCD 8 compressed icons. I could imagine that we simply add a GUI feature for custom icon import/export (PNG) to solve or at least mitigate the popular request for editable icons (#866). In OMAP files these icons could be embedded Base64-encoded. |
First thoughts when looking at the patch set. |
I would rather not mix icons. Needing to understand alpha channel can be a little too much. Different icon resolutions may be source for surprises. Instead, the mentioned export function could easily export the default (generated) icon. I would probably add this to another settings tab. Something like:
And then, we are not far away from other customization options (rotation, path, even the existing text symbol icon text). |
Well, you could add a "overlay" checkbox 😄 |
The combination of custom icon for OCD and OMAP export is troublesome. ...bla bla bla deleted... Anyway, let's go with 22px true color icons and forget about overlaying. Although this is not "perfect", it will be understandable for end users. BTW, I'll surely be one of the early adopters. I frequently have difficulty distinguishing between contour slope line vs form line slope line and shallow body of water border line vs minor water channel. |
Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall the patch series looks good to me. There are a few suggestions to consider in review comments.
I played a bit with the compressed icons and came to the conclusion that they are perhaps (TIFF style) LZW compressed. A half black, half white icon which has 242 zeros and 242 0x7c's encodes as follows:
Unix compress program gives very similar output with the exception of the first and last code. The first dictionary code from Will you look into implementation or shall I start coding (which may take long time)?
|
GIF/TIFF/LZW were my suspects too, but I always stopped at some point. Now I finally understood a) how to decode a LZW code stream when the original data was like aSaSa (such as a plain white line), and b) how GIF turns the code stream in a bit stream.
I look into implementation again now. I will drop a note if I should put this aside again. |
The initial 16 bytes have some meaning too. They are often 0xFF's but in some cases there are different values. Two examples from OCAD 8 symbol set:
There are 7 icons of this kind in the whole set. |
To me, the unused data looks to me like left-over uncompressed garbage. But I have almost finished decompression, so you can test soon. |
Indeed. All icons, including the above examples, load fine with changes from |
Embed custom icons using the "data" URL scheme.
Prior to this change, AreaSymbolSettings assumed that there was just a single ("General") tab preceding the list of tabs managed by AreaSymbolSettings. However, we need to have a variable number of general tabs, e.g. for adding a symbol icon tab.
Now all comments should be resolved. This will be merged with the compression changes, once they are complete. |
Merged. |
No description provided.