[Enhancement] Inserting image with same name

Bug #1817405 reported by Roman TS on 2019-02-23
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Undecided
Unassigned

Bug Description

Noticed when I inserting the image by ctrl+v (from Firefox) in edit book and his name is the same already added to the book its override old one with new even if it's completely different.

Can you add some filtering to this?
For example, if an image different just rename the new one. Right now it's a bit confusing because sometimes I not even aware of name collisions.

Thanks.

Not sure I understand. Currently, pasting of images using Ctrl-V is
not working at all because of an unrelated bug. So how/where are you
pasting the image?

 status incomplete

Changed in calibre:
status: New → Incomplete
Roman TS (tsroman-mail) wrote :

I'm using Windows 10 1809, Calibre eBook 3.39.1 and browser Firefox 65 to copy the image. Copy from the filesystem works for me too. But on the chrome QImage attribute error.

To reproduce what I'm saying:
1) Create an empty epub book in the e-book editor.
2) Prepare two different png files but with same name somewhere in your folders.
3) Copy any first into ebook editor push save and close the editor.
4) Start e-book editor again and load just saved epub book.
5) Copy/paste another image. You see something like this on the Screenshot_1.png
6) Push save, close.
7) Reopen e-book editor and book.
8) Old one image is gone.

Roman TS (tsroman-mail) wrote :

Let me clarify more, images were different the only name is same.

Kovid Goyal (kovid) wrote :

The thing I dont understand is how are you copy/pasting the image? Pressing ctrl-v in the editor with an image in the clipboard results in an error. So how are you copying the image into the editor?

Changed in calibre:
status: Incomplete → New
status: New → Incomplete
Roman TS (tsroman-mail) wrote :

ctrl-v works for me.
Works when I ctrl-c/ctrl-v image from windows explorer, or Firefox browser. But on the Google chrome always QImage attribute error.

Kovid Goyal (kovid) wrote :

Sorry, I cannot replicate this behavior at all, maybe the fix I made for
the attribute error also fixed it, try with the next calibre release.

 status invalid

Changed in calibre:
status: Incomplete → Invalid
Roman TS (tsroman-mail) wrote :

Hi, just tried a new build, same bug.
Did you do exact same steps that I mention on my post (2019-03-05), have you checked screenshot I provided?

I'm almost sure that you miss something because its easy to reproduce. The key part of this is that a first image has to be saved and book reopened when trying to insert a different image with the same name.

I assume, that application just not check for matching with already existent files in the book.
If you still failed to reproduce this, should I record a video?

Changed in calibre:
status: Invalid → New
Kovid Goyal (kovid) wrote :

yes, I tried those exact steps. When you insert a second image via ctrl-v with the same filename, it get its filename automatically changed, in your example, the filename would become samuro_1900x1200-1.png

Changed in calibre:
status: New → Opinion
Roman TS (tsroman-mail) wrote :

Please take a look at this video.

Kovid Goyal (kovid) wrote :

Ah that is because the book you are adding it to has no Images folder,
there was indeed a bug with pasting images into the root of the book.

Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.

 status fixreleased

Changed in calibre:
status: Opinion → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers