Opened 8 weeks ago

Last modified 4 days 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:
Has a Patch: yes Platform: All

Description

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 8 weeks ago.

Download all attachments as: .zip

Change History (3)

Changed 8 weeks ago by MarshallBanana

Attachment: BitmapSetSaver.cpp.diff added

comment:1 Changed 8 weeks ago by 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.

comment:2 in reply to:  1 Changed 4 days ago by MarshallBanana

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 ;-)

Note: See TracTickets for help on using tickets.