diff -u b/core/modules/image/src/Entity/ImageStyle.php b/core/modules/image/src/Entity/ImageStyle.php --- b/core/modules/image/src/Entity/ImageStyle.php +++ b/core/modules/image/src/Entity/ImageStyle.php @@ -180,12 +180,15 @@ $path = $uri; $scheme = file_default_scheme(); } + + // Check the extension of the derivative. $extension = pathinfo($path, PATHINFO_EXTENSION); $original_extension = $extension; $this->getDerivativeExtension($extension); if ($original_extension != $extension) { $path .= '.' . $extension; } + return $scheme . '://styles/' . $this->id() . '/' . $scheme . '/' . $path; } @@ -335,6 +338,14 @@ * {@inheritdoc} */ public function getPathToken($uri) { + // Check the extension of the derivative. + $extension = pathinfo($uri, PATHINFO_EXTENSION); + $original_extension = $extension; + $this->getDerivativeExtension($extension); + if ($original_extension != $extension) { + $uri .= '.' . $extension; + } + // Return the first 8 characters. return substr(Crypt::hmacBase64($this->id() . ':' . $uri, \Drupal::service('private_key')->get() . Settings::getHashSalt()), 0, 8); } diff -u b/core/modules/image/src/Plugin/ImageEffect/ConvertImageEffect.php b/core/modules/image/src/Plugin/ImageEffect/ConvertImageEffect.php --- b/core/modules/image/src/Plugin/ImageEffect/ConvertImageEffect.php +++ b/core/modules/image/src/Plugin/ImageEffect/ConvertImageEffect.php @@ -26,6 +26,12 @@ /** * {@inheritdoc} */ + public function transformDimensions(array &$dimensions) { + } + + /** + * {@inheritdoc} + */ public function applyEffect(ImageInterface $image) { if (!$image->convert($this->configuration['format'])) { $this->logger->error('Image convert failed using the %toolkit toolkit on %path (%mimetype)', array('%toolkit' => $image->getToolkitId(), '%path' => $image->getSource(), '%mimetype' => $image->getMimeType())); @@ -38,7 +44,8 @@ * {@inheritdoc} */ public function getDerivativeMimeType(&$mime_type) { - $mime_type = \Drupal::service('file.mime_type.guesser.extension')->guess($this->configuration['format']); + // Guess needs a filename. + $mime_type = \Drupal::service('file.mime_type.guesser.extension')->guess('test.' . $this->configuration['format']); } /**