eric
(Eric)
January 20, 2019, 7:04pm
#1
I implemented the UploadCare widget into our application and whenever I upload a transparent PNG image (or any PNG for that matter), it converts the image to a JPG with a solid black background. Based on this thread I assume it is happening due to the cropping that is happening. Are we able to crop and still retain the transparency?
Code:
<!DOCTYPE html>
<html>
<head>
<%= ga_tag_manager_header %>
<!-- Meta Tags -->
<%= display_meta_tags site: "CodeFund" %>
<link rel="manifest" href="/site.webmanifest">
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<!-- CDN Stylesheets -->
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Poppins:300,400,500,600">
<link rel="stylesheet" href="/css/all.min.css">
<!-- Compressed Stylesheets -->
<%= stylesheet_pack_tag 'code_fund', media: 'all', 'data-turbolinks-track': 'reload' %>
<!-- Compressed JavaScripts -->
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
This file has been truncated. show original
https://github.com/gitcoinco/code_fund_ads/blob/master/app/views/job_postings/_form.html.erb#L87-L96
eric
(Eric)
January 20, 2019, 7:08pm
#2
I think I found my own answer. My widget was auto-resizing which applies the JPEG compression.
Alex
(Alex Chernenko)
January 21, 2019, 9:19am
#3
Hi @eric , you’re right. Image shrink can lead to changing the format to JPEG.