You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2013/07/24 00:36:35 UTC

[19/27] git commit: [#6487] handle more complex content-types, e.g. from http://code.google.com/p/msysgit/logo?cct=1342277278

[#6487] handle more complex content-types, e.g. from http://code.google.com/p/msysgit/logo?cct=1342277278


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/775dfc13
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/775dfc13
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/775dfc13

Branch: refs/heads/cj/6456
Commit: 775dfc13f5c4b398e4ce8bfb42278dc82982b410
Parents: cab63ab
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Tue Jul 23 20:15:30 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Jul 23 20:49:59 2013 +0000

----------------------------------------------------------------------
 Allura/allura/model/filesystem.py                | 1 +
 ForgeImporters/forgeimporters/google/__init__.py | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/775dfc13/Allura/allura/model/filesystem.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/filesystem.py b/Allura/allura/model/filesystem.py
index 1bb0087..dbe1aa7 100644
--- a/Allura/allura/model/filesystem.py
+++ b/Allura/allura/model/filesystem.py
@@ -162,6 +162,7 @@ class File(MappedClass):
         if content_type is None:
             content_type = utils.guess_mime_type(filename)
         if not content_type.lower() in SUPPORTED_BY_PIL:
+            log.debug('Content type %s from file %s not supported', content_type, filename)
             return None, None
 
         try:

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/775dfc13/ForgeImporters/forgeimporters/google/__init__.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/google/__init__.py b/ForgeImporters/forgeimporters/google/__init__.py
index 332d075..f4a7b7a 100644
--- a/ForgeImporters/forgeimporters/google/__init__.py
+++ b/ForgeImporters/forgeimporters/google/__init__.py
@@ -69,8 +69,9 @@ class GoogleCodeProjectExtractor(object):
         fp_ish = urllib2.urlopen(icon_url)
         fp = StringIO(fp_ish.read())
         M.ProjectFile.save_image(
-            icon_name, fp, fp_ish.info()['content-type'], square=True,
-            thumbnail_size=(48,48),
+            icon_name, fp,
+            fp_ish.info()['content-type'].split(';')[0],  # strip off charset=x extra param,
+            square=True, thumbnail_size=(48,48),
             thumbnail_meta={'project_id': self.project._id, 'category': 'icon'})
 
     def get_license(self):