There's a great thread here, with a patch in #26 that works great for imagefields to add rotation. http://drupal.org/node/173498

Could this patch be adapted to add rotation support to files uploaded through swfupload?

CommentFileSizeAuthor
#1 swfupload_tar_gz.zip56.44 KBsansui
#1 swfupload.gif24.36 KBsansui

Comments

sansui’s picture

StatusFileSize
new24.36 KB
new56.44 KB

I found someone who added the rotation option to swfupload for me. The module was modified directly, sorry I don't have a patch or anything, but I've included it here in this post as an example or option for others to download if they want.

You must enable the rotation option in the content type, imagemagick needs to be installed and selected in your toolkit. This version doesn't include the modification for htmlspecialchars warning, which you can find in another thread, it also doesn't include the style alterations I added.

So here's the file if someone wants to use it as a starting point of their own. Included a screenshot of how I personally customized it for my own use

k_and_j’s picture

I'm not a developer, so I don't know how to do this, but...

I want my site users to be able to rotate the images after upload in case they don't do it beforehand (a relative just uploaded 20 pictures and almost all of them are sideways... this is an older person, so they're not going to re-do their uploads at this point). Anyway, I found that there is an API: image_gd_rotate. This way ImageMagick would not be needed, right?

Note that I'm not using the full SWFupload - just ImageFUpload, which implements (part of?) it.

skilip’s picture

Rotating images is possible with the Imagecache module. Imagecache rules van be used as formatter fit an imagefield.

k_and_j’s picture

Can you explain this a little more? I'm not a developer and don't want to get into coding at this time, but if I can do this using admin pages, please let me know.

skilip’s picture

  • Enable the ImageCache module.
  • Create a new ImageCache preset (admin/build/imagecache).
  • Add a 'rotate' filter to your preset.
  • Use the ImageCache as formatter for your Filefield (admin/content/node-type/YOUR_CONTENT_TYPE/display).
sansui’s picture

Are you sure it's the same thing skilip? The imagecache action looks like it just rotates everything. The patched version of swfupload I included allows uses to pick and choose which images to rotate individually, as images they upload vary between vertical and horizontal orientation

k_and_j’s picture

Still would like to get this working. Sansui is correct that skilip's solution rotates all images. I want users to be able to pick and choose in the event that they don't rotate the images before uploading.

I just added Draggable Views to my gallery so that photos can be put into a new order. It would be great if I could add a checkbox on the "rearrange photos" page that would allow the user to select if they also want to rotate the image 90 CCW or 90 CW or not at all... any ideas on how to implement this?

Again - I'm not going to start coding this, but I am starting to learn my way around Views, so if there's someway to do it there...

peter.bod’s picture

This is just Magic! Why is not it included in the SWFUpload module? Thank you very much for sharing!