-
Notifications
You must be signed in to change notification settings - Fork 7
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
Empty space beween image and details too large #393
Comments
Is it possible to center the image instead of aligning it to the left? This would not solve the issue, but would make it more acceptable. |
Using Graphviz settings, it does not seem to be possible. The tile is assembled with what Graphviz calls an "HTML-like label", which looks much like an HTML table that you may be familiar with. Graphviz allows you to change the alignment of the cell,however, this only aligns the "image" (which is considered square). The I think the crux of the issue is one of the settings that lets you set the size. Disabling this, however, makes the photos way too large, and for some reason I can scale them up from there but they won't scale down. We could attempt to apply an after-Graphviz fix, but as with the photo shapes, this wouldn't work for server-side generation. And on top of this, it gets a little tricky. Graphviz creates an SVG, which is very specific about placement. For example, if we move the words to the left, the box will not automatically shrink to fit, we need to also adjust the box. And one big problem with this is that we don't actually know the aspect ratio of the photo. There is a gap here for photos that are portrait (taller than they are wide), but photos could be landscape (wider than they are tall) where this would not cause the same issue and trying to change the layout could prevent these from working correctly. I think the ideal situation would be to use PHP to get the size of the photo (which I'm assuming is possible, since we have the files on the server), then rewrite the tile Graphviz code to work nicely with a photo set to a specific height and width. I would guess what we want is possible, but it appears to need a fair bit of work to do it. Redoing this code is probably inevitable at some point, but it will be on the long term list of things to do unless I get a sudden brain wave (or someone else volunteers to have a go at it). |
ok, it is not worth to go the hard way you sketched out. |
I'd like to keep this on the list of things to do in future. This is not the first time I've had issues with the structure of the tiles, and I think eventually we will need to re-do this code, at which point we will resolve this. |
In the context of future to-dos concerning photos please consider the problem, that PDFs including photos often get much bigger than diagram-PDFs without photos. I observed cases for the same diagram with photo 10MB but only 100KB without. You can compress such a PDF without noticable loss in quality by a PDF editor down below 1MB. |
What happens if you reduce the DPI setting? Does that help at all? |
That helps a lot. |
I've added #395 to discuss this as it's separate and I think easier to resolve now that I've done a bit more research. |
Also I've tagged this "Help wanted" since I haven't been able to figure out a simple way to solve this but perhaps someone else can. |
The text was updated successfully, but these errors were encountered: