Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support adding images to schematics #1271

Open
ubruhin opened this issue Nov 21, 2023 · 3 comments
Open

Support adding images to schematics #1271

ubruhin opened this issue Nov 21, 2023 · 3 comments
Labels
Milestone

Comments

@ubruhin
Copy link
Member

ubruhin commented Nov 21, 2023

SUMMARY

See https://librepcb.discourse.group/t/graphics-import-for-schematics/621.

SOLUTION

To be defined in detail. Probably simply allowing a few image formats (which are supported by Qt on all platforms) to be added to a schematic, with the following properties:

  • Filename (or maybe implicitly using a UUID)
  • Position X/Y
  • Scale factor

The image file needs to be copied into the project when added to a schematic. Probably it makes sense to copy it into the schematic's directory to maintain a strong relation to the schematic. Alternatively it might be copied into the resources directory but then it is not automatically deleted when deleting the schematic it was added to.

@ubruhin ubruhin added enhancement file format Issues affecting the file format tool-schematics-editor labels Nov 21, 2023
@ubruhin ubruhin added this to the 2.0.0 milestone Nov 21, 2023
@hpirlo
Copy link

hpirlo commented Jan 27, 2024

Hello @ubruhin
I want to contribute to this issue. I think that it is better to add the image to the resources directory. then we can add an option to the software that if a schematic removed, dependent files also be removed.
What is your idea about it?
Can I start coding?

@ubruhin
Copy link
Member Author

ubruhin commented Jan 28, 2024

Hi @hpirlo

I think that it is better to add the image to the resources directory.

I have now thought about this, and I came to the opposite opinion 🙈 I think it makes more sense to store images in the schematic directories. The implementation will be way simpler (and thus less error-prone), and from the user perspective it doesn't matter that much where these images are stored.

then we can add an option to the software that if a schematic removed, dependent files also be removed.

I think this is unnecessary complexity. Dependent images should always be deleted automatically, because the image is just a part of a schematic and for me as a user it would be clear that deleting a schematic will also delete its contents. And this is a major advantage if images are stored in the schematic directory - they will be deleted automatically, even without writing a single line of code.

I want to contribute to this issue.
Can I start coding?

This is great to hear! However, to be honest I think this is not a good issue to start with. It might sound simple, but this feature requires to touch many aspects of the software: file format, undo/redo, GUI, graphics rendering, testing. In our experience, pull requests adding this kind of feature are very often never reaching a mergeable state and are thus wasted time (both on contributors side and on our side). Also note that due to the file format modification, we can't merge such a feature anyway as long as we're still releasing v1.x releases so this needs to be hold back for v2.x.

So from my point of view, I'd strongly suggest to start with easier issues not affecting the file format. This would also help to start learning our software architecture and contribution workflow etc. before working on more complex features.

@hpirlo
Copy link

hpirlo commented Jan 28, 2024

@ubruhin Thanks for your great advice.
Now I will try to contribute to easier issues.
I will inform you if I want to start working on any issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants