Gimp chooses invalid filenames after importing a multi page pdf, so saving the image failes
GIMP version:
$ gimp -v
GNU Image Manipulation Program version 2.10.10
git-describe: GIMP_2_10_8-775-g596f855749
C compiler:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --enable-libmpx --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --enable-multilib --disable-werror --enable-checking=release --enable-default-pie --enable-default-ssp --enable-cet=auto
Thread model: posix
gcc version 8.2.1 20181127 (GCC)
using GEGL version 0.4.14 (compiled against version 0.4.14)
using GLib version 2.60.2 (compiled against version 2.60.0)
using GdkPixbuf version 2.38.1 (compiled against version 2.38.1)
using GTK+ version 2.24.32 (compiled against version 2.24.32)
using Pango version 1.43.0 (compiled against version 1.43.0)
using Fontconfig version 2.13.1 (compiled against version 2.13.1)
using Cairo version 1.16.0 (compiled against version 1.16.0)'
Operating System: Manjaro
$ uname -a
Linux cedric-pc 4.9.175-1-MANJARO #1
SMP PREEMPT Sat May 11 10:32:08 UTC 2019 x86_64 GNU/Linux
Package: Pacman -S gimp
Description of the bug
After importing a multi page pdf, I try to save the pages one by one. Page one goes ok, page 2 can't be saved, as gimp chooses an invalid file extention for them. The problem is that gimp proposes these names:
2704143.xcf
2704143.pdf-2
2704143.pdf-3
...
2704143.pdf-16
Reproduction
Is the bug reproducible? [Always]
Reproduction steps:
- Have a pdf. I've used this one for testing: 2704143.pdf
- Start Gimp.
- File-open-2704143.pdf Open pages as images - import Now each page is opened as a seperate image, and page 1 is the active image.
- File-save. Now the save dialog comes up and offers to save as 2704143.xcf
- Switch to page 2. File-save. Now the save dialog comes up and offers to save as 2704143.pdf-2 6. Save. This results in the following message: "The given "The given filename does not have any known file extension. Please enter a known file extension or select a file format from the file format list." and refuses to save the file.
Expected result: Gimp saving the file with a valid filename
Actual result: Gimp refusing to save the file
Additional information
Proposed fix:
I think the best way to solve this is to gimp generate these filenames:
2704143-01.xcf (page 1)
2704143-02.xcf (page 2)
...
2704143-16.xcf (page 16)
If a short pdf is imported (less than 10 pages) the leading zero's should be avoided:
2704143-1.xcf (page 1)
2704143-2.xcf (page 2)
...
2704143-9.xcf (page 9)