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

Add Vector image auto_sizes support #3533

Merged
merged 1 commit into from Feb 12, 2022
Merged

Conversation

xf-
Copy link
Contributor

@xf- xf- commented Feb 11, 2022

Read images sizes from vector files to be more consistent with "photo" images.

@mahagr mahagr merged commit c4e10cf into getgrav:develop Feb 12, 2022
@mahagr
Copy link
Member

mahagr commented Feb 12, 2022

I made some minor improvements to improve error handling.

mahagr added a commit that referenced this pull request Feb 12, 2022
@xf- xf- deleted the task/vectorImg branch February 12, 2022 22:22
@xf-
Copy link
Contributor Author

xf- commented Feb 12, 2022

@mahagr i used that code nested and adjusted it more or less to your code style in grav and removed some PHP8 stuff like $xml?-> and next line checks if it is an element :)

I thought about using try catch and also xml is requirement in composer. Normally every web server should use it and avoid inconsistent behavior. i noticed mbstring is suggested in composer and index.php basically stops without it.

THX for the quick merge

@mahagr
Copy link
Member

mahagr commented Feb 14, 2022

I didn't have any PHP8 code, $attr = $xml ? $xml->attributes() : null; works in PHP5 and is required as loading the file may fail (non-XML file).

@mahagr
Copy link
Member

mahagr commented Feb 14, 2022

Fixed mb extension issue, too.

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 this pull request may close these issues.

None yet

2 participants