Skip to content

WIP: plug-ins: fix #3444 Invalid file names when importing PDF as images

Issue was caused by presence of . (dot) character in import file name.

Summary of changes.

  • Dot characters in import file name are replaced with dashes
  • Numbers are left padded with zeros when necessary

(caveat) PDF plug-in code correctly sets the names for all images but name of the first image resets back to import file name in the calling code (see file-import.c lines 107-110).

/* Remember the import source */
gimp_image_set_imported_file (image, file);

/* We shall treat this file as an Untitled file */
gimp_image_set_file (image, NULL);

While it's possible to add a workaround the result is far from perfect. Changes to it will require to change the other plugins code in order to preserve the behavior of Save As operation.

Current behavior of Save As dialog after importing any image -> Display just the name without extension (and assume xcf)

By not treating imported image as 'untitled' changes the behavior of Save as dialog to show import source file name with extension e.g. if we import pdf then Save dialog will show name.pdf instead of just name. As result 'Save As' dialog behaves as "Export As" which is not intended behavior.

Edited by Stanislav Grinkov

Merge request reports