Opened 6 years ago

Last modified 3 months ago

#14930 new bug

Icon-O-Matic bugs when exporting to png set

Reported by: MarshallBanana Owned by: stippi
Priority: normal Milestone: Unscheduled
Component: Applications/Icon-O-Matic Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description (last modified by pulkomandy)

1: If I want to save the png exports to the same directory, I’m asked if I want to overwrite the original, but the export files are supposed to have different filenames (MyIcon becomes MyIcon_{64|16|32}.png). Confirming this will not overwrite the original file at all.

2: If the filename is too long, it will be truncated without appending the proper extension, resulting in the exported filenames all being the same. So Instead of LONGNAME being saved to TRUNCATED_{64|16|32}.png there is only 1 file with a truncated name. The issue is in the file src/apps/icon-o-matic/document/savers/BitmapSetSaver.cpp.

3: The buffer for the filename is set to the length B_OS_NAME_LENGTH, but it should be B_FILE_NAME_LENGTH. Can be ignored through if you use BString.

Attachments (1)

BitmapSetSaver.cpp.diff (1.1 KB ) - added by MarshallBanana 6 years ago.

Download all attachments as: .zip

Change History (11)

by MarshallBanana, 6 years ago

Attachment: BitmapSetSaver.cpp.diff added

comment:1 by stippi, 6 years ago

Thanks for the patch! Can you instead upload a change to Gerrit? See CodingGuidelines/SubmittingPatches for details on that.

About the misleading "Overwrite warning": The problem here is who shows this warning is not aware that the file will actually not be overwritten. Instead, there is a chance to overwrite an existing PNG set, but no warning will be shown if there is. A mechanism should be designed by which the Exporter implementation can detect the situation and display a warning.

in reply to:  1 comment:2 by MarshallBanana, 6 years ago

Replying to stippi:

Thanks for the patch! Can you instead upload a change to Gerrit? See CodingGuidelines/SubmittingPatches for details on that.

About the misleading "Overwrite warning": The problem here is who shows this warning is not aware that the file will actually not be overwritten. Instead, there is a chance to overwrite an existing PNG set, but no warning will be shown if there is. A mechanism should be designed by which the Exporter implementation can detect the situation and display a warning.

It's a very small change, I think you can do it all by yourself ;-)

comment:3 by pulkomandy, 4 years ago

Description: modified (diff)

Modified version of the patch applied in hrev54486. The first problem still remains.

comment:4 by boody, 3 months ago

Is the issue still valid? Can I work on it?

comment:5 by humdinger, 3 months ago

You could've just tried yourself... Yep. Still valid, go for it!

comment:6 by boody, 3 months ago

I'm still kind of new to haiku. Is the ticket asking to remove the warning if I export to the same directory?

comment:7 by nephele, 3 months ago

Icon-O-Matic is a vector image editor, it can export images as a png set, it will make (from a file called Icon) files called Icon_32.png Icon_64.png

The ticket is about a warning that appears about a file beeing overwritten if you do that, but it actually is not overwritten thus the warning is not needed.

If i read this correctly it will warn about overwriting the file "Icon" but instead only create "Icon_32.png", "Icon_64.png" and "Icon_16.png" while not touching "Icon"

The warning should still appear if you actually overwrite files.

Hope this helps clear it up :)

comment:8 by boody, 3 months ago

Actually it will never overwrite the files. So the warning should never appear I guess. Could I get any hint on where to look? I'm trying to find the source of the issue But I can't seem to reach to anything useful

comment:9 by nephele, 3 months ago

why would it never overwrite them? If you export the icon with the same name twice it would overwrite the old export, so the warning seems valid to me?

As to where the warning is generated i'm not sure. It sounds like a generic tracker one to me. I would probably start searching in icon-o-matics sources, and maybe try to grep for the warning text. Though it could also be tracker issuing the warning.

comment:10 by boody, 3 months ago

Sorry that was a mistake it can actually overwrite files

Note: See TracTickets for help on using tickets.