Notebook: Can't paste two images from clipboard in markdown cell

Created on 5 Jan 2018  路  8Comments  路  Source: jupyter/notebook

Hi, I recently discovered the awesome paste image feature from clipboard in a markdown cell. However, as images are inserted as markdown code ![image.png](attachment:image.png), when inserting two images in the same cell, the first image is replaced by the second one and the first one is overwritten.

Most helpful comment

This issue is still relevant now 2 years since it was opened. A fix would be greatly appreciated.

All 8 comments

Found this issue after having the exact same problem. I think the overwrite occurs due to every pasted image having the same name (ie image.png) in the notebook's metadata.

Does anyone know if there's a way to rename the inline image immediately after pasting?

One easy fix would be for the notebook to automatically name each image sequentially: image00.png, image01.png, etc. I bet they didn't implement it that way in order to prevent images from becoming orphaned amongst the cell metadata over the course of multiple cycles of copy-paste. If the user had to manually set extra names, though, they would at least be aware of which images were being preserved.

Proposed fix: #3821, use a uuid for each attachment.

A more sophisticated thing would be to hash the image content to avoid storing duplicate attachments if an image is pasted twice (at least in the same cell). I didn't see a hashing library dependency already, so I didn't do that.

prevent images from becoming orphaned amongst the cell metadata over the course of multiple cycles of copy-paste.

I was worried about this too, but found per #621, attachments will be scrubbed automatically when the notebook is saved.

This still seems to be a problem. Anyone have a fix for this?

I am also looking for a solution to the same problem.

I am also looking for a solution to the same problem.

Same problem. Please fix

This issue is still relevant now 2 years since it was opened. A fix would be greatly appreciated.

Was this page helpful?
0 / 5 - 0 ratings