Git Product home page Git Product logo

Comments (4)

itaibenari avatar itaibenari commented on August 15, 2024

Hi @ChrisNeveu
I can't seem to be able to reproduce the issue.
this is the spec I'm running:

  it should "support uploading with eager async transformations" taggedAs(EagerTest) in {
    val eagerTransforms = List(Transformation().c_("scale").w_(0.5), Transformation().c_("scale").w_(0.4))
    val uploadParams = UploadParameters().eager(eagerTransforms).eagerAsync(true)
    Await.result(for {
      response <- cloudinary.uploader().upload("http://cloudinary.com/images/logo.png", uploadParams)
    } yield {
      response.eager.length should equal(2)
    }, 10.seconds)
  }

Can you please try to run it in your environment?
Are you using a different json4s version from 3.2.10? Do you perhaps have dependency on more than one version?

from cloudinary_scala.

ClaireNeveu avatar ClaireNeveu commented on August 15, 2024

We only depend on json4s through Cloudinary.
The following example throws an exception in our code:

val eagerTransforms = List(Transformation())
val uploadParams = UploadParameters().eager(eagerTransforms).eagerAsync(true).tags(Set())
Await.result(for {
  response <- cloudinary.uploader().upload("http://i.kinja-img.com/gawker-media/image/upload/tragfjufpswym5ilco8e.jpg", uploadParams)
} yield {
  response.raw
}, 10.seconds)

I tried to write a test to confirm but your test suite does not work for me. Every test throws a NullPointerException

[info] An Uploader
[info] - should upload a file and get sizes, colors, predominant, public_id, version and signature back *** FAILED ***
[info]   java.lang.NullPointerException:
[info]   at java.net.URI$Parser.parse(URI.java:3023)
[info]   at java.net.URI.<init>(URI.java:595)
[info]   at com.cloudinary.Cloudinary$.configFromUrl(Cloudinary.scala:20)
[info]   at com.cloudinary.Cloudinary.<init>(Cloudinary.scala:129)
[info]   at com.cloudinary.UploaderSpec.cloudinary$lzycompute(UploaderSpec.scala:19)
[info]   at com.cloudinary.UploaderSpec.cloudinary(UploaderSpec.scala:18)
[info]   at com.cloudinary.UploaderSpec$$anonfun$1.apply$mcV$sp(UploaderSpec.scala:30)
[info]   at com.cloudinary.UploaderSpec$$anonfun$1.apply(UploaderSpec.scala:28)
[info]   at com.cloudinary.UploaderSpec$$anonfun$1.apply(UploaderSpec.scala:28)
[info]   at org.scalatest.Transformer$$anonfun$apply$1.apply$mcV$sp(Transformer.scala:22)

from cloudinary_scala.

ClaireNeveu avatar ClaireNeveu commented on August 15, 2024

It might also be worth mentioning that we are constructing our Cloudinary instance with a cname:

private lazy val cloud = new Cloudinary(Map(
   "cloud_name" -> apiName,
   "api_key" -> apiKey,
   "api_secret" -> apiSec,
   "cname" -> "i.kinja-img.com"))

from cloudinary_scala.

ClaireNeveu avatar ClaireNeveu commented on August 15, 2024

After a lot more testing, we've discovered the cause of the issue. While we weren't depending on a different version of json4s, we were depending on the same version down the line. Something with how this all got packaged up was messing with json4s' reflection and causing the exception. We've removed our dependency, instead relying on the implicit dependency from the cloudinary_scala library and everything works now.

from cloudinary_scala.

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.