Add uncropped image to Display Fields list

biocomp.pat - April 7, 2009 - 22:55
Project:Imagefield Crop
Version:6.x-1.0-rc1
Component:User interface
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Description

Is there any way to have Imagecache actions work the result of an Imagefield Crop? I was hoping to be able to be able to added rounded corners to the scaled down version...

Anyone have any ideas?

Great module by the way!

#1

johnmunro - April 8, 2009 - 01:57

This works fine just as it should. See here for an example http://www.dsty.jp/schule/news/christian-wulff-besucht-die-dsty

Is it going wrong for you or are you just not sure how to do it? If the latter, make sure you are setting the "Display Fields" properties tab in the content type.

#2

biocomp.pat - April 25, 2009 - 07:24

Thanks very much john! I did end up figuring it out afterwards, although after the fact, I realized it would be nice to be able to manipulate the full imagefield_crop image with imagecache as opposed to just the cropped version. That way, imagefield_crop could be used to focus on an area of interest, and imagecache could manipulate the full image for other uses. For example, in field display settings (when editing content types), there's be two options to select for each imagecache preset -- _full and _crop.

Unless this already exists and I'm getting ahead of myself again! :)

#3

johnmunro - April 25, 2009 - 22:20
Title:Imagecache Actions afterwards?» Add uncropped image to Display Fields list
Category:support request» feature request

Patrick, does my change in the title of this issue match what you are thinking?

#4

biocomp.pat - May 6, 2009 - 19:04

Yeah, perfect John! That's MUCH more concise...

#5

canaryMason - May 26, 2009 - 16:21

subscribe. It would be nice if to be able to apply imagecache to both or either the cropped and uncropped versions

#6

q0rban - September 23, 2009 - 17:05

subscribe. This would be really nice for modal image views. You can have the cropped version of the photo zoom to the full image size.

#7

q0rban - September 23, 2009 - 19:12
Status:active» needs review

Attached patch adds uncropped formatters for each imagecache preset. Might be nice to add an admin interface to enable this functionality, as it definitely murks up your UI if you have lots of IC presets.

AttachmentSize
imagefield_crop_426892_7.diff 5.99 KB

#8

cels - November 17, 2009 - 08:45

Review the patch: works for imagecache.

The ".crop_display.jpg" it's a little bit weird filename, but it's works with imagecache profiles. Is possible to change the filename? By example, add a prefix instead the suffix.

Note, it's "quick&dirty" example:

<?php
function imagefield_crop_file_admin_crop_display_path($file) {
 
$file = (object)$file;
   
 
$filename = basename($file->filepath);
 
$path = $file->filepath;
 
$replace = 'original_display_' . $filename;

  return
str_replace($filename,$replace,$path);
}
?>

#9

couzinhub - November 6, 2009 - 23:29

Patch works great for me, this is a really awesome addition, avoiding to create multi imagefields.
Thanks ! Can't wait to have this in next release !!

#10

trupal218 - November 8, 2009 - 15:10

subscribing

#11

jacktonkin - November 16, 2009 - 14:01
Version:6.x-1.0-beta3» 6.x-1.0-rc1

Patch #7 still applies to 1.0-rc1 and works as expected. This is a key feature for me too.

Some notes:
1. The filenames for uncropped images are a little odd (as noted in #8). Also, I uploaded a test.gif and got test.gif.crop_display.jpg (the image is actually a gif, not a jpeg). Could be a bug for another issue though, because it probably affects all crop_display images.

2. There is a todo in this patch that is copied from the imagecache module.

3. The formatters are added to all filefields no matter which widget is selected - this is the same behaviour as imagecache, so there may not be a way to fix this with the current APIs.

Would really like to see this (or similar functionality) in 1.0!

 
 

Drupal is a registered trademark of Dries Buytaert.