ilscipio/scipio-erp

View on GitHub
framework/common/config/imageops.properties

Summary

Maintainability
Test Coverage
# SCIPIO: Common image operation properties
# Added 2017-07-10.
# Any component can define a file with this name; the ops definitions will be merged together (similar to freemarkerTransforms)
# NOTE: For specific image locations (instances), see the domain-specific configuration files:
#   content.properties, catalog.properties, etc.


# Image scaler configurations
# These follow the pattern:
#   image.scaler.scalerName.[alias|factoryClass]=[alias scalerName|class location]
#   image.scaler.scalerName.options.option1=val1
#   image.scaler.scalerName.options.option2=val2
#   ...
# factory entries are loaded and replaced in arbitrary order; alias entries are resolved as dependencies (can be out of order).
# WARN: some issues with entry ordering due to property files not preserving order.
# scalerName can be either a specific library OR an abstracted or specific algorithm name.
# In general the default algorithm is "smooth" which is the best quality supported by the API.


# Global default scaler selection (simply alias to one of the factory definitions below)
# uncomment this line (and comment ones below) to use mortennobel (very good scaling quality, slow)
image.scaler.default.alias=mortennobel
# uncomment this line (and comment previous line) to use thumbnailator in auto mode (acceptable scaling quality, fast)
#image.scaler.default.alias=thumbnailator
# the following represents the stock ofbiz default (usually acceptable scaling quality, slow)
#image.scaler.default.alias=java-awt

# Special type option: use this for debugging, to override output image pixel type. Possible values:
#   TYPE_PRESERVE_ALWAYS|TYPE_PRESERVE_IF_LOSSLESS|TYPE_PRESERVE_IF_LOWLOSS|
#   TYPE_INT_RGB|TYPE_INT_ARGB|TYPE_INT_ARGB_PRE|TYPE_4BYTE_ABGR|TYPE_3BYTE_BGR... 
# (see org.ofbiz.common.image.ImageType.ImagePixelType)
#image.scaler.default.options.overridetype=TYPE_PRESERVE_ALWAYS

# The default and fallback types; internally these are initialized to the value specified in:
#   imagecommon.properties#image.type.default
#image.scaler.default.options.defaulttype={default=TYPE_INT_ARGB,noalpha=TYPE_INT_RGB}
#image.scaler.default.options.fallbacktype={default=TYPE_INT_ARGB,noalpha=TYPE_INT_RGB}

# Specific APIs (factories - see classes for all available options)
# java-awt (default/smooth filter: areaaveraging)
image.scaler.java-awt.factoryClass=org.ofbiz.common.image.scaler.AwtImageScaler$Factory
image.scaler.java-awt.options.filter=smooth
# mortennobel java-image-scaling (default/smooth filter: lanczos3)
image.scaler.mortennobel.factoryClass=org.ofbiz.common.image.scaler.MnjimImageScaler$Factory
image.scaler.mortennobel.options.filter=smooth
# thumbnailator (default/smooth filter: smooth-auto, which selects between progbilinear, bicubic and bilinear automatically)
# WARN: thumbnailator may have problems with indexed images; may produce non-indexed images as a workaround
image.scaler.thumbnailator.factoryClass=org.ofbiz.common.image.scaler.ThumbnailatorImageScaler$Factory
image.scaler.thumbnailator.options.filter=smooth
# preserve - doesn't resize
image.scaler.preserve.factoryClass=org.ofbiz.common.image.scaler.PreserveImageScaler$Factory

# UNMAINTAINED specific APIs (NOTE: their libs may or may not be removed from compilation, and the factoryClass may be incomplete)
# twelvemonkeys common-image (default/smooth filter: lanczos3)
#image.scaler.twelvemonkeys.factoryClass=org.ofbiz.common.image.scaler.TwelvemonkeysImageScaler$Factory
#image.scaler.twelvemonkeys.options.filter=smooth
# imgscalr (default/smooth filter: ultra)
#image.scaler.imgscalr.factoryClass=org.ofbiz.common.image.scaler.ImgscalrImageScaler$Factory
#image.scaler.imgscalr.options.filter=smooth

