heyman / heynote

A dedicated scratchpad for developers
https://heynote.com
Other
3.87k stars 194 forks source link

Images/Screenshots #157

Open Jargonius opened 8 months ago

Jargonius commented 8 months ago

It would be nice if you could paste basic images and screenshots into blocks. Sometimes it is quicker to take a screenshot than it is to copy something.

heyman commented 8 months ago

I agree that this would be useful. However, it would be quite a significant conceptual change.

If it were to be implemented, these are my inital thoughts:

Questions

gerroon commented 8 months ago

It would be even better HeyNote can do the screenshot operation. Does not Electron apps support screen shot?

heyman commented 8 months ago

It would be even better HeyNote can do the screenshot operation.

Sorry, I don't understand what you mean by that. If you mean building a feature for taking screenshots/screen captures into Heynote, that's not going to happen.

gerroon commented 8 months ago

I did not mean implementing a new feature. I thought that Electron already has faculty to do screenshots. I am not a developer myself, but I read about it some time ago.

https://www.codeease.net/programming/javascript/how-to-take-screenshot-of-desktop-using-electron-js

peterjaric commented 8 months ago

It should only work in Text blocks (and potentially Math blocks), because it would be weird to paste images into programming code.

That begets a new question: what happens if you have pasted an image into a Text block and then change the language to Python, for example?

Jargonius commented 8 months ago

All of these are good points that I hadn't considered. I'll have to think about this. But anyone else who has ideas please chime in. I think we've got a good dialogue going so far.

One way to simplify it would be to make a special image block that can't accept text or be changed and only deleted. But that would reduce the versatility drastically.

Jargonius commented 8 months ago

What about base64 encoding the images?

Jargonius commented 8 months ago

It should only work in Text blocks (and potentially Math blocks), because it would be weird to paste images into programming code.

That begets a new question: what happens if you have pasted an image into a Text block and then change the language to Python, for example?

You could also disable changing the language if the block contains an image.

heyman commented 8 months ago

That begets a new question: what happens if you have pasted an image into a Text block and then change the language to Python, for example?

I think the most reasonable behaviour would be to remove the image widget and reveal the image syntax.

What about base64 encoding the images?

I wouldn't want to clutter the buffer file with megabytes of base64 encoded data (it's also not unlikely to cause performance issues)

porridgewithraisins commented 7 months ago
  • When should images be deleted from the file system? When references are removed from the text? If so, what about cutting a piece of text (including an image) and pasting it somewhere else?

I think you should make delete orphan images a button in the settings page, should be sufficient. Can probably think about running the deletion at program start as well (but this would break people cmd+Xing something, accidentally cmd+Qing heynote, restarting it and finding their image gone)

  • What about Markdown blocks? There's a syntax for images in Markdown, but the referenced images would be broken when copying the content from Heynote out to an external program (e.g. Github comments). I'm thinking it might be better to not support image widgets in Markdown blocks.

Please support it in markdown. It is reasonable to expect markdown copied from the local filesystem to not have the same image references in a github comment.