image quality can be set in config file
(cherry-picked from https://gitorious.org/~dunkyp/mediagoblin/dunkyps-mediagoblin/commits/image_quality)
This commit is contained in:
parent
12dccc4552
commit
35f6d6a750
@ -91,6 +91,8 @@ max_height = integer(default=180)
|
|||||||
[media_type:mediagoblin.media_types.image]
|
[media_type:mediagoblin.media_types.image]
|
||||||
# One of BICUBIC, BILINEAR, NEAREST, ANTIALIAS
|
# One of BICUBIC, BILINEAR, NEAREST, ANTIALIAS
|
||||||
resize_filter = string(default="ANTIALIAS")
|
resize_filter = string(default="ANTIALIAS")
|
||||||
|
#level of compression used when resizing images
|
||||||
|
quality = integer(default=75)
|
||||||
|
|
||||||
[media_type:mediagoblin.media_types.video]
|
[media_type:mediagoblin.media_types.video]
|
||||||
# Should we keep the original file?
|
# Should we keep the original file?
|
||||||
@ -113,7 +115,6 @@ video_codecs = string_list(default=list("VP8 video"))
|
|||||||
audio_codecs = string_list(default=list("Vorbis"))
|
audio_codecs = string_list(default=list("Vorbis"))
|
||||||
dimensions_match = boolean(default=True)
|
dimensions_match = boolean(default=True)
|
||||||
|
|
||||||
|
|
||||||
[media_type:mediagoblin.media_types.audio]
|
[media_type:mediagoblin.media_types.audio]
|
||||||
keep_original = boolean(default=True)
|
keep_original = boolean(default=True)
|
||||||
# vorbisenc quality
|
# vorbisenc quality
|
||||||
@ -121,13 +122,13 @@ quality = float(default=0.3)
|
|||||||
create_spectrogram = boolean(default=True)
|
create_spectrogram = boolean(default=True)
|
||||||
spectrogram_fft_size = integer(default=4096)
|
spectrogram_fft_size = integer(default=4096)
|
||||||
|
|
||||||
|
|
||||||
[media_type:mediagoblin.media_types.ascii]
|
[media_type:mediagoblin.media_types.ascii]
|
||||||
thumbnail_font = string(default=None)
|
thumbnail_font = string(default=None)
|
||||||
|
|
||||||
[media_type:mediagoblin.media_types.pdf]
|
[media_type:mediagoblin.media_types.pdf]
|
||||||
pdf_js = boolean(default=False)
|
pdf_js = boolean(default=False)
|
||||||
|
|
||||||
|
|
||||||
[celery]
|
[celery]
|
||||||
# default result stuff
|
# default result stuff
|
||||||
CELERY_RESULT_BACKEND = string(default="database")
|
CELERY_RESULT_BACKEND = string(default="database")
|
||||||
|
@ -72,7 +72,9 @@ def resize_image(entry, filename, new_path, exif_tags, workdir, new_size,
|
|||||||
# Copy the new file to the conversion subdir, then remotely.
|
# Copy the new file to the conversion subdir, then remotely.
|
||||||
tmp_resized_filename = os.path.join(workdir, new_path[-1])
|
tmp_resized_filename = os.path.join(workdir, new_path[-1])
|
||||||
with file(tmp_resized_filename, 'w') as resized_file:
|
with file(tmp_resized_filename, 'w') as resized_file:
|
||||||
resized.save(resized_file)
|
resized.save(resized_file,
|
||||||
|
quality=mgg.global_config['media_type:mediagoblin.media_types.image']\
|
||||||
|
['quality'])
|
||||||
mgg.public_store.copy_local_to_storage(tmp_resized_filename, new_path)
|
mgg.public_store.copy_local_to_storage(tmp_resized_filename, new_path)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user