Help - Search - Members - Calendar
Full Version: imagemagick/perlmagick problem
Movable Type Community Forum > Additional Resources > Tips and Tricks
at0m
i'm bumping this, i know i probably shouldn't but i'm a rebel lmao  :D
girlie
When you specify the upload destination, what are you putting in the optional box?
at0m
i have a feeling the only way i am going to be able to fix this is to move my "/blog/" directory inside of my "/mt/" directory, cuz that's how this thing seems to want to work... it is coded with your site being inside of the MT directory in mind
at0m
yes... it is uploading the images into /blog/images/ where i'ts supposed to...

my EXACT entry for "Local Site Path" in blog configuration says this: /inetpub/wwwroot/site/blog/

my EXACT entry for "Site URL" is blog configuration says this: http://open-over.no-ip.org/blog/

the actual link to the image in the html that is genereated is correct, the only thing it messes up is the thumbnail URL
btrott
Weird. I really thought that was fixed; I'll try it again. I assume that the \inetpub\wwwroot\site\blog is your local site path?
jonmc12
I also get this error when the image upload does work.  It seems that CMS.pm has some trouble processing the reference directories.  Any suggestions?


CODE
MT::App::CMS=HASH(0x1cdb944) Unrecognized escape \X passed through before HERE mark in regex m/^C:\X << HERE itami\webpages\myweb2\movetype\archives\\?/?/ at C:\Xitami\webpages\myweb2\movetype\MT-2\lib/MT/App/CMS.pm line 1024.

MT::App::CMS=HASH(0x1cdb944) Unrecognized escape \m passed through before HERE mark in regex m/^C:\Xitami\webpages\m << HERE yweb2\movetype\archives\\?/?/ at C:\Xitami\webpages\myweb2\movetype\MT-2\lib/MT/App/CMS.pm line 1024.

MT::App::CMS=HASH(0x1cdb944) Unrecognized escape \m passed through before HERE mark in regex m/^C:\Xitami\webpages\myweb2\m << HERE ovetype\archives\\?/?/ at C:\Xitami\webpages\myweb2\movetype\MT-2\lib/MT/App/CMS.pm line 1024.
btrott
Okay, try this fix, which I thought was in 2.0. In lib/MT/App/CMS.pm, change line 1024 from this:

CODE
       $t_file =~ s!^$base_path\\?/?!!;


to this:

CODE
       $t_file =~ s!^\Q$base_path\E\\?/?!!;


Does that fix the problems?
at0m
awesome, it's fixed.... thanks alot ben! {^__^}
btrott
Strange. The purpose of the above code fix is to fix the issue you are talking about (I am surprised, to say the least, that it might fix the other problems.) Are you sure you changed the right line?
bakerkm45
QUOTE
Strange. The purpose of the above code fix is to fix the issue you are talking about (I am surprised, to say the least, that it might fix the other problems.) Are you sure you changed the right line?

I feel fairly certain that I am because my (hopeless) tinkering with the new code yields different results when I attempt the thumbnail upload bit.  Hence their is a relation between the line I change and the results.  Like I said, it got rid of other problems where simply nothing would upload.  If I could just figure out what part of the code deals with the local path and delete that, I think I would be fine because [URL=http://mysite.org/images/(thumbnailfile[/URL]
does the trick when I manually edit the HTML generated by the upload maneuver.
bakerkm45
QUOTE
Could you post the context of that line? In other words, 5 lines before, 5 lines after, plus the line you are editing.

Here are five lines before/after, plus the line:

$fmgr->put_data($blob, $t_file, 'upload')
           or return $app->error("Error writing to '$t_file': " .
                                 $fmgr->errstr);
       my $url = $q->param('site_path') ? $blog->site_url : $blog->archive_url;
       $url .= '/' unless $url =~ m!/$!;
       $t_file =~s!^\Q$base_path\E\\?/?!!;
       $thumb = $url . $t_file;
   }
   if ($q->param('popup')) {
       require MT::Template;
       if (my $tmpl = MT::Template->load({ blog_id => $blog_id,
at0m
i finally got the perlmagick stuff installed for imagemagick so i could auto-create my thumbnails... but i do have a little problem with it...

whenever i upload an image, then tell it to make a thumbnail and make it a pop up image... i look at the html for it and for the thumbnail it displays on my entry... it has this:
src="http://open-over.no-ip.org/blog/\inetpub\wwwroot\site\blog\images/stairfoliage02-thumb.JPG"

see the "\inetpub\wwwroot\site\blog\images" that doesn't belong in there at all....
it should look like this:
src="http://open-over.no-ip.org/blog/images/stairfoliage02-thumb.JPG"

any idea what the heck is going on here? thanks
at0m
ok i figured out what it's doing... i just don't know how to fix it....

for the URL to the thumbnail... it's using this format:
"[URL of blog][local site path(with new directory attached)][filename]"

so it comes out like this:
"http://open-over.no-ip.org/blog\inetpub\wwwroot\site\blog\images/filename-thumb.jpg"

is there any way to edit the task it's performing so i can correct it?
thanks!
at0m
i'm checking the radio button for "Local Site Path" and beside it i'm typing "images"
girlie
Eh, I don't think that's the way it's coded at all (at least not intentionally if this turns out to be a bug). There's no reason your blog should have to be inside of your MT directory to make this work.

Is your thumbnail uploading into the proper directory?? (i.e., open-over.no-ip.org/blog/images/)

What *exactly* is in your Local Site Path and Site URL in Blog Configuration?
girlie
Hmmm, then I guess this calls for Ben-Intervention!!
at0m
hehe... well... don't make *that* big of a fuss... i can always stop being lazy and just fix the code while it's sitting infront of me in that little entry box hehe
thanks though, for all the previous help and any other help you can get me ^_^
jonmc12
I am experiencing the same problem, sometimes I also get the error "Warning 310: no images to mogrify (Scale) "... very frustrating.  Would appreciate any assistance.

Jonathan
btrott
Very odd, I'll look into it; I thought this was fixed.
jonmc12
That worked! Thank for your help!
bakerkm45
QUOTE
Okay, try this fix, which I thought was in 2.0. In lib/MT/App/CMS.pm, change line 1024 from this:

CODE
       $t_file =~ s!^$base_path\\?/?!!;


to this:

CODE
       $t_file =~ s!^\Q$base_path\E\\?/?!!;


Does that fix the problems?

I was having the exact problem as others were with this issue.  The code fix took care of the main problem I had with the upload just not executing, or with the dread "unable to mogrify..." error.  But the HTML generated by the code fix still isn't working in that it adds something like:

"[URL of blog][local site path]\[filename]"

If I simply delete the local site path from the HTMl generated, then the thumbnail is linked properly.  But this is a little overly manual.  What is the proper part of code to delete to make it generate the HTMl entry to read:

"[URL of blog][filename]"
btrott
Could you post the context of that line? In other words, 5 lines before, 5 lines after, plus the line you are editing.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.