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

Mode variable Changes for the faster images #1833

Closed
mdkaleem95 opened this issue Mar 9, 2018 · 2 comments
Closed

Mode variable Changes for the faster images #1833

mdkaleem95 opened this issue Mar 9, 2018 · 2 comments
Assignees
Milestone

Comments

@mdkaleem95
Copy link

Mode variable Changes for the faster images

Ref: https://secure.helpscout.net/conversation/525784592/21877?folderId=1060551

Wordpress org: https://wordpress.org/support/topic/hotlinked-images-frequently-get-stretched-to-unnatural-dimensions/page/2/

I just found this interesting bit of code in your class-amp-image-dimension-extractor.php:

private static function fetch_images( $urls_to_fetch, &$images, $mode ) {
// Use FasterImage when for compatible PHP versions
if ( ‘synchronous’ === $mode ||
false === function_exists( ‘curl_multi_exec’ ) ||
version_compare( PHP_VERSION, ‘5.4.0’ ) < 0
) {
self::fetch_images_via_fast_image( $urls_to_fetch, $images );
} else {
self::fetch_images_via_faster_image( $urls_to_fetch, $images );
}
}

In this code, the $mode is always set to ‘concurrent’.

My server has the function curl_multi_exec.

My server has php version 7.0.23.

So it looks like, in my case, the images are retrieved by using the faster_images client.

The code for curling the images is in FasterImage.php. Plenty of settings to play around with.

However, something has caught my eye:

use WillWashburn\Stream\Exception\StreamBufferTooSmallException;
use WillWashburn\Stream\Stream;

Will Washburn is the author of the FasterImages code. But folder called WillWashburn exists in amp4wp.

@mdkaleem95 mdkaleem95 added this to the W8 milestone Mar 9, 2018
@MohammedKaludi
Copy link
Collaborator

@MARQAS will create a filter so users can modify the settings as per their requirement.

MARQAS added a commit that referenced this issue Mar 10, 2018
MohammedKaludi added a commit that referenced this issue Mar 10, 2018
#1833  Empty variable created
@jwbats
Copy link

jwbats commented Mar 21, 2018

Where is the setting we can modify as per our requirement?

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

No branches or pull requests

4 participants