0

Image handling

Posted July 2nd, 2010 in by thomas

filesystem

public : /sites/default/files

every files are downloadable, they can be hidden via permissions but accessible through file system

private : /system/files

drupal control file download and show 403 if no permission


cck

imagefield D7core

Depends on filefield D7core :  ajax uploads

-> restriction on image : type / size / resolution
-> features : alt / title tags with tokens, default image
-> display : image, link, path, IMAGECACHE preset

further config / features

-> “full” gd library (not default on debian like)  or this link
-> uploadprogress install it with pear  [pecl install uploadprogress]
-> max file size (htaccess or php.ini) :  [post_max_size = 100M] and [upload_max_filesize = 2M] directive

imagecache D7core : presets on cck + views

Depends on imageapi D7core and gd library [aptitude install php5-gd]
call with [print theme('imagecache', 'imagecache_preset_name', 'original_image_filepath', "alt_tag", "title_tag", "custom_attributes_as_class_or_id"); ]

-> play with size, rotation, + effects – desaturate (bw conversion) – sharpening
-> create image on demand. if file doesn’t exist, image cache create it

imagecache_actions D7 ?

-> “layer style“  : Watermark (place an image over a source picture), Background, text overlay, canvas manipulation
-> colors : colorize image, invert, darken / lighten
-> feature : rounded corners, alpha blending, file format switcher

imagecache_profiles
imagecrop / imagefield_crop :  js resizing
imagefield_extended : Add additional data to images other than the default Description, Title and Alt.
image_fupload : upload multiple images with one simple click

bonus :

image integration with wysiwyg

wysiwyg D7ready + tinymce (see wysiwyg config) + imce D7ready + imce_wysiwyg bridge D7?
activate in “button and plugin” > imce (wysiwyg > tinymce config)

alternative to imce filefield_insert “use a cck filefield for uploading images and send the image to the RTE”

lightbox integration and plenty of gallery modules…

Leave a Reply