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

Added partial support for retina images #30

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

DannyvanHolten
Copy link
Member

No description provided.

@HarwinBorger
Copy link
Member

Instead of changing our main functions to give support to other plugins we should consider adding new functions to extend our main functions. We could also have a look at filters to add this support.

@DannyvanHolten
Copy link
Member Author

I think this functionality should be core for our plug-in. Cropping images is our core business, so cropping retina images as well.

$imageFilePath
);
// Loop trough all the image qualities (normal & retina)
foreach ($imageFilePaths as $retina => $imageFilePath) {
Copy link
Member

@HarwinBorger HarwinBorger Jul 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as $imageSize => $imageFilePath


// Add the retina image if it exists (We're using 2 instead of @2x for multiplications)
if (file_exists($uploadDir . $retinaFileName)) {
$imageFilePaths['2'] = $uploadDir . $retinaFileName;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$images[] = [
     'src'=> 'path....',
     'multiply'=> '1' // or 2
]

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