# Bram de Jong <bram.dejong at domain.com where domain in gmail>
# 2012, Joar Wandborg <first name at last name dot se>
-import Image, ImageDraw, ImageColor #@UnresolvedImport
+from PIL import Image, ImageDraw, ImageColor #@UnresolvedImport
from functools import partial
import math
import numpy
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import Image
-import ImageFont
-import ImageDraw
+try:
+ from PIL import Image
+ from PIL import ImageFont
+ from PIL import ImageDraw
+except ImportError:
+ import Image
+ import ImageFont
+ import ImageDraw
import logging
import pkg_resources
import os
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import chardet
import os
-import Image
+try:
+ from PIL import Image
+except ImportError:
+ import Image
import logging
from mediagoblin import mg_globals as mgg
"""Code to process a txt file. Will be run by celery.
A Workbench() represents a local tempory dir. It is automatically
- cleaned up when this function exits.
+ cleaned up when this function exits.
"""
entry = proc_state.entry
workbench = proc_state.workbench
# Bram de Jong <bram.dejong at domain.com where domain in gmail>
# 2012, Joar Wandborg <first name at last name dot se>
-from PIL import Image
+try:
+ from PIL import Image
+except ImportError:
+ import Image
import math
import numpy
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import logging
-import Image
+try:
+ from PIL import Image
+except ImportError:
+ import Image
from mediagoblin.processing import BadMediaFail
from mediagoblin.media_types.audio import audioprocessing
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import Image
+try:
+ from PIL import Image
+except ImportError:
+ import Image
import os
import logging
pygst.require('0.10')
import gst
import struct
-import Image
+try:
+ from PIL import Image
+except ImportError:
+ import Image
from gst.extend import discoverer
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
-import Image
+try:
+ from PIL import Image
+except ImportError:
+ import Image
from mediagoblin.tools.exif import exif_fix_image_orientation, \
extract_exif, clean_exif, get_gps_data, get_useful