GithubHelp home page GithubHelp logo

API changed? about pyuploadcare HOT 14 CLOSED

uploadcare avatar uploadcare commented on June 6, 2024
API changed?

from pyuploadcare.

Comments (14)

valyagolev avatar valyagolev commented on June 6, 2024

Hi,

Sorry, this is due to migration to the new resizing engine. We'll update the API ASAP

from pyuploadcare.

dmitry-mukhin avatar dmitry-mukhin commented on June 6, 2024

hey,

sorry for long delay.
you can add /stretch/off/ to cdn url now to turn off stretching.

i.e. https://ucarecdn.com/<uuid>/-/stretch/off/-/resize/500x300/

from pyuploadcare.

dmitry-mukhin avatar dmitry-mukhin commented on June 6, 2024

please close the ticket if it suits you

from pyuploadcare.

slafs avatar slafs commented on June 6, 2024

Yup. That did the trick. You should however alter the README "Using it..." sections or rewrite the resized and cropped functions. It's confusing when in README one can read "make your life easier..." by using those methods or template helpers and then realize that they're deprecated.
Cheers

from pyuploadcare.

valyagolev avatar valyagolev commented on June 6, 2024

Hi, yeah, we didn't make up our minds about these yet, thank you for reminding!

from pyuploadcare.

slafs avatar slafs commented on June 6, 2024

about disabling stretching... there's some inconsistent behavior with this option. It works for smaller images. But when my image is bigger doing a stretch/off doesn't seem to do anything.

So... having /-/stretch/off/-/resize/500x300/ for a bigger image (than 500x300) gives the same result as /-/resize/500x300/. I've workaround this by doing this instead /-/stretch/off/-/resize/500x/-/resize/x300/.

from pyuploadcare.

valyagolev avatar valyagolev commented on June 6, 2024

Wow, this is weird. Sorry, we'll investigate.

from pyuploadcare.

valyagolev avatar valyagolev commented on June 6, 2024

Hey, I'm trying to understand the issue you're talking about.

/stretch/ is just to disable stretching in case when the requested size is bigger than the actual one. Probably, you want an option to preserve proportions, do you? Or not? Can you give me example of what you want (even without image, just actual sizes and the sizes you want to get will suffice)?

from pyuploadcare.

slafs avatar slafs commented on June 6, 2024

sure. check out this image. It's 512 x 682. When You do /-/stretch/off/-/resize/500x300/ the picture actually gets... stretched ;). But you're right, the preserve proportions can be what I'm looking for. But the above workaround also works.

from pyuploadcare.

valyagolev avatar valyagolev commented on June 6, 2024

Oh, yes:

resize (/resize/:one_or_two_dimensions/): Resizes an images to the specified dimensions. If only one of them is specified, resizes proportionally to this one. Examples:

I should've probably stressed more that if you specify 2 dimensions it does not care about proportions.

Let's see. Maybe you want https://ucarecdn.com/b20e8a04-3574-49bb-a3e7-da0c38b96068/-/scale_crop/500x300/center/ ? Or you want an image which is not cropped, exactly or less than 500x300 and with original proportions?

from pyuploadcare.

slafs avatar slafs commented on June 6, 2024

Or you want an image which is not cropped, exactly or less than 500x300 and with original proportions?

Yes. That's exactly what I want.

from pyuploadcare.

valyagolev avatar valyagolev commented on June 6, 2024

Okay, probably we'll need another action for that, like -/fit/500x300/.

from pyuploadcare.

dmitry-mukhin avatar dmitry-mukhin commented on June 6, 2024

@homm do we have already something for this?

from pyuploadcare.

homm avatar homm commented on June 6, 2024

/preview/500x300/ should be used for this.
https://ucarecdn.com/b20e8a04-3574-49bb-a3e7-da0c38b96068/-/preview/500x300/

from pyuploadcare.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.