添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
直爽的猴子  ·  M1 & M1 Plus - ...·  4 天前    · 
犯傻的海龟  ·  CAM350 ...·  1 月前    · 
暗恋学妹的佛珠  ·  回顾 | ...·  4 月前    · 

Hey everyone,

Would love your help on this one. I’m trying to build a flow that can compress images (from a list of URLs of the images) using the Tiny PNG api.

This would be useful for anyone wanting to make their websites faster.

Here’s what I have so far:

First , you get an API key from Tiny PNG here . It’s free to use for up to 500 image compressions per month.

Then , you follow the instructions here for compressing images from a url, shown below and found here .

image 898×789 35.7 KB

But that’s where I’m running into problems. When I try the API, it says no data comes back. Here’s how I have it set up:

image 1075×568 28 KB

I’m authenticating using “Username and Password”, where the username is “api” and the password is the api key.

What am I missing?

Hey @Brian_Dawson :wave:

Does your API step have a previous step connected? If you’re using the “Enrich with an API” step specifically, input is required to show the response in the Editor.

The “Send to an API” step will only send a request if a previous step is connected and the flow is triggered to run.

Thanks Daniel, that was it.

So even if just testing, and not using any data from the previous steps, it needs to be connected to pull data, even if you’re still in the editor. Thanks for the heads up.

Well, hopefully this helps someone compress some images!

One more question, this time about resizing images. Maybe you can help @daniel .

I’m trying to resize the images, following the steps Tiny PNG lays out here :

image 886×755 35.8 KB

It seems you have to compress first, and the response you get from that is a URL with the newly compressed image. That URL is itself the endpoint for the resize step, as far as I understand it.

So I take that URL and form a request just like the example one. But the response I get is a mess of symbols, instead of a new URL with resized dimensions.

Here’s what I’m getting when I try that in as another enrich step:

image 1084×655 78.3 KB

Any ideas what’s going on here?

Hey @Brian_Dawson ,

Taking a look at the example response, it appears that the Content-type is being returned as image/jpeg for you to download.

Parabola can only work with Content-type: application/json , which would explain why symbols are showing up.

If you go to the link nested under new-endpoint , are you able to view or download the image and compare it to the dimensions you sent in your request?

Thanks @daniel . Yeah, when I go to that endpoint it’s still the same dimensions as before my resize step, so I don’t think anything is changing there.

Maybe there’s another api I can use for returning the resized image in a url.

Hey @Brian_Dawson ,

Try checking out Cloudinary’s Transformation URL API . Their API offers a ton of transformations that can be applied directly as a URL parameter.

Websites could upload their image assets and the transformations can be applied by amending the URL. Would something like that work?