-
Notifications
You must be signed in to change notification settings - Fork 194
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
Implement on Laravel #95
Comments
install the library via Composer and call it as any other |
You're right. Though I have another weird issue. This is my code:
What's the problem? The Any help would be really appreciated. Thanks |
strange. try setting the phantomjs dir with $screenCapture->binPath = '/path/to/bin/dir/'; no idea why this error appears, maybe @MASNathan knows |
We might be getting somewhere. And now the error changed to |
Try this: Add the following to your
And then run $ composer require jakoch/phantomjs-installer microweber/screen |
Didn't work. It's something to do with the way it reads the path. Any idea why this is happening? |
@skittery I realise some years have passed since you posted this comment so you've probably moved on, but for the sake of posterity. It looks like you're specifying a relative path from your project root to the bin directory whereas I believe you need to specify an absolute path. In a Laravel context you can do this with the
|
Hi @AndrewFeeney I built the functionality in a controller using BTW - small question - Is there anyway I can take a screenshot, say of 1920 width and 1080 height, but when I clip it to be say 500 it will shrink it without cropping? Thanks! |
@skittery Yes, I noticed shortly after I posted my comment that the default path should work. That said, I've started using a different package by Spatie: https://github.com/spatie/browsershot as it relies on Puppeteer and headless Chrome instead of the now deprecated phantomjs. Regarding your question, it sounds like you are trying to resize the image after capture, preserving the aspect ratio. I can't see any methods on this package for that. You could use another library to resize the image after the fact. Spatie's package does offer this functionality by exposing their image library: https://github.com/spatie/browsershot#manipulating-the-image |
Wow, Spatie seems excellent.
Thanks a lot for that!
…On Tue, Sep 10, 2019 at 11:39 PM Andrew Feeney ***@***.***> wrote:
@skittery <https://github.com/skittery> Yes, I noticed shortly after I
posted my comment that the default path should work. That said, I've
started using a different package by Spatie:
https://github.com/spatie/browsershot as it relies on Puppeteer and
headless Chrome instead of the now deprecated phantomjs.
Regarding your question, it sounds like you are trying to resize the image
after capture, preserving the aspect ratio. I can't see any methods on this
package for that. You could use another library to resize the image after
the fact. Spatie's package does offer this functionality by exposing their
image library:
https://github.com/spatie/browsershot#manipulating-the-image
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#95>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADA4A3HN2WQZ42DP5YERCUDQJAAXTANCNFSM4EBSQVXA>
.
--
[image: photo]
*Avi Klein*
OK Digital
[email protected] | http://okdigital.me
<http://www.linkedin.com/in/kleinavi/>
|
I know this might sound funny but I'm trying to call the library on Laravel from within a controller and can't seem to get it right.
This is my setup:
app/Http/Controllers/indexController.php
is where I plan on using the screen capturing.app/Http/Lib/Screen/
is where I have the library.I tried a bunch of
use
options and nothing seemed to work.How should I call the library?
Thanks in advance!
The text was updated successfully, but these errors were encountered: