Bug 396143

Summary: Reference images with mismatching extension and MIME type break save feature
Product: [Applications] krita Reporter: Valerii Malov <jazzvoid>
Component: Tools/Reference ImagesAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: valkiria_dan
Priority: NOR    
Version: 4.1.0   
Target Milestone: ---   
Platform: Appimage   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Valerii Malov 2018-07-03 22:14:10 UTC
This is a bit of a weird case, but some websites do lie about file type, and it might make someone lose their progress unless they'll guess to clear references, so I've decided to report it anyway.

Steps to reproduce:
* Give a png image .jpeg extension (or vice versa)
* Add it via reference tool

What happens:
* No error message, but image isn't actually added on the canvas either
* Can no longer save the file, unless "Delete all reference images" button is clicked and the ghost reference is deleted

When trying to save (manually or with autosave), I get an error:

  Could not save /home/jazz/test.kra
  Reason: Failed to save the annotations for layer Layer 2..
  Failed to save the annotations for layer Layer 1.

Console log:
krita.lib.store: Store is already opened, missing close
krita.lib.store: Store is already opened, missing close
krita.lib.store: Store is already opened, missing close
krita.lib.store: Store is already opened, missing close
krita.lib.store: Store is already opened, missing close
krita.lib.store: Store is already opened, missing close
saving binary data failed
Comment 1 joupent 2018-07-07 16:21:07 UTC
Git commit e0cede285cec383a05d4727c306874ef6a11374f by Jouni Pentikäinen.
Committed on 07/07/2018 at 11:43.
Pushed by jounip into branch 'master'.

Handle failure to load reference images

M  +31   -11   libs/ui/KisReferenceImage.cpp
M  +9    -1    libs/ui/KisReferenceImage.h
M  +7    -4    libs/ui/KisView.cpp
M  +31   -1    plugins/impex/libkra/kis_kra_load_visitor.cpp
M  +19   -2    plugins/tools/defaulttool/referenceimagestool/KisReferenceImageCollection.cpp
M  +5    -3    plugins/tools/defaulttool/referenceimagestool/ToolReferenceImages.cpp

https://commits.kde.org/krita/e0cede285cec383a05d4727c306874ef6a11374f
Comment 2 joupent 2018-07-07 16:21:07 UTC
Git commit 3929649e6c292670424094789020775eb586e30a by Jouni Pentikäinen.
Committed on 07/07/2018 at 12:00.
Pushed by jounip into branch 'master'.

Fix failure handling when saving reference images

M  +5    -7    libs/ui/KisReferenceImage.cpp
M  +6    -1    plugins/impex/libkra/kis_kra_save_visitor.cpp

https://commits.kde.org/krita/3929649e6c292670424094789020775eb586e30a
Comment 3 Halla Rempt 2018-07-09 14:54:03 UTC
Git commit b0e1b0f90f83b93975d96dc1eef716d8d3bc3fb7 by Boudewijn Rempt, on behalf of Jouni Pentikäinen.
Committed on 09/07/2018 at 14:39.
Pushed by rempt into branch 'krita/4.1'.

Handle failure to load reference images

M  +31   -11   libs/ui/KisReferenceImage.cpp
M  +9    -1    libs/ui/KisReferenceImage.h
M  +7    -4    libs/ui/KisView.cpp
M  +31   -1    plugins/impex/libkra/kis_kra_load_visitor.cpp
M  +19   -2    plugins/tools/defaulttool/referenceimagestool/KisReferenceImageCollection.cpp
M  +5    -3    plugins/tools/defaulttool/referenceimagestool/ToolReferenceImages.cpp

https://commits.kde.org/krita/b0e1b0f90f83b93975d96dc1eef716d8d3bc3fb7
Comment 4 Halla Rempt 2018-07-09 14:54:03 UTC
Git commit 54ae57f973cd612dd10365290197c877b4dc066c by Boudewijn Rempt, on behalf of Jouni Pentikäinen.
Committed on 09/07/2018 at 14:39.
Pushed by rempt into branch 'krita/4.1'.

Fix failure handling when saving reference images

M  +5    -7    libs/ui/KisReferenceImage.cpp
M  +6    -1    plugins/impex/libkra/kis_kra_save_visitor.cpp

https://commits.kde.org/krita/54ae57f973cd612dd10365290197c877b4dc066c
Comment 5 joupent 2018-09-05 10:42:29 UTC
*** Bug 398286 has been marked as a duplicate of this bug. ***