Needs work
Project:
SWFUpload
Version:
6.x-2.0-beta3
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
15 May 2010 at 22:04 UTC
Updated:
2 Dec 2010 at 16:31 UTC
Jump to comment: Most recent file
Comments
Comment #1
David Lesieur commentedTo be more exact, the thumbnail size was not hardcoded. Only its default value was hardcoded. But no way was provided to override the default. :-) This patch allows admins to override the default.
Comment #2
David Lesieur commentedComment #3
j0e commentedI applied the patch to test. Where is the override form supposed to appear? Admin settings? Don't see any options there for configuring swfupload. And the cck widget doesn't seem to provide settings for configuring the size of the thumbnail. Also: does this patch take care of the way the css is affected. I attempted to simply tweak the hardcoded 32x32 to 100x100 in the admin file for a new default and to modify the .sfwupload-list-mime css to 100width and 100height, but the progress bar which is working by percents gets really squeezed by the new settings.
Joseph
Comment #4
David Lesieur commentedThe patch adds a new settings page in the Site configuration menu. It also does not affect the CSS, so it's true that there might be a theming issue. I'm not sure how worth the patch is if the admin is required to manually tweak the CSS...
Comment #5
eugenmayer commentedAs we have a patch, setting to review
Comment #6
robloachWhat if instead of a given size, it took a given ImageCache preset?
Comment #7
David Lesieur commentedIt completely invalidates the current patch, but I like this idea. :-)
Comment #8
skilip commentedWhat's the advantage of ImageCache here? We only need a width and a height, don't we?
Comment #9
robloachSeems like it, and what happens when ImageCache isn't around? :-)
Comment #10
David Lesieur commentedWe only need a width and a height until we want a more complex transformation... (e.g. cropping to get square thumbnails)... However, those thumbnails have such a limited use that this kind of requirement can be considered excessive.
Not sure what would happen if ImageCache wasn't around. Could it be acceptable to require it? That may seem exaggerated given its usefulness to SWFUpload, but on the other hand ImageCache-like functionality is in D7 core and therefore has become a standard tool.
A benefit of using ImageCache is that it would become possible to re-use a preset that's also used elsewhere on the site. The same thumbnails could serve multiple purposes, instead of having yet another set of thumbnails that's only useful to SWFUpload.
Comment #11
skilip commentedAdding a condition for when imagecache is enabled is easy. I'm a bit afraid of the amount of extra code for this feature. I estimate it will be 40 - 80 lines extra.
Comment #12
eugenmayer commentedSkilip we should start to move all this to submodules otherwise this module gets unuseful for a lot of people, as it has to much code + deps. What do you think?
Comment #13
David Lesieur commentedUsing ImageCache would simplify the thumbnail generation code because all we'd need to do is create the thumbnail's path. The swfupload_thumb() function would mostly disappear. So I think that using ImageCache could actually help SWFUpload focus on its main task.
Comment #14
j0e commentedso i went to: admin/settings/swfupload
changed the default from 32x32 to 75x75
no change reflected when i tried the upload.
same 32x32 thumbnail appeared...
Comment #15
steven jones commentedThis patch is against 6.x-1.x
Comment #16
steven jones commentedAttached is a patch for the 2.x branch. It adds support for using an imagecache preset for upload thumbnail generation.
It works, apart from the fact that the thumbnail is displayed as a background-image on a div with a fixed width and height, so although the image is actually bigger/smaller, it doesn't appear to be so.
Comment #17
j0e commentedhi Steven, no patch for 6.x-2.0-beta3 attached to your last comment...
Comment #18
steven jones commentedSilly d.o.
This patch needs work, because I've not changed the creation of thumbnails when editing a node, just adding it.
Comment #19
bwoods commentedMaybe I'm oversimplifying the error checking for this patch, but I modified the swfupload_admin_settings_validate function slightly:
This seems to work OK.
Comment #20
patrickroma commenteddoes this also work for beta7?
Comment #21
skilip commentedSorry for the huge delay on this!
I am willing to get this patch in. Cal anyone re-roll this patch against last dev version?
One thing to mention:
The form field 'Thumbnail type' isn't needed if the ImageCache module isn't installed. Please make it conditional.