You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2021/06/28 16:16:36 UTC

[GitHub] [trafficserver] bryancall opened a new pull request #8005: Updates to webp_transform to convert webp to jpeg

bryancall opened a new pull request #8005:
URL: https://github.com/apache/trafficserver/pull/8005


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] bryancall commented on pull request #8005: Updates to webp_transform to convert webp to jpeg

Posted by GitBox <gi...@apache.org>.
bryancall commented on pull request #8005:
URL: https://github.com/apache/trafficserver/pull/8005#issuecomment-882786910


   Merged to the 9.1.x branch


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] bryancall merged pull request #8005: Updates to webp_transform to convert webp to jpeg

Posted by GitBox <gi...@apache.org>.
bryancall merged pull request #8005:
URL: https://github.com/apache/trafficserver/pull/8005


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] bryancall commented on pull request #8005: Updates to webp_transform to convert webp to jpeg

Posted by GitBox <gi...@apache.org>.
bryancall commented on pull request #8005:
URL: https://github.com/apache/trafficserver/pull/8005#issuecomment-882786910


   Merged to the 9.1.x branch


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] bryancall commented on pull request #8005: Updates to webp_transform to convert webp to jpeg

Posted by GitBox <gi...@apache.org>.
bryancall commented on pull request #8005:
URL: https://github.com/apache/trafficserver/pull/8005#issuecomment-882786910


   Merged to the 9.1.x branch


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] randall commented on a change in pull request #8005: Updates to webp_transform to convert webp to jpeg

Posted by GitBox <gi...@apache.org>.
randall commented on a change in pull request #8005:
URL: https://github.com/apache/trafficserver/pull/8005#discussion_r660857978



##########
File path: plugins/experimental/webp_transform/ImageTransform.cc
##########
@@ -35,21 +35,40 @@ using namespace atscppapi;
 namespace
 {
 GlobalPlugin *plugin;
-}
+
+enum class ImageEncoding { webp, jpeg, png, unknown };
+
+bool config_convert_to_webp = false;
+bool config_convert_to_jpeg = false;
+
+Stat stat_convert_to_webp;
+Stat stat_convert_to_jpeg;
+} // namespace
 
 class ImageTransform : public TransformationPlugin
 {
 public:
-  ImageTransform(Transaction &transaction) : TransformationPlugin(transaction, TransformationPlugin::RESPONSE_TRANSFORMATION)
+  ImageTransform(Transaction &transaction, ImageEncoding input_image_type, ImageEncoding transform_image_type)
+    : TransformationPlugin(transaction, TransformationPlugin::RESPONSE_TRANSFORMATION),
+      _input_image_type(input_image_type),
+      _transform_image_type(transform_image_type)
   {
     TransformationPlugin::registerHook(HOOK_READ_RESPONSE_HEADERS);
   }
 
   void
   handleReadResponseHeaders(Transaction &transaction) override
   {
-    transaction.getServerResponse().getHeaders()["Content-Type"] = "image/webp";
-    transaction.getServerResponse().getHeaders()["Vary"]         = "Content-Type"; // to have a separate cache entry.
+    if (_transform_image_type == ImageEncoding::webp) {

Review comment:
       would this be better as a switch on _transform_image_type ? or just a series of else if?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org