-
Notifications
You must be signed in to change notification settings - Fork 13
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
Two SVG bugs #114
base: master
Are you sure you want to change the base?
Two SVG bugs #114
Conversation
Hey! Thanks for the fixes! The image fix works only for the SVG backend, right? I wonder if it would be more flexible (backend agnostic) to apply the scaling only when we create the image primitive: def image(local_path: str, url_path: Optional[str]) -> Diagram:
from chalk.core import Primitive
- return Primitive.from_shape(Image(local_path, url_path))
+ return Primitive.from_shape(Image(local_path, url_path)).scale(0.05) Somewhat unrelated, but what should the |
Ah, I now see that things are a bit more complicated that I've imagined: if I understand correctly, the SVG backend doesn't display the image loaded from the |
I think we need a couple long term fixes.
|
Okay! So I guess you are suggesting to merge these temporary fixes for the time being and create separate issues for the long-term problems, right? I'm fine with that, but I just wanted to point out that the current changes will affect the image rendering with format: cairo.Format = cairo.FORMAT_ARGB32
+ im = im.resize((int(im.width * 0.05), int(im.height * 0.05)))
if "A" not in im.getbands(): |
We don't need to merge. I'll fix Cairo for real here. Mostly just sent this to remind myself since I needed it in my code. |
Ah, cool! Sorry for misunderstanding! I'll take a look at #113 then if you haven't started already working on it. |
Small temporary fixes.