I would like to request a feature that would allow a person to manually upload an alternative image instead of the automatically created one.

For example, a user with an image gallery would have a thumbnail preset. He can upload images and thumbnails would be created automatically by default. But if he wants a custom thumbnail with special cropping or whatever, then he can upload an image that will replace the automatically created one.

Currently this can be done by manually uploading an image via ftp with the same file name as the existing thumbnail. Could this be achieved from within the drupal control panel?

Thanks

basically, a form field that would over write the automatically created preset image.

Comments

jelo’s picture

Subscribed. I have the same issue. In general I am fine with the automatic thumbnails, but if you have the resources to create something more suitable, you should just be able to overwrite the standard setting to include a thumbnail with the image. Any idea how this can be done in the current version without manually overwriting thumbnail files? Thanks, Jens

eojthebrave’s picture

If you're using imagefield module to upload images you could probably set up two separate image fields. One of the normal image and one for the thumbnail. Then when displaying the image thumbnail you could check to see if there was a "custom" thumbnail first and if so display that, otherwise fall back on the imagecache generated thumbnail.

dman’s picture

Status: Active » Closed (works as designed)

Using two imagefields for two different image types is the best way for this under the current architecture. Then theme to decide which to display where.
Manually uploading to an imagecache preset location - however you do it - would risk that getting deleted next time the cache (it is only a cache, not a document management system) is flushed.

If you want image and alt-image in the one place ... imagecache is not the place for this to happen.

jdln’s picture

Are imagecache images only flushed with the cache if you chance the image cache preset? I just flushed the cache with my admin menu and the images I had modified aren't changed.

dman’s picture

off-topic, but the admin_menu cache button only affects the database.
imagecache is something entirely different. To flush those files, use the imagecache UI.

jdln’s picture

Using two imagefields for two different image types is the best way for this under the current architecture. Then theme to decide which to display where.

How can I do this? Is there some way in Views of showing the imagecache field unless the 'manual field' has a value, in which case show the 'manual field' instead?
Thanks

dman’s picture

Not in views, do it in a theme override. Probably to the field renderer

jdln’s picture

What do you mean by field renderer?

Apparently this is the code to print one field unless its empty then print another field;

<?php
  if ($fields['field_a']->content != '') {
    print $fields['field_a']->content;
  } else {
    print $fields['field_b']->content;
  }
?>

However how can you print a filed using an image cache preset?
Thanks

jdln’s picture

Apparently you cant print fields in the normal way from views.

Im overriding the views-view-field.tpl.php file. Their is only 1 field in my override, which is an image. I can print the image as a number with this;

<?php print $row->{$field->field_alias}; ?>

How can I print an image cache preset of the image, rather than just a number?

Thanks