phantommagick icon indicating copy to clipboard operation
phantommagick copied to clipboard

Can not save image into directory

Open selimppc opened this issue 8 years ago • 9 comments

Hello @alanhr @patrickcurl @anam-hossain @alanhr @dwightwatson
This one is awesome. But I got something is missing in my application. Can I get some guide from you ?

My method :

    $bg_path = public_path()."/tickets/ticket_bg.jpg";
    $options = [
        'width' => 500,
        'height' => 300,
        'quality' => 90
    ];

        $conv = new  \Anam\PhantomMagick\Converter();

        $tnm= $ticket->ticket_number;
        $ticket->ticket_number= substr($ticket->ticket_number,0,-4).'****';
        $conv->addPage(TicketController::ticket_html($ticket))
            ->setImageOptions($options)
            ->toJpg()
            ->save(public_path().'/assets/tickets/P-'.$tnm.'.jpg');
    }

this one is not showing any error .. But doesn't store any file into my local folder . May I need to do anything more ?

Note : install packages and added into app.php file according to your instruction. I checked the libraries / dependencies are working.

When I print_r($conv) at last its showing this one : http://prntscr.com/cyupr8 (screenshot)

selimppc avatar Oct 25 '16 18:10 selimppc

@selimppc In which operating system your app running on?

Most of the cases, these errors are related to wrong PhantomJs library installed to the system.

anam-hossain avatar Oct 27 '16 00:10 anam-hossain

Dear Anam

I use Mac osx and Ubuntu 16.04.. Also tried to host gator shared Linux server.

Would you please guide me

On 27 Oct 2016 06:13, "Anam Hossain" [email protected] wrote:

@selimppc https://github.com/selimppc In which operating system your app running on?

Most of the cases, these errors are related to wrong PhantomJs library installed to the system.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/anam-hossain/phantommagick/issues/22#issuecomment-256512714, or mute the thread https://github.com/notifications/unsubscribe-auth/AHZ3pKEM1pVsf8kAeTEc6OXPC0K5ASADks5q3-yBgaJpZM4KgV-b .

selimppc avatar Oct 27 '16 15:10 selimppc

Were you able to solve the issue i am facing the same issue on Windows 7 (64 bit) with phantom js 2.2.1 installed?

wmdev1 avatar Dec 30 '16 13:12 wmdev1

i am facing same issue Below is log error

PHP Parse error: syntax error, unexpected '/' in bin/phantomjs on line 7683 Conversion failed.

umerzafar2003 avatar May 02 '18 09:05 umerzafar2003

Dear Mr. Anam,

Would you please share your latest repo so that I can check and resolve?

On Wed, May 2, 2018 at 3:26 PM, umerzafar2003 [email protected] wrote:

i am facing same issue Below is log error

PHP Parse error: syntax error, unexpected '/' in bin/phantomjs on line 7683 Conversion failed.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/anam-hossain/phantommagick/issues/22#issuecomment-385918046, or mute the thread https://github.com/notifications/unsubscribe-auth/AHZ3pCkmPzLZzrRZGwKxzZw-IqAQbfQsks5tuXvAgaJpZM4KgV-b .

selimppc avatar May 02 '18 09:05 selimppc

@selimppc I have same problem, Did you fixed it?

phucqd avatar Mar 11 '19 15:03 phucqd

I'm currently having the same issue on mac osx

$conv = new \Anam\PhantomMagick\Converter();
$conv->source($dataPage)
    ->setBinary('/usr/local/bin/phantomjs')
    ->toPng()
    ->save('./datas/test.png');

gpproton avatar Mar 23 '19 22:03 gpproton

I am also face the same issue. It's working in the local system, But not working in server Anybody fixed the issue?

SelvaSweet avatar May 17 '19 08:05 SelvaSweet

I solved this by installing all phantomjs dependencies.

https://www.vultr.com/docs/how-to-install-phantomjs-on-ubuntu-16-04

Works fine!

cleitokarloh avatar Jun 18 '19 13:06 cleitokarloh