Bug 810641 - Picasa uploads fails if filenames have an uppercase extension
Picasa uploads fails if filenames have an uppercase extension
Product: Fedora EPEL
Classification: Fedora
Component: googlecl (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Niels de Vos
Fedora Extras Quality Assurance
: Patch
Depends On:
  Show dependency treegraph
Reported: 2012-04-07 11:23 EDT by Niels de Vos
Modified: 2014-12-28 07:48 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-12-28 07:48:38 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Proposed patch, backported from the upstream version (1.07 KB, patch)
2012-04-07 11:46 EDT, Niels de Vos
no flags Details | Diff

  None (edit)
Description Niels de Vos 2012-04-07 11:23:54 EDT
Description of problem:
The Picasa service of googlecl fails to upload photos that have uppercase filenames. Renaming the photos to have lowercase extensions makes it possible to upload them.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. rename a photo to something.JPG
2. google picasa -n 'Drop Box' post something.JPG

Actual results:
$ google picasa -n 'Drop Box' post hoppa.JPG 
Loading file hoppa.JPG to album Drop Box
Failed to upload hoppa.JPG. (602: Accepted content types: ['image/bmp', 'image/jpeg', 'image/jpg', 'image/gif', 'image/png', 'image/mpeg', 'image/mpeg4', 'image/3gpp', 'image/quicktime', 'image/mp4', 'image/x-ms-wmv', 'image/avi'])

Expected results:
Upload succeeds.

Additional info:
The problem seems to be that googlecl/picasa/service.py passes the content_type on to the gdata API. googlecl fails to standardize the content_type and the API does a more strict test, causing the upload to fail.

Debugging and some extra checks below:
$ python -m pdb /usr/bin/google picasa -n 'Drop Box' post hoppa.JPG 
> /usr/bin/google(43)<module>()
-> """
(Pdb) b /usr/lib/python2.6/site-packages/gdata/photos/service.py:393
Breakpoint 1 at /usr/lib/python2.6/site-packages/gdata/photos/service.py:393
(Pdb) r
Loading file hoppa.JPG to album Drop Box
> /usr/lib/python2.6/site-packages/gdata/photos/service.py(393)InsertPhoto()
-> 'body':'This is not a valid content type: %s' % content_type,
(Pdb) bt
-> exec cmd in globals, locals
-> main()
-> run_once(options, args)
-> task.run(client, options, args)
-> user=options.owner or options.user)
-> content_type=content_type)
-> content_type)
> /usr/lib/python2.6/site-packages/gdata/photos/service.py(393)InsertPhoto()
-> 'body':'This is not a valid content type: %s' % content_type,
(Pdb) print content_type
(Pdb) print filename_or_handle
(Pdb) import mimetypes as m
(Pdb) m.init()
(Pdb) m.guess_type(filename_or_handle)
('image/jpeg', None)
Comment 1 Niels de Vos 2012-04-07 11:46:44 EDT
Created attachment 575949 [details]
Proposed patch, backported from the upstream version

Tested with build https://koji.fedoraproject.org/koji/taskinfo?taskID=3970606

Test done:
$ google picasa -n 'Drop Box' post hoppa.JPG 
Loading file hoppa.JPG to album Drop Box

Photo got uploaded successfully.
Comment 2 Fedora Update System 2012-04-07 11:56:31 EDT
googlecl-0.9.9-3.el6 has been submitted as an update for Fedora EPEL 6.
Comment 3 Niels de Vos 2012-04-07 11:59:05 EDT
Filed an errata for easy access to allow other to test/use.

The patch is not upstream yet. I do not have any intention to mark this as stable until the patch gets accepted.
Comment 4 Fedora Update System 2012-04-07 15:25:23 EDT
Package googlecl-0.9.9-3.el6:
* should fix your issue,
* was pushed to the Fedora EPEL 6 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=epel-testing googlecl-0.9.9-3.el6'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
Comment 5 Niels de Vos 2012-05-01 05:05:10 EDT
Tried to get in touch with the developers again:
- http://groups.google.com/group/googlecl-discuss/browse_thread/thread/baa6b94ebf5dbdd0#
Comment 6 Niels de Vos 2014-12-28 07:48:38 EST
googlecl is getting retired from EPEL-6, this update will not be made available.

Note You need to log in before you can comment on or make changes to this bug.