Transform Plugin

331 views
Skip to first unread message

Jonas Temple

unread,
Feb 28, 2012, 5:34:30 PM2/28/12
to ResourceSpace
I'm having a problem with the transform plugin and can't figure out
what's wrong. Whenever I try to use transform, I get the following
error:

/var/www/resourcespace/plugins/transform/pages/crop.php line 70:
getimagesize(/var/www/resourcespace/include/../filestore/tmp/
transform_plugin/pre_25.jpg): failed to open stream: No such file or
directory

RS is installed on Ubuntu server 11.10

I've done the following:
* Ran installation check. Everything OK except the last scheduled task
execution as I haven't set that up yet.
* GraphicsMagick 1.3.12 2010-03-08 Q8 http://www.GraphicsMagick.org/
* The filestore directory is 777 -R

I'd like to use transform to create the animation images for my home
page (among other things). Any suggestions on what to check next?

Much thanks...

David Dwiggins

unread,
Feb 28, 2012, 5:57:34 PM2/28/12
to resour...@googlegroups.com
Transform creates a preview version of the image to use during the cropping process. This is failing to happen for some reason on your system.

The only thing that jumps out at me is that you are using GraphicsMagick, and I have only tested transform with ImageMagick. But I am pretty sure that others have used GM successfully.

I assume that the system is generating resource previews normally, right?

Also, is there a chance that there could be a permissions problem on the filestore/tmp/transform_plugin directory that is preventing the system from writing the preview?

If none of these things help, here's a troubleshooting step to try. Open plugins/transform/include/transform_functions.php

and around line 21 change insert "echo $command;" so that it looks something like this.

        $command .= " \"$originalpath\" +matte -delete 1--1 -flatten -colorspace RGB -geometry 450 \"$tmpdir/transform_plugin/pre_$ref.jpg\"";
        echo $command;
        run_command($command);


Then attempt to do a transform. You will see the command being used to generate the preview at the top of the screen. You can try running this at the command line and see if you get an error. If so, it may point the way to a solution.

(If you get it working you'll want to put this file back the way it was so that it doesn't spit gibberish at users.)

I hope this helps a bit...

-David



--
You received this message because you are subscribed to the Google Groups "ResourceSpace" group.
To post to this group, send email to resour...@googlegroups.com.
To unsubscribe from this group, send email to resourcespac...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/resourcespace?hl=en.


Jonas Temple

unread,
Feb 28, 2012, 6:22:31 PM2/28/12
to ResourceSpace
David,

Thanks for the quick response. See my replies below:


On Feb 28, 4:57 pm, David Dwiggins <da...@dwiggins.net> wrote:
> Transform creates a preview version of the image to use during the cropping
> process. This is failing to happen for some reason on your system.
>
> The only thing that jumps out at me is that you are using GraphicsMagick,
> and I have only tested transform with ImageMagick. But I am pretty sure
> that others have used GM successfully.
>
> I assume that the system is generating resource previews normally, right?

Yes, previews are working fine. Photos, documents, videos, etc.

>
> Also, is there a chance that there could be a permissions problem on the
> filestore/tmp/transform_plugin directory that is preventing the system from
> writing the preview?
>

The transform_plugin directory permissions are: "drwxrwxrwx" so that
should be okay.

> If none of these things help, here's a troubleshooting step to try. Open
> plugins/transform/include/transform_functions.php
>
> and around line 21 change insert "echo $command;" so that it looks
> something like this.
>
>         $command .= " \"$originalpath\" +matte -delete 1--1 -flatten
> -colorspace RGB -geometry 450 \"$tmpdir/transform_plugin/pre_$ref.jpg\"";
>         echo $command;
>         run_command($command);
>
> Then attempt to do a transform. You will see the command being used to
> generate the preview at the top of the screen. You can try running this at
> the command line and see if you get an error. If so, it may point the way
> to a solution.
>

Here's the command echoed back to the browser:

/usr/bin/convert "/var/www/resourcespace/include/../filestore/
4/6_cc22c2ea754da41/46_0ebb13254598b4f.jpg" +matte -delete 1--1 -
flatten -colorspace RGB -geometry 450 "/var/www/resourcespace/
include/../filestore/tmp/transform_plugin/pre_46.jpg"

If I remove the "-delete" and "1--1" it will create the image. Don't
know why, I'm not familiar with the convert command. However, I cannot
crop the image once it's displayed in my browser (cursor turns into a
circle/slash when hovering over the image).

Jonas

David Dwiggins

