[ https://issues.apache.org/jira/browse/TS-4095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15075654#comment-15075654 ]
ASF GitHub Bot commented on TS-4095: ------------------------------------ Github user bgaff commented on a diff in the pull request: https://github.com/apache/trafficserver/pull/393#discussion_r48644738 --- Diff: plugins/experimental/webp_transform/metadata.cc --- @@ -0,0 +1,64 @@ +/** + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +#include <stdlib.h> +#include <string.h> + +#include "webp/types.h" +#include "metadata.h" + +void +MetadataInit(Metadata *const metadata) +{ + if (metadata == NULL) + return; + memset(metadata, 0, sizeof(*metadata)); +} + +void +MetadataPayloadDelete(MetadataPayload *const payload) +{ + if (payload == NULL) + return; + free(payload->bytes); + payload->bytes = NULL; + payload->size = 0; +} + +void +MetadataFree(Metadata *const metadata) +{ + if (metadata == NULL) + return; + MetadataPayloadDelete(&metadata->exif); + MetadataPayloadDelete(&metadata->iccp); + MetadataPayloadDelete(&metadata->xmp); --- End diff -- I think you're also forgetting to delete metadata itself. > New cppapi plugin for converting image formats to wepb > ------------------------------------------------------ > > Key: TS-4095 > URL: https://issues.apache.org/jira/browse/TS-4095 > Project: Traffic Server > Issue Type: New Feature > Components: CPP API, Plugins > Reporter: Sandeep Davu > Assignee: Brian Geffon > Labels: review > Fix For: 6.2.0 > > > Support for png and jpeg only. Webp is a format introduced by google and can > retain the quality of the image by reducing the image size. -- This message was sent by Atlassian JIRA (v6.3.4#6332)