Automatic image rotation

I have a patch that enables automatic image rotation in minishowcase. Would this be of interest to the community?

The attached archive contains the modified code and diffs (and the original code for baseline). Please let me know if there is a better way to submit code.

(Please ignore the function scanDirImages(); it has nothing to do with image rotation)


  • that is wonderful ziffusion. could you add a little more information? have you tested it in different browsers? does it work in particular PHP installs?

    that would really help :)
  • edited April 2010
    I've tested on Firefox, IE(7, 8) and Chrome; it should work in other browsers as well.

    It uses the "imagerotate()" function, which is available in PHP4 (>= 4.3.0) and PHP5. It is a part of the PHP GD library, which minishowcase uses already, so it should work wherever minishowcase works now.
  • hey i tried adding your thing and it seems to only be loading the first picture in the gallery =(
  • @gabbermatt

    1. So, if you comment out the code you took from me, things go back to normal?

    2. You may be running into a PHP out-of-memory condition. Try adding the following line on top of the file "general.init.php" (right after the opening
  • edited April 2010
    I put all the files in the "/gallery/libraries" folder, that is the right place? The files i'm using are the direct ones from your .zip, do i need to add the .diff files also or could I leave them out? (I added them initially just in case)

    I'm not able to set a higher PHP limit b/c my hosting plan but it is already set to 64 mb, maybe I just have too many pictures for it to work? (135 @ 1024x768)

    I'm going to work soon so I won't be able to respond back for a little bit, not until i go on break in about 6 or 7 hours, I'll try to respond then.
  • edited April 2010

    That would be the right place. And, no, you don't need the diff files. I am not sure about too many files. I have some folders where I have large number of pretty big pictures. Besides, things work when you don't use my code, right?

    Send me the original code that you replaced with the files from the zip file *and* the current files that seem to be giving you the problem (just for the heck of it), when you can.
  • Ok, when I get home I will upload them. I had replaced your files with the originals and it went back to working just fine, then added yours back and it went back to only the first picture. So i'm pretty sure it's somewhere in your script =( Wish i knew more bt coding I could try to fix this myself >.
  • @gabbermatt

    I can try and help. But you need to do something for me. Let me take a look at your original files. Or point me to the exact minishowcase package where you got them from.
  • I had downloaded from

    I don't have the original .zip tho =\ Right now i'm using the originals from your .zip and they work just fine if that helps you any.
  • @gabbermatt

    Ah. I wish I could debug this with you somehow. I it would be interesting to find out what causes the application to break. But it's gonna be hard without access. Maybe you can get someone who can debug PHP. Don't forget to post your findings here.
  • Well luckily i work at a web hosting company so maybe i can get one of the guys here to look at it in their off time.

    If/when we find somethign I'll def. post it here
  • Is this available? I'm having trouble with images that are rotated on Macs - they do not display rotated on my linux server running minishowcase.
  • Isn't it more efficient to rotate the images on disk first, before they are displayed? As I understand it, the PHP way is to do the rotate each time the image is loaded.
    I use ImageMagick's 'mogrify' to rotate the images either before I upload them or on the server directly:
    mogrify -auto-orient *jpg
  • edited May 2011
    it is indeed more efficient to do it locally before upload. if you don't have any image editing software, you can always use
  • Can someone please inform me where I can find the zip of the patch to automatically rotate the images? Thanks.
Sign In or Register to comment.