Skip to content

Added partial support for retina images#30

Open
DannyvanHolten wants to merge 3 commits into
developfrom
feature/wp-retina
Open

Added partial support for retina images#30
DannyvanHolten wants to merge 3 commits into
developfrom
feature/wp-retina

Conversation

@DannyvanHolten

Copy link
Copy Markdown
Member

No description provided.

@HarwinBorger

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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.

Comment thread resources/CropService.php
$imageFilePath
);
// Loop trough all the image qualities (normal & retina)
foreach ($imageFilePaths as $retina => $imageFilePath) {

@HarwinBorger HarwinBorger Jul 21, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

as $imageSize => $imageFilePath

Comment thread resources/CropService.php

// 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
Copy Markdown
Contributor

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