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

Large images won't render #22

Open
willstott101 opened this issue Aug 6, 2020 · 3 comments · May be fixed by #27
Open

Large images won't render #22

willstott101 opened this issue Aug 6, 2020 · 3 comments · May be fixed by #27

Comments

@willstott101
Copy link

If the SVG file is of a size larger than $wgSVGMetadataCutoff (256KB) then fetching the nominal image dimensions fails.

The SVG is still served to the browser, but hidden due to max-width being set to 0px, is there some way to make the img element a sensible size without this server data?

@willstott101
Copy link
Author

Currently the images seem to be rendered with:

    height: auto;
    width: 100%;
    max-width: $img_width;

but would it not make more sense to render with:

    height: auto;
    max-width: 100%;

?

@willstott101
Copy link
Author

Basically this comes down to https://phabricator.wikimedia.org/T199737#6366134

Mediawiki fails to find the size of the SVG if it's file size is large enough.

@willstott101
Copy link
Author

Drawio seems to add a content attribute to the main <svg> tag. Moving the data to elsewhere in the SVG doesn't help Mediawiki process the file. Even though https://www.mediawiki.org/wiki/Manual:$wgSVGMetadataCutoff implies it ought to, as the width and height are definitely within the first 256 bytes.

Jackbennett added a commit to Jackbennett/mediawiki-drawio-editor that referenced this issue Sep 25, 2020
Work around fixes mgeb#22 by letting browsers size this image, not using the zero'd out value of width once the diagram fails to fetch.
@Jackbennett Jackbennett linked a pull request Sep 25, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant