Bug 455598 - JXL ticks-per-second (tps) is inverted
Summary: JXL ticks-per-second (tps) is inverted
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Animation (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: amyspark
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-19 10:08 UTC by Alvin Wong
Modified: 2022-06-28 18:52 UTC (History)
1 user (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 Alvin Wong 2022-06-19 10:08:39 UTC
From the docs https://libjxl.readthedocs.io/en/latest/api_common.html#structJxlAnimationHeader :

tps_numerator - Numerator of ticks per second of a single animation frame time unit
tps_denominator - Denominator of ticks per second of a single animation frame time unit

Say you have a 4 fps animation, it should be tps_numerator = 4 and tps_denominator = 1. However, the current exporter is doing the inverse.
Comment 1 amyspark 2022-06-20 18:24:00 UTC
> Say you have a 4 fps animation, it should be tps_numerator = 4 and tps_denominator = 1. However, the current exporter is doing the inverse.

It's worse. If we have a 4 fps animation, it should duration = 1, tps_numerator = 4, tps_denominator = 1. But instead, libjxl sets tps_numerator = 1000, tps_denominator = 1, and then duration = 250.

In other words, the tps ratio is completely decoupled from the actual framerate, and this makes the format just as cursed as WebP...
Comment 2 Bug Janitor Service 2022-06-20 21:12:26 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1481
Comment 3 amyspark 2022-06-28 18:51:19 UTC
Git commit f74380a690a13a44a0f1a86ae1e9ef57f6d8541a by L. E. Segovia.
Committed on 28/06/2022 at 17:31.
Pushed by lsegovia into branch 'master'.

JPEG XL: fix interpretation of tps_numerator/tps_denominator
Related: bug 455597

M  +4    -2    plugins/impex/jxl/JPEGXLExport.cpp
M  +30   -10   plugins/impex/jxl/JPEGXLImport.cpp
M  +-    --    plugins/impex/jxl/tests/data/sources/DX-MON/loading_16.jxl

https://invent.kde.org/graphics/krita/commit/f74380a690a13a44a0f1a86ae1e9ef57f6d8541a
Comment 4 amyspark 2022-06-28 18:52:45 UTC
Git commit 8090850fe0feeefa58bc05d0996ad9d87dee953e by L. E. Segovia.
Committed on 28/06/2022 at 18:51.
Pushed by lsegovia into branch 'krita/5.1'.

JPEG XL: fix interpretation of tps_numerator/tps_denominator
Related: bug 455597
(cherry picked from commit f74380a690a13a44a0f1a86ae1e9ef57f6d8541a)

M  +4    -2    plugins/impex/jxl/JPEGXLExport.cpp
M  +30   -10   plugins/impex/jxl/JPEGXLImport.cpp
M  +-    --    plugins/impex/jxl/tests/data/sources/DX-MON/loading_16.jxl

https://invent.kde.org/graphics/krita/commit/8090850fe0feeefa58bc05d0996ad9d87dee953e