ksnip / kImageAnnotator

Tool for annotating images
GNU Lesser General Public License v3.0
83 stars 41 forks source link

Allow adding png files as sticker #254

Open lrafa opened 3 years ago

lrafa commented 3 years ago

New custom stickers can be added, they appear in the toolbar, but they show as a blank rectangle when you try to add them on the image.

Desktop:

Additional context Custom sticker appears in $HOME/.local/ksnip/ksnip. It doesn't matter if it is JPG or PNG. It doesn't matter if it has transparency or not. When running from console, the following message appears:

Warning: Cannot read file '[filepath]', because: Encountered incorrectly encoded content. (line 1)

Screenshot_20210903_095204

DamirPorobic commented 3 years ago

Can you upload the sticker here?

lrafa commented 3 years ago

Can you upload the sticker here?

asdfadsf

DamirPorobic commented 3 years ago

You mention jpg and png, should it be a vector image, like svg?

lrafa commented 3 years ago

You mention jpg and png, should it be a vector image, like svg?

I don't know, you answer me? xD Do stickers need to be vector images? Sounds rather limited. If that's the case, then I'd create a feature request for supporting bitmap stickers.

DamirPorobic commented 3 years ago

Yeah, just had a loon into the code, it's an svr renderer that paints the image. The need to be vector came from the idea that it should be scaleable and resizable, you can do that only with vector images.

lrafa commented 3 years ago

Yeah, just had a loon into the code, it's an svr renderer that paints the image. The need to be vector came from the idea that it should be scaleable and resizable, you can do that only with vector images.

Yes, but it is not like emojis are meant to be large anyway. A 128x128 image would likely be more than enough for emoji usage. Anyway, it would be nice to give the user the choice (if it looks terrible, well, their fault). Would it be too complicated to use QPixmap instead?

DamirPorobic commented 3 years ago

No, I'm not saying that it's not possible, it's just currently not supported because I had this scaling in mind so I went with SVGs. Just switching to Pixmap is not going to work because those cannot scale so we need to figure some clever way for those both to coexist.