New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vips_similarity syntax error? #1041
Comments
Hello, angle and scale are optional arguments, so you have to name them. For example: # no scale, only rotate
$overlay = $overlay->vips_similarity($overlay, ["angle" => 15]); |
Hi John,
I tried your line, and I'm still receiving this error. Am I missing the
vips_similarity class?
Wyatt
PHP Fatal error: Uncaught Jcupitt\Vips\Exception: VipsOperation: class
"vips_similarity" not found
in /var/www/html/build/vendor/jcupitt/vips/src/Image.php:664
Stack trace:
#0 /var/www/html/build/vendor/jcupitt/vips/src/Image.php(685):
Jcupitt\Vips\Image::errorVips()
#1 /var/www/html/build/vendor/jcupitt/vips/src/Image.php(1052):
Jcupitt\Vips\Image::errorIsArray(-1)
#2 /var/www/html/build/vendor/jcupitt/vips/src/Image.php(1130):
Jcupitt\Vips\Image::callBase('vips_similarity', Object(Jcupitt\Vips\Image),
Array)
#3 /var/www/html/build/testing.php(34):
Jcupitt\Vips\Image->__call('vips_similarity', Array)
#4 {main}
thrown in /var/www/html/build/vendor/jcupitt/vips/src/Image.php on line
664
…On Mon, Jul 23, 2018 at 1:17 AM, John Cupitt ***@***.***> wrote:
Hello, angle and scale are optional arguments, so you have to name them.
For example:
# no scale, only rotate$overlay = $overlay->vips_similarity($overlay, ["angle" => 15]);
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<https://github.com/jcupitt/libvips/issues/1041#issuecomment-406977455>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AQW5i2GD3KU4GI_2K-3qlV-bsUu7NaDcks5uJYaEgaJpZM4Vah-7>
.
|
Sorry, copy/paste error. Try: # no scale, only rotate
$overlay = $overlay->similarity(["angle" => 15]); |
Hi John, This worked great! I'm now able to finely tune the angular rotation of the design placed on each apparel piece so they look 100% natural and perfect. As for now, I just overlay graphics on flat apparel in 1 plane, but will your library allow me "transform" a graphic before I overlay it on an apparel piece so it looks natural when placed on a person/ model turning sideways? Placeit.net has built an entire mockup service around this functionality... Rock on John! I hope I can help you as much in the future, as you have helped me. Regards, Wyatt |
I like the mockup generator. Yes, libvips can do that, it has a warp function. You need to model the share you want to fit though, and that takes some maths and a bit of effort. |
Hi John,
I'm trying to rotate my design a few degrees before overlaying on my base t-shirt. I can't seem to get the syntax correct for vips_similarity. Are any of these 3 lines correct?
I keep getting this error:
PHP Fatal error: Uncaught Jcupitt\Vips\Exception: VipsOperation: class "vips_similarity" not found
in /var/www/html/build/vendor/jcupitt/vips/src/Image.php:664
Any help is much appreciated.
Regards,
Wyatt
The text was updated successfully, but these errors were encountered: