magwyz / pastec

Image recognition open source index and search engine
http://pastec.io
GNU Lesser General Public License v3.0
620 stars 175 forks source link

IMAGE_NOT_DECODED #40

Closed Victorgf87 closed 8 years ago

Victorgf87 commented 8 years ago

Hello, I have installed pastec server on my server, and now I'm trying to make a post to add photos... When I do curl -X PUT --data-binary

I keep getting the "IMAGE_.NOT_DECODED" in the json response. I have tried converting jpg to base64 and use the jpg file (they say jpegs are binary :S) but keep getting that error... I would appreciate any help you would provide me. Thank you for everything :)

magwyz commented 8 years ago

Please provide the full curl command you are using.

Victorgf87 commented 8 years ago

Sure.

curl -X PUT --data-binary ./images/h3.jpg http://37.139.11.71:4212/index/images/1

And the response: {"image_id":1,"type":"IMAGE_NOT_DECODED"}

magwyz commented 8 years ago

Replace "./images/h3.jpg" by "@images/h3.jpg" The @ is important. It's the curl syntax.

Victorgf87 commented 8 years ago

Thank you so much, I didn't see that ^^'

Now I can upload images, but if the image is bad, it says: pastec: jax_cm.c:845: jas_cmshapmat_apply:Assertion 0 failed. Aborted

And the process dies I hope you find that useful

Thanks again :)

magwyz commented 8 years ago

Could you attach a sample image to this issue? Thanks

Victorgf87 commented 8 years ago

If you are asking for the image I was using it was this file: h2

As you can see it's just a bad image, it was a jpg file processed with base64

One last question, I'm trying to create an Android application using pastec and Retrofit, but I can't make it work. Do you know what is the exact equivalent to "--data-binary" in Retrofit? I have tried a several things like multipart with Requestbody and yet it doesn't work

Again, thanks for everything