photo / import

Import tool companion for all of the export tools
http://theopenphotoproject.org
Apache License 2.0
16 stars 11 forks source link

Invalid MIME type when running import #19

Closed ianrenton closed 11 years ago

ianrenton commented 11 years ago

When I run the import script, I get the following error:

Processing 1 of 2511 20060110T173838-84880548.json ...
Traceback (most recent call last):
  File "import.py", line 91, in <module>
    import_into_openphoto(client)
  File "import.py", line 42, in import_into_openphoto
    resp = client.post('/photo/upload.json', params)
  File "/usr/local/lib/python2.6/dist-packages/openphoto/openphoto_http.py", line 87, in post
    return self._process_response(content)
  File "/usr/local/lib/python2.6/dist-packages/openphoto/openphoto_http.py", line 142, in _process_response
    raise OpenPhotoError(error_message)
openphoto.errors.OpenPhotoError: Code 500: Invalid mime type

The contents of 20060110T173838-84880548.json are:

{"license": "CC BY-NC-SA", "title": "dividing", "dateUploaded": 1136914718, "photo": "http://farm1.staticflickr.com/39/84880548_8836262062_o.jpg", "permission": true, "longitude": -1.8705940000000001, "dateTaken": 1124637608, "latitude": 50.763545999999998, "id": "84880548", "tags": "flashbacks,bronzelake,flickr:place_id=3Hf1ls5SUrwCDw"

Any idea what the problem could be? I'm not sure if it's objecting to the MIME type of the JSON file or the JPEG that it references, but the JSON was written by the export-flickr script, and the JPEG loads fine in my browser.

jmathai commented 11 years ago

Not really sure. Does JSON require \'s be escaped?

The mime type referred to is the photo once the API server downloads it.

ianrenton commented 11 years ago

It might do for backslashes, but there are only forward slashes in the JSON AFAICS. I'll hack about with the import code on the server over the weekend and see if I can figure out what it's downloading (if it isn't a real JPEG).

jmathai commented 11 years ago

@ianrenton Much appreciated. Let us know what you find. Also, you can increase the log verbosity by adding this to override.ini.

[epi]
logLevels="crit,warn,info"
ianrenton commented 11 years ago

This issue seems to be resolved for me.