# Composed/complex - can provide Thumbnailator-like default resizer (smooth-auto) emulation 
# TODO: need to exploit this to choose the best algo for dest image size...
image.scaler.composed-auto.factoryClass=org.ofbiz.common.image.scaler.ComposedImageScaler$Factory
image.scaler.composed-auto.options.setorder=same,upscaleMode,small,default
# this behavior is now automatically implied in AbstractImageScaler for all scalers
#image.scaler.composed-auto.options.sets.same.alias=preserve
#image.scaler.composed-auto.options.sets.same.cond=${srcWidth == destWidth and srcHeight == destHeight}
image.scaler.composed-auto.options.sets.upscaleMode.alias=thumbnailator
image.scaler.composed-auto.options.sets.upscaleMode.cond=${srcWidth < destWidth and srcHeight < destHeight}
image.scaler.composed-auto.options.sets.upscaleMode.options.filter=bicubic
# lanczos still better...
#image.scaler.composed-auto.options.sets.small.alias=thumbnailator
#image.scaler.composed-auto.options.sets.small.cond=${destWidth <= (srcWidth*0.5) and destHeight <= (srcHeight*0.5)}
#image.scaler.composed-auto.options.sets.small.options.filter=progbilinear
image.scaler.composed-auto.options.sets.default.alias=mortennobel
image.scaler.composed-auto.options.sets.default.options.filter=lanczos3

# Abstracted algorithms
image.scaler.smooth.alias=thumbnailator
image.scaler.smooth.options.filter=smooth

# Specific algorithms
image.scaler.lanczos3.alias=mortennobel
image.scaler.lanczos3.options.filter=lanczos3
image.scaler.progbilinear.alias=thumbnailator
image.scaler.progbilinear.options.filter=progbilinear
image.scaler.bicubic.alias=thumbnailator
image.scaler.bicubic.options.filter=bicubic
image.scaler.bilinear.alias=thumbnailator
image.scaler.bilinear.options.filter=bilinear


# Image storage format writers configuration
# Any unlisted formats use the standard java ImageIO writer often with default settings,
# while custom formats don't necessarily work using standard ImageIO.
# sequenceNum is the order for consulting the storers - the first that can match the format does the conversion for an image.
# sequenceNum=-1 removes the storer from automatic integration but allows it to be invoked manually (ImageStorers.getStorer("...").write(...)).
#
# Special options:
# imageProfiles: media profile filters to apply storer to certain media profiles, as defined in mediaprofiles.properties and ImageSizePreset.presetId (CMS)
# A profile name alone matches only the exact profile, while a name suffixed with ">*" will match also any child profile:
#image.storer.*.options.imageProfiles=IMAGE_CONTENT,IMAGE_PRODUCT>*

image.storer.default.alias=java-imageio

image.storer.optimize.alias=tinify
image.storer.optimize.options.sequenceNum=-1

image.storer.java-imageio.factoryClass=org.ofbiz.common.image.storer.ImageIOStorer$Factory
image.storer.java-imageio.options.sequenceNum=999
image.storer.java-imageio.options.formats=*

image.storer.format-webp.factoryClass=org.ofbiz.common.image.storer.WebpStorer$Factory
image.storer.format-webp.options.sequenceNum=100
image.storer.format-webp.options.formats=webp
# Lossy|Lossless
image.storer.format-webp.options.compressionType=Lossy
# 0.0-1.0
image.storer.format-webp.options.compressionQuality=

# Tinify TinyJPG/TinyPNG automatic optimize storer of most stored images including product images. apiKey required.
# Use sequenceNum=150 to enable automatic optimization of all written images by the system, -1 to disable and leave to manual calls only
# For manual calls, use the defined alias above: ImageStorers.getStorer("optimize").write(...)
# Note this does not support the resizing function, but the Tinify class is accessible on classpath for custom code.
# https://tinypng.com/developers/reference/java
# NOTE: This API makes a remote request for each image thus may slow down image storing significantly.
image.storer.tinify.factoryClass=org.ofbiz.common.image.storer.TinifyStorer$Factory
image.storer.tinify.options.storerType=optimize
image.storer.tinify.options.sequenceNum=-1
image.storer.tinify.options.formats=jpeg,jpg,png
image.storer.tinify.options.imageProfiles=IMAGE_CONTENT,IMAGE_PRODUCT>*
image.storer.tinify.options.wrappedStorer=default
image.storer.tinify.options.apiKey=
image.storer.tinify.options.proxy=
image.storer.tinify.options.logLevel=info