Bug 451473 - The "Animated PNG Image" export has file extension .png instead of .apng
Summary: The "Animated PNG Image" export has file extension .png instead of .apng
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: File formats (show other bugs)
Version: 5.0.2
Platform: Compiled Sources Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-13 23:32 UTC by Andreich_DMBL
Modified: 2022-03-27 03:58 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreich_DMBL 2022-03-13 23:32:00 UTC
SUMMARY
When using "Render Animation" after setting the "Render as:" value to "Animated PNG Image", the "Video Location" line for the output file specifies the file extension.png instead .apng
The content of the exported video file corresponds to the file extension .apng
But a video file with the .png file extension may not be imported correctly into other video editors (for example VSDC)
Manual correction .png to .apng in the "Video Location" line is reset when the "Render Animation" window is restarted

STEPS TO REPRODUCE
use "Render Animation" to set " Render as:" to "Animated PNG Image" and export the animation.

OBSERVED RESULT
Exported video file with .png extension
The content of the exported video file corresponds to the file extension .apng

EXPECTED RESULT
Exported video file with .аpng extension

Krita

 Version: 5.0.2
 Languages: en_US, en, en_US, en, en_US, en, en_US, en, en_US, en, en_US, en, en_US, en, en_US, en, ru_RU, ru, en_US, en
 Hidpi: true

Qt

  Version (compiled): 5.12.12
  Version (loaded): 5.12.12

OS Information

  Build ABI: x86_64-little_endian-llp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: winnt
  Kernel Version: 10.0.19044
  Pretty Productname: Windows 10 (10.0)
  Product Type: windows
  Product Version: 10
Comment 1 Ahab Greybeard 2022-03-14 05:32:50 UTC
I can confirm that this is the case for the 5.0.2 appimage and the Mar 13 5.1.0-prealpha (git 620fbcbdcb) appimage on Debian 10.

When 'Animated PNG Image' is selected, the output video file location is set to .png.
(This can be manually corrected if the user notices it.)
If the 'Select file name' icon is clicked then the file name extension is changed to .apng.
Comment 2 Know Zero 2022-03-14 06:37:13 UTC
Since I worked on this code, can I assign this bug to myself?
Comment 3 Halla Rempt 2022-03-17 13:31:03 UTC
Sure!
Comment 4 Bourumir Wyngs 2022-03-20 14:43:08 UTC
This is a feature, not a bug. In KisDlgAnimationRenderer::defaultVideoFileName we see:

videoFileName =
            QString("%1%2%3.%4").arg(path).arg('/').arg(baseName).arg(KisMimeDatabase::suffixesForMimeType( mimeType == "image/apng" ? "image/png":mimeType ).first());

Please confirm it is OK to remove the "feature", it is not a big work for us to do this. If I just remove this override, KisMimeDatabase database suggests .apng for image/apng and the file name is suggested as expected.

Also, calling first() on empty list may result the undefined behavior. We should probably have a check there.
Comment 5 Know Zero 2022-03-21 04:23:30 UTC
@Bourumir Wyngs - The problem here isn't the mimetype, the problem here is the format. When you save via dialog, the default format is .apng, and the default in the entry is .png. It should be consistent. While technically, both apng and png formats are correct formats. Since apng has not officially be accepted by the PNG WorkGroup it probably make sense to keep the format apng.
Comment 6 Know Zero 2022-03-27 03:58:25 UTC
Git commit 74264d2a7f70b179dbc52dc837a1249a0bd288f4
Mon, 21 Mar 2022 01:14:30 -0400

[PATCH] Bugfix: Make APNG format for export consistent

This patch makes apng the default format in the filename textbox for
export instead of png, making it consistent with the file dialog.

Fixes BUG #451473
---
 libs/ui/animation/KisDlgAnimationRenderer.cpp  | 4 ++--
 libs/ui/animation/VideoExportOptionsDialog.cpp | 4 ++--
 libs/ui/animation/VideoExportOptionsDialog.h   | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

https://invent.kde.org/graphics/krita/-/commit/74264d2a7f70b179dbc52dc837a1249a0bd288f4