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 default configuration for images #1979

Merged
merged 1 commit into from
Apr 28, 2018
Merged

Add default configuration for images #1979

merged 1 commit into from
Apr 28, 2018

Conversation

cweiske
Copy link
Contributor

@cweiske cweiske commented Apr 16, 2018

This patch allows configuring image processing instructions
for all images.
A use case is generating a fixed set of sizes (derivatives) for
all images, without having to specify them in the content markdown.

Example configuration in user/config/system.yaml:

images:
  defaults:
    derivatives: "[300,600,1200]"

@rhukster
Copy link
Member

That's pretty much how i would of implemented it 👍

This patch allows configuring image processing instructions
for all images.
A use case is generating a fixed set of sizes (derivatives) for
all images, without having to specify them in the content markdown.

Example configuration in user/config/system.yaml:

images:
  defaults:
    derivatives: "[300,600,1200]"
@rhukster rhukster merged commit d4ec2a2 into getgrav:develop Apr 28, 2018
@cweiske cweiske deleted the default-derivatives branch May 14, 2018 19:14
rhukster pushed a commit that referenced this pull request May 15, 2018
When using a default image derivatives (#1979) setting like

  images:
    defaults:
      derivatives: [300,600]

then Grav crashes when a video gets embedded.
The following error occurs:

  rawurlencode() expects parameter 1 to be string, array given
  system/src/Grav/Common/Page/Medium/Medium.php:521

This patch encodes array URL parameters correctly.
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.

2 participants