Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
imageapi_optimize_avif_webp
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
imageapi_optimize_avif_webp
Commits
6be7fb7e
Commit
6be7fb7e
authored
10 months ago
by
hoangd
Browse files
Options
Downloads
Patches
Plain Diff
Fix compatibility with D10.3
parent
7dfea627
Branches
Branches containing commit
Tags
1.3.1
1 merge request
!49
Fix compatibility with D10.3
Pipeline
#207583
failed
10 months ago
Stage: build
Stage: test
Changes
1
Pipelines
4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Controller/ImageStyleDownloadController.php
+3
-3
3 additions, 3 deletions
src/Controller/ImageStyleDownloadController.php
with
3 additions
and
3 deletions
src/Controller/ImageStyleDownloadController.php
+
3
−
3
View file @
6be7fb7e
...
@@ -33,7 +33,7 @@ class ImageStyleDownloadController extends CoreImageStyleDownloadController {
...
@@ -33,7 +33,7 @@ class ImageStyleDownloadController extends CoreImageStyleDownloadController {
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*/
*/
public
function
deliver
(
Request
$request
,
$scheme
,
ImageStyleInterface
$image_style
)
{
public
function
deliver
(
Request
$request
,
$scheme
,
ImageStyleInterface
$image_style
,
string
$required_derivative_scheme
)
{
$target
=
$request
->
query
->
get
(
'file'
);
$target
=
$request
->
query
->
get
(
'file'
);
$path_info
=
pathinfo
(
$target
);
$path_info
=
pathinfo
(
$target
);
// If .avif file, look for image to derive from.
// If .avif file, look for image to derive from.
...
@@ -43,7 +43,7 @@ class ImageStyleDownloadController extends CoreImageStyleDownloadController {
...
@@ -43,7 +43,7 @@ class ImageStyleDownloadController extends CoreImageStyleDownloadController {
if
(
$source_uri
=
$this
->
lookupSourceImage
(
$image_uri
))
{
if
(
$source_uri
=
$this
->
lookupSourceImage
(
$image_uri
))
{
// Replace AVIF or WebP image with source image and call parent:deliver().
// Replace AVIF or WebP image with source image and call parent:deliver().
$request
->
query
->
set
(
'file'
,
str_replace
(
$scheme
.
'://'
,
''
,
$source_uri
));
$request
->
query
->
set
(
'file'
,
str_replace
(
$scheme
.
'://'
,
''
,
$source_uri
));
$source_response
=
parent
::
deliver
(
$request
,
$scheme
,
$image_style
);
$source_response
=
parent
::
deliver
(
$request
,
$scheme
,
$image_style
,
$required_derivative_scheme
);
$derivative_uri
=
$image_style
->
buildUri
(
$image_uri
);
$derivative_uri
=
$image_style
->
buildUri
(
$image_uri
);
// If parent:deliver() returns BinaryFileResponse, we'll replace
// If parent:deliver() returns BinaryFileResponse, we'll replace
...
@@ -77,7 +77,7 @@ class ImageStyleDownloadController extends CoreImageStyleDownloadController {
...
@@ -77,7 +77,7 @@ class ImageStyleDownloadController extends CoreImageStyleDownloadController {
throw
new
NotFoundHttpException
();
throw
new
NotFoundHttpException
();
}
}
else
{
else
{
return
parent
::
deliver
(
$request
,
$scheme
,
$image_style
);
return
parent
::
deliver
(
$request
,
$scheme
,
$image_style
,
$required_derivative_scheme
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment