How to add pixels on 3Dcover -s option

A plethora of command-line scripts that perform geometric transforms, blurs, sharpens, edging, noise removal, and color manipulations.
Post Reply
inocan2002
Posts: 3
Joined: 2014-12-15T04:10:35-07:00
Authentication code: 6789

How to add pixels on 3Dcover -s option

Post by inocan2002 »

Image render when -s uses percent

Code: Select all

3Dcover -s "10%" a.jpg b.jpg
But when I used pixel as a value the image does not render

Code: Select all

3Dcover -s 10 a.jpg b.jpg

Also tried enclosing it in parenthesis.

Many thanks for the help and for Fred for developing the script :D
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to add pixels on 3Dcover -s option

Post by fmw42 »

It seems to work fine for me on IM 6.9.0.0 Q16 Mac OSX Snow Leopard. The following work fine.

3Dcover -s 20% wedding.jpg show:
3Dcover -s 50 wedding.jpg show:
3Dcover -s 100 wedding.jpg show:

The second and third show the proper increase in thickness of the cover.

What version of IM are you using and what platform? Have you downloaded the latest version of 3Dcover?

If you still have trouble, upload your image to dropbox.com and put the URL here so I can test your image.
inocan2002
Posts: 3
Joined: 2014-12-15T04:10:35-07:00
Authentication code: 6789

Re: How to add pixels on 3Dcover -s option

Post by inocan2002 »

Thank you for your fast reply.

I am using IM 6.9.0.0 on Ubuntu Server 12.04.5.

I am also using latest version of 3Dcover.

For the image, I used the sample wedding photo on your website
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to add pixels on 3Dcover -s option

Post by fmw42 »

Are you saying there is no output at all or it is the same as the input? Do you get a proper output when you use 20%?

This works fine for me:

Code: Select all

3Dcover -s 20 wedding.jpg result.jpg
Can you try the above again with my exact code? Then try

Code: Select all

3Dcover -s 20 wedding.jpg result.jpg 2>&1
or

Code: Select all

<?php
exec("3Dcover -s 20 wedding.jpg result.jpg 2>&1",$out,$returnval);
foreach($out as $text)
{echo "$text<br>";}
?>
Do you get any error messages? Are you running it in a terminal window or via PHP exec()?

If you are using PHP exec(), then post your exact command? Do you have the right number of quotes?
inocan2002
Posts: 3
Joined: 2014-12-15T04:10:35-07:00
Authentication code: 6789

Re: How to add pixels on 3Dcover -s option

Post by inocan2002 »

Are you saying there is no output at all or it is the same as the input?

There is no output

Do you get a proper output when you use 20%?

Yes I get a proper output

Do you get any error messages?

No

Are you running it in a terminal window or via PHP exec()?

I am running via terminal window

My commands are the same as you posted.

I tried debugging your script and commented out this part of your code from line 506 - 510

Code: Select all

# convert side from percent to pixels if needed
test=`echo "$side" | grep "%"`
if [ "$test" != "" ]; then
	side=`echo "$side" | sed 's/%//g'`
	side=`convert xc: -format "%[fx:round($side*$ww/100)]" info:`
fi
and now the option for pixels is working. I am now using this for a workaround since I am not using percentage.

Thank you again for the fast response and for your script :D
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to add pixels on 3Dcover -s option

Post by fmw42 »

You are not using the latest script. That part of the code was changed recently.

I see I forgot to upload that newer version. I have just done so.

Try downloading again and let me know if it runs. The latest version is dated 11/14/2014. The grep tests for % have been moved above the tmp directory creation. I found that if done below it, then things did not work correctly.


Are you planning to use this for a commercial web site? If so, please contact me for licensing.
Post Reply