Loading lazy.module +8 −3 Original line number Diff line number Diff line Loading @@ -203,10 +203,15 @@ function lazy_process_variables(array &$variables) { $placeholder_image_url = $style->buildUrl($file->getFileUri()); // Serve as a data URI? if ($placeholder_data_uri) { // Requesting the URL will cause the image to be created. $content = @file_get_contents($placeholder_image_url); // Get placeholder image uri. $placeholder_image_uri = $style->buildUri($file->getFileUri()); // Check if placeholder image already exists, if not - create it. if (!file_exists($placeholder_image_uri)) { $style->createDerivative($file->getFileUri(), $placeholder_image_uri); } $content = @file_get_contents($placeholder_image_uri); // Get the mime-type of the styled image, falls back to original. $mime_type = function_exists('mime_content_type') ? @mime_content_type($style->buildUri($file->getFileUri())) : $file->getMimeType(); $mime_type = function_exists('mime_content_type') ? @mime_content_type($placeholder_image_uri) : $file->getMimeType(); // Build the data URI with matching mime-type. $placeholder_image_url = "data:${mime_type};base64," . base64_encode($content); } Loading Loading
lazy.module +8 −3 Original line number Diff line number Diff line Loading @@ -203,10 +203,15 @@ function lazy_process_variables(array &$variables) { $placeholder_image_url = $style->buildUrl($file->getFileUri()); // Serve as a data URI? if ($placeholder_data_uri) { // Requesting the URL will cause the image to be created. $content = @file_get_contents($placeholder_image_url); // Get placeholder image uri. $placeholder_image_uri = $style->buildUri($file->getFileUri()); // Check if placeholder image already exists, if not - create it. if (!file_exists($placeholder_image_uri)) { $style->createDerivative($file->getFileUri(), $placeholder_image_uri); } $content = @file_get_contents($placeholder_image_uri); // Get the mime-type of the styled image, falls back to original. $mime_type = function_exists('mime_content_type') ? @mime_content_type($style->buildUri($file->getFileUri())) : $file->getMimeType(); $mime_type = function_exists('mime_content_type') ? @mime_content_type($placeholder_image_uri) : $file->getMimeType(); // Build the data URI with matching mime-type. $placeholder_image_url = "data:${mime_type};base64," . base64_encode($content); } Loading