summaryrefslogtreecommitdiff
path: root/proxy.php
diff options
context:
space:
mode:
authorlolcat <will@lolcat.ca>2023-08-08 03:09:47 -0400
committerlolcat <will@lolcat.ca>2023-08-08 03:09:47 -0400
commit4559857380317d768ff8394db711eb5c894aa1f8 (patch)
tree2ed555b5ba104297642893ef5511d1d28f282842 /proxy.php
parent7c771c82c8e03b337f9f03ae2d4afc25d3f0faca (diff)
added brave image+video support
Diffstat (limited to 'proxy.php')
-rw-r--r--proxy.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/proxy.php b/proxy.php
index d8b3c1b..bcf552e 100644
--- a/proxy.php
+++ b/proxy.php
@@ -57,6 +57,7 @@ try{
}
$image->readImageBlob($payload["body"]);
+
$image_width = $image->getImageWidth();
$image_height = $image->getImageHeight();
@@ -102,16 +103,16 @@ try{
$image_width = $image_height * $ratio;
}
- $image->setImageBackgroundColor(new ImagickPixel("#504945"));
- $image->mergeImageLayers(Imagick::LAYERMETHOD_FLATTEN);
-
- $image->resizeImage($image_width, $image_height, Imagick::FILTER_LANCZOS, 1);
+ $image->setImageBackgroundColor("#504945");
+ $image->setImageAlphaChannel(Imagick::ALPHACHANNEL_REMOVE);
$image->stripImage();
$image->setFormat("jpeg");
$image->setImageCompressionQuality(90);
$image->setImageCompression(Imagick::COMPRESSION_JPEG2000);
+ $image->resizeImage($image_width, $image_height, Imagick::FILTER_LANCZOS, 1);
+
$proxy->getfilenameheader($payload["headers"], $_GET["i"]);
header("Content-Type: image/jpeg");