unread,
Feb 28, 2012, 6:29:59 PM2/28/12
to resour...@googlegroups.com
What is the error if you run this command from the command line and don't remove those arguments?

The issue with not being able to draw crops may be a different one.  I have heard scattered reports of problems for users of certain versions of Internet Explorer. What browser are you using?

-DD




Jonas Temple

unread,
Feb 29, 2012, 9:26:44 AM2/29/12
to resour...@googlegroups.com
Here's the error if I run the command from the command line:

/usr/bin/convert convert: Unrecognized option (-delete).

And if I were to remove the "-delete" option I got:

/usr/bin/convert convert: Unable to open file (1--1) [No such file or directory].

So I then removed the "1--1" and it worked...iow created the image.

And you are correct. It looks like a browser issue with not being able to crop. I can select a region just fine in Firefox. Although when I click the "Replace slideshow image" button I get another error. :)

Jonas Temple

unread,
Feb 29, 2012, 9:29:19 AM2/29/12
to resour...@googlegroups.com
Oops...sorry. Forgot to mention this. I'm using IE 8. Firefox 10.

Jonas Temple

unread,
Feb 29, 2012, 10:02:31 AM2/29/12
to resour...@googlegroups.com
Okay, so I decided to try ImageMagick instead of GraphicsMagick.  Everything works perfectly in Firefox so at this point I'm assuming it's incompatible with GraphicsMagick.

But I still can't crop in IE8.  Here's the JavaScript error:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; MDDR; .NET4.0C; .NET4.0E)
Timestamp: Wed, 29 Feb 2012 15:01:59 UTC

Message: Object doesn't support this property or method
Line: 17
Char: 2282
Code: 0
URI: http://linux1/resourcespace/plugins/transform/lib/jsCropperUI/cropper.js


David Dwiggins

unread,
Feb 29, 2012, 5:22:12 PM2/29/12
to resour...@googlegroups.com
Hi, Jonas,

I will try to look at this when I have a moment. The problem with IE is that it seems to change from version to version and it's very difficult to maintain a test environment with all of the possible variations.

The incompatibility with GraphicsMagick might be fixable -- I think the error you found has something to do with flattening multilayer images so that you can get a comprehensive preview. There may be another approach to this problem (or we could simply remove these commands when using GM, which would break it for some images but allow it to work for most.)

-David

--
You received this message because you are subscribed to the Google Groups "ResourceSpace" group.
To view this discussion on the web visit https://groups.google.com/d/msg/resourcespace/-/aBhKVJpZZ-wJ.

Jeff Harmon

unread,
Feb 29, 2012, 5:53:48 PM2/29/12
to resour...@googlegroups.com, resour...@googlegroups.com
I think GM doesn't use repage, if that helps. 

J

--
Jeff Harmon
Chief Executive Officer
Colorhythm LLC

Main Office:  +1 415-399-9921
Mobile:  +1 510-710-9590

Jonas Temple

unread,
Mar 1, 2012, 9:08:54 AM3/1/12
to resour...@googlegroups.com


On Wednesday, February 29, 2012 4:22:12 PM UTC-6, David Dwiggins wrote:
Hi, Jonas,

I will try to look at this when I have a moment. The problem with IE is that it seems to change from version to version and it's very difficult to maintain a test environment with all of the possible variations.


David,

No rush on this. I just switched to ImageMagick and everything is working perfectly now.  Now it's off to learn the upload API!

Zoltán Tuba

unread,
Sep 12, 2017, 2:47:32 PM9/12/17
to ResourceSpace
Hi,


I am having a strange problem with the transform plugin. If I crop a resource, and save it as alternative file, everything is fine. However, if I set the crop size and area, and click the direct download button, the only thing that is downloaded is a file with the name resourcenumber_transform.jpg and a size of 1127 bytes. The size is always the same with any resource, and any file format I choose (jpg, png, etc.)

At the same time, the correct cropped image in the directory filestore/tmp/transform_plugin on the Resourcespace server is created, with the correct pixel size, normal file size, and the name download_resourcenumber.jpg

So it seems like the file is created all right, but the download is not working. What could be the problem?

Also, is it possible for a user group to have permission to create and save alternative versions of existing resources through the transform plugin, but without giving the group permission to upload new resources and delete resources?

Thank you,

Zoltán

Zoltán Tuba

unread,
Oct 12, 2017, 3:46:00 PM10/12/17
to ResourceSpace
Does anybody have a take on this by any chance?

Zoltán
Reply all
Reply to author
Forward
0 new messages