EEA Depiction (formerly valentine.imagescales)
Project description
Introduction
EEA Depiction (formerly valentine.imagescales) is a generic system for creating thumbnails/image representations for content types, both those provided by Plone, and custom ones.
At the moment this system is implemented and tested only on Archetypes content types, however this system could be adapted in a later version to work also for dexterity content types.
To make it work for a content type, three adapters need to be provided:
ImageView that retrieves an image in the desired scale.
ImageTag that returns the HTML tag for the image
ImageLink that returns the HTML link to the image.
Upgrade notes
As of eea.depiction 5.2 we customize the following resources in order to display any items in thumbnail listings:
atctListAlbum.py - which is responsible for displaying items in atct_album_view.pt
thumbnail_view.pt - which is the browser template responsible for thumbnail listing for the plone.app.collection package
Installation
zc.buildout
If you are using zc.buildout and the plone.recipe.zope2instance recipe to manage your project, you can do this:
Update your buildout.cfg file:
Add eea.depiction to the list of eggs to install
Tell the plone.recipe.zope2instance recipe to install a ZCML slug
[instance] ... eggs = ... eea.depiction zcml = ... eea.depiction-overrides eea.depiction
Re-run buildout, e.g. with:
$ ./bin/buildout
You can skip the ZCML slug if you are going to explicitly include the package from another package’s configure.zcml file.
How to specify fallback preview images
eea.depiction 0.3 introduces the concept of fallback images when the regular image traversal fails. The logic works like this:
Look for an image returned by the contexts ‘imgview’ adapter
If the imgview crashes, isn’t found or can not locate/generate an image, we continue by checking if there’s an image specified for any of the contexts interfaces.
If there’s no fallback image, we look for an image for the context portal type, e.g. article, news-item, document. This should be placed in the ‘portal_depiction’ utility (Site Setup > Depiction Library)
Uses the generic content type image, i.e. portal_depiction/generic
Thus:
To map a fallback image to a portal type, place it in this folder and name it after the portal type.
To map a fallback image to an interface just add a named-utility for IDepictionVocabulary (see eea.depiction.vocabularies)
Dependencies
- EEA Depiction has the following dependencies:
Plone 4+
Pillow
- This package also supports p4a.video. Thus the following dependencies are optional:
p4a.video
[instance] ... eggs = ... eea.depiction [full]
Source code
- Latest source code (Plone 4 compatible):
Copyright and license
The Initial Owner of the Original Code is European Environment Agency (EEA). All Rights Reserved.
The eea.depiction (the Original Code) is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
More details under docs/License.txt
Funding and project management
EEA - European Environment Agency (EU)
Changelog
8.3 - (2020-12-02)
Bugfix: don’t hardcode image field for dexterity adaptor [tiberiuichim]
8.2 - (2020-01-15)
Feature: added ability to provide a fallback image for a specific scale name for example if we want to have a different fallback image for the large scale of a Document we can add an image with the id document-large and for image_large this image will be used instead of the Document fallback image or any given generic image if no image is added for Document in general. Through acquisition you can also override the served image if you add an image with id document-large within a parent container. [ichim-david refs #111968]
8.1 - (2019-10-19)
Feature: Added possibility to provide custom IRecreateScales adapter for custom content-type. [avoinea refs #109515]
8.0 - (2019-09-30)
Upgrade step: Within “Plone > Site setup > Add-ons” click on upgrade button available for eea.depiction [avoinea refs #109515]
Upgrade step: Within “Plone > Site setup > Image scales” regenerate image scales for your portal-types [avoinea refs #109515]
Change: Added @@recreate-scales browser-view utility [avoinea refs #109515]
Change: Added more custom image scales: panoramic, print, landscape, portrait, wide, xlarge [avoinea refs #109515]
Bug fix: Fixed ATFolder imgview adapter for multi-lingual cover images [avoinea refs #109515]
7.3 - (2019-08-16)
Change: thumbnail_view now uses image_mini size as a background image instead of an image tag [ichim-david refs #106884]
7.2 - (2019-01-28)
Jenkins: Add sonarqube step [avoinea refs #101552]
7.1 - (2018-06-20)
Change: updated URLs pointing to eea.europa.eu with https:// [alecghica refs #95849]
7.0 - (2018-02-08)
Bug fix: allow Dexterity containers to show contained image as thumb [tiberich #92045]
Bug fix: handle more cases of images in eea.rdfmarshaller depiction modifier [tiberich #92045]
Bug fix: use a NamedBlobImage when adding initial image. This fixes issues with Plone websites that have replaced the default Archetypes-based content types with those derived from Dexterity. In case you have such a website, you should delete the “/portal_depiction/generic” image and reimport the EEA Depiction - Import Various generic setup step. [tiberich #92045]
Bug fix: fix Dexterity implementation for scales [tiberich #92045]
6.9 - (2017-12-12)
Change: Replace eeacms/zptlint with eeacms/plone-test:4 zptlint [avoinea refs #90415]
6.8 - (2017-10-30)
Bug fix: fix tests for compatibility with eea.rdfmarshaller [tiberich]
Bug fix: don’t fail if dexterity content has no image field [tiberich #89405 CCA]
Change: Remove Sphinx generated documentation [petchesi-iulian refs #88212]
6.7 - (2017-09-22)
Bug fix: Fix eea.depiction tests [avoinea]
6.6 - (2017-09-19)
Bug fix: Fix eea.depiction for rdfmarshaller [avoinea]
6.5 - (2017-09-15)
Change: added ICountryProfile to DepictionVocabulary interfaces [ichim-david refs #88123]
6.4 - (2017-08-29)
Bug Fix: Changed the way in which the DexterityImageView retrieves images [iulianpetchesi #87511]
6.3 - (2017-08-16)
Change: Added some unit tests for rdf marshaller [zoltan_andras refs #86696]
Bug fix: Treated get_size error when the blob is represented as a string [zoltan_andras refs #86449]
6.2 - (2017-06-26)
Bug fix: tests fixes, failling tests in other products
Bug fix: fixed PyLint warnings and errors [zoltan_andras refs #81209]
6.1 - (2017-05-15)
Change: fixed PyLint warnings and errors [eduard-fironda refs #84949]
6.0 - (2017-04-24)
Change: updated package information [eduard-fironda]
5.9 - (2017-04-14)
Change: Enabled compatibility with eea.rdfmarshaller [zoleesan - refs #83153]
5.8 - (2016-05-19)
Bug fix: Fix pylint warnings [chiridra refs #71940]
5.7 - (2015-10-05)
Bug fix: Add missing GenericSetup importStep dependency [voineali refs #27405]
5.6 - (2015-08-18)
Change: Auto-include zcml within plone context in order to make this package work without having to add it within buildout zcml directive. [avoinea]
5.5 - (2015-03-17)
Change: Switched to curl in the jenkins build install script [olimpiurob refs #22402]
Change: Changed fetch url for jenkins build install script to the install script from the main EEA CPB repository [olimpiurob refs #22402]
5.4 - (2014-12-23)
Bug fix: eea-depiction-various importStep shows up as unresolved dependency [jean]
5.3 - (2014-01-22)
Bug fix: Updated old URLs pointing Trac [ghicaale refs #18003]
Feature: adding Sphinx-generated documentation in Page Template format [batradav refs #9502]
5.2 - (2012-11-09)
Feature: added information for contributors [ciobabog refs #13892]
Upgrade step: Within “Plone > Site setup > Add-ons” click on upgrade button available for eea.depiction [ichimdav #5601]
Feature: customized thumbnail_view for plone.app.collection in order to display all items since they have fallback images [ichimdav #5601]
Feature: customized atctListAlbum to display all items when using atct_album_view [ichimdav #5601]
5.1 - (2012-10-08)
Change: Using atct_album_view as the default view for portal_depiction [voineali refs #5497]
5.0 - (2012-09-25)
Upgrade step: Within “Plone > Site setup > Add-ons” click on upgrade button available for eea.depiction or install ‘EEA Depiction’ if it’s not already installed.
Feature: Added utilities IDepictionTool and IDepictionVocabulary [voineali refs #5497]
Feature: Made p4a.video dependency optional [voineali refs #5497]
Change: Refactoring valentine.imagescales to eea.depiction [voineali refs #5497]
4.3 - (2012-08-27)
Bug fix: added type profile for Topic, fixes tests in Plone 4.2 [tiberich #5346]
4.2 - (2012-07-13)
Feature: Updated PIL dependency with Pillow [voineali]
4.1 - (2011-11-18)
Rerelease broken egg
4.0 - (2011-11-18)
Bug fix: added views registered for default image thumbnail sizes; allows plone filters to properly retrieve the image from html text links [tiberich #4651]
Feature: added a interface mapping fallback for our simile exhibit daviz product. [demarant]
Bug fix: fixed a bug with atfield adapter not properly dealing with broken blobs [tiberich]
Bug fix: fixed a bug with the traverser being triggered for atct_image_transform [tiberich]
Bug fix: Plone4 compatibility [tiberich]
Bug fix: Fixed pylint/pyflakes warrnings [ghicaale]
Change: Restructured package to work with plone.app.imaging instead of overriding it [tiberich #4284]
Change: return the whole image when it’s not possible to return a scale in imgview for folders and fields [tiberich #4374]
Feature: Added upgrade steps [voineali #4392]
Feature: Plone 4.x compatible release [tiberich #4284]
0.11 - (2011-10-07)
Feature: added a interface mapping fallback for our simile exhibit daviz product. [demarant]
0.10 - (2011-05-25)
Bug fix: added workaround for a traversing bug [tiberich EEA #4363]
0.9 - (2011-05-13)
Bug fix: fixed scale for folder, in order to get first Image [ghicaale EEA #4347]
0.8 - (2011-05-03)
Bug fix: replaced call to getFolderContents with direct search in catalog [tiberich]
0.7 - (2011-03-28)
Bug fix: Added translation domain to ZCML files [voineali #4139]
Bug fix: Return the field when traversing to /image in traverser [tiberich #4135]
0.6 - (2011-02-17)
Bug fix: Use try/except in display method to avoid errors when blobs are missing [tiberich]
0.5 - (2011-01-26)
Feature: Added JPEG to known formats for thumbnails [voineali #3847]
0.4 - (2010-05-17)
Bug fix: Fixed “typo” in fallback interfaces map. [pthulin]
0.3 - (2010-05-07)
Feature: Use fallback images to ensure that an image is always returned. [pthulin]
0.2.1 - (2010-01-18)
Cleanup: Removed empty skin folder
0.2 - (2010-01-18)
Feature: Thumbnails are always in formats PNG, JPG or GIF even if original is something else i.e TIFF
Feature: Enabled folder.ImageView for ATTopics. [pthulin]
Bug fix: Fixed bug where 16:9 images scaled to 16:9 background resulted in black borders. [pthulin]
Cleanup: Simplified design, removed ImageLink and ImageTag. [pthulin]
Feature: Add black borders to 4:3 images scaled to 16:9, and don’t stretch the play button. [pthulin]
0.1 - Unreleased
Initial release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file eea.depiction-8.3.zip
.
File metadata
- Download URL: eea.depiction-8.3.zip
- Upload date:
- Size: 106.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.1.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/2.7.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12ee6868973e21843fd6394c78ac468dfb21831ee8fa592e717df083fd656fc1 |
|
MD5 | 95a5a618c0ee15b291f3f4a61a549cbd |
|
BLAKE2b-256 | ac5ad1c88c5e35e972eecc340ae04a81ed2fc819584ba3253410971f1c9c18b6 |