Summary: | Changing jpg to jpeg | ||
---|---|---|---|
Product: | [Applications] kolourpaint | Reporter: | Dotan Cohen <kde-2011.08> |
Component: | general | Assignee: | kolourpaint-support |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | andresbajotierra, contact |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Unspecified | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Dotan Cohen
2009-05-20 11:36:11 UTC
Just investigating the code: If you open a *.jpeg file first this also happens This is why: - JPEG is considered a format when you can specify a save quality When you load a JPG image, it has an "invalid save quality" , so when you select "Save" the first time, it allows you to select the filename(if you want to change it) and the save quality. - When you select Save a second time it works properly without asking. The problem is: the default extension for the image/jpeg mimetype is "jpeg" (not "jpg"), so the save dialog uses that extension. So... possible solutions: - Assume a 100% save quality for the "Save"(not "Save as") action - Force(or add) the "jpg" extension. - Any other idea? Thanks > The problem is: the default extension for the image/jpeg mimetype > is "jpeg" (not "jpg"), so the save dialog uses that extension. I think that the best solution (not workaround) would be to either make a duplicate image/jpg mimetype, or if possible alias jpg to jpeg. According to Google, there is an order of magnitude more photos named *.jpg than *.jpeg, so even switching the mimetype to image/jpg would be better than nothing: http://www.google.com/search?q=jpeg Results 1 - 20 of about 125,000,000 for jpeg http://www.google.com/search?q=jpg Results 1 - 20 of about 1,470,000,000 for jpg Look at bug 176737. Thank you Dario, I wonder why the BKO search did not turn that up! It does appear that the bugs have the same root cause, though I am hesitant to mark this one as a dupe. I'll leave that decision up to a dev. According to Pino both "jpeg" and "jpg" have both the same priority. Also, if we change the default to "jpg". If someone opens a .jpeg file , it will be prompted to save it as jpg. (and may be that is not what the user wants) So I guess this could be fixed locally forcing the current extension on the first save file dialog (I need to investigate a bit...) > So I guess this could be fixed locally forcing the
> current extension on the first save file dialog
Yes, that seems to be _the_solution_ as opposed to a workaround. Thanks.
*** Bug 194637 has been marked as a duplicate of this bug. *** Ok, I managed to get a solution: On the save dialog function, check the mimetype of the current filename, if it is the same as the "desired default mimetype", then, re-use the filename (instead of automatically assign other extension) So, with a file "a.jpg" , it will detect that its mimetype is "image/jpg", and then it will set the save name on the file dialog to "a.jpg" (instead of the default "a.jpeg"). This will also honor the custom case on the extension (".JPG"/".JpG"/".JPeG", whatever) However, changing the file type to anything else and change it back to JPEG Image will revert this extension. But it is a good first approach. I'm going to commit soon BTW: I just tested with a JPG file renamed to use a png or bmp extension, and they were not recognized nor opened, so my fix will not affect this. SVN commit 977265 by darioandres: File save dialog behaviour fix: Honor the current filename if its mimetype is the same as the current format (honor "JPG" over "jpeg" if the file is named "foobar.JPG") BUG: 193339 M +5 -0 kpMainWindow_File.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=977265 Thanks, Dario! |