Code Monkey home page Code Monkey logo

Comments (6)

sherwinski avatar sherwinski commented on May 20, 2024 1

Hi @Kishanspaceo, the fix for this issue is now available via v1.1.2 🎉

from imgix-swift.

sherwinski avatar sherwinski commented on May 20, 2024

Hi @Kishanspaceo,

It appears that the URL you provided has a bad domain (imgix.net). You can find the domain for your source in the imgix dashboard source view. And for more information, feel free to read through our documentation on serving images.

If fixing that still does not work for you, could you please provide a code example and any associated error message you get when calling buildURL? Thank you!

from imgix-swift.

Kishanspaceo avatar Kishanspaceo commented on May 20, 2024

I have a url like "https://myproject.imgix.net/staging/photos/196341/e47eefb34a6b7c415873a0f8945216704f0d/جبن_مع_الراب_الرومى.jpg"

I am trying to build url with 2 portions...

  • myproject.imgix.net
  • staging/photos/196341/e47eefb34a6b7c415873a0f8945216704f0d/جبن_مع_الراب_الرومى.jpg

But it crashes, as it has arabic characters.
My code is also working, when we have all english characters and it successfully generate the url.

It says
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** +[NSURLComponents setPercentEncodedPath:]: invalid characters in percentEncodedPath'

from imgix-swift.

Kishanspaceo avatar Kishanspaceo commented on May 20, 2024

let client = ImgixClient.init(host: "myproject.imgix.net")
let url = client.buildUrl("staging/photos/196341/e47eefb34a6b7c415873a0f8945216704f0d/جبن_مع_الراب_الرومى.jpg", params: [
"w": 300,
"h": 300,
"fit": "crop"
])
debugPrint(url)

from imgix-swift.

sherwinski avatar sherwinski commented on May 20, 2024

Hi @Kishanspaceo,

Thank you for providing these examples, they are very helpful. I am currently investigating this issue and hope to have an solution for you sometime this week.

from imgix-swift.

Kishanspaceo avatar Kishanspaceo commented on May 20, 2024

in the function func sanitizePath(_ path: String) -> String
after declaring path variable,
path = path.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) ?? path
adding above line would work.

from imgix-swift.

Related Issues (8)

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.