imagesx () expects parameter 1 to be resource, null given OR 500 internal server error

828 views
Skip to first unread message

Alessandro Arici

unread,
Dec 7, 2013, 11:01:46 AM12/7/13
to f3-fra...@googlegroups.com
Trying to work with Image class.

I've my UI set in this mode:

$f3->set('UI','app/views/');

and images in /images/template/

So, I know that I need to force 3rd parameter.

By the way, I create this

1) In index.php

$f3->route('GET /admin/immagini.png','AdminController->immagini');

In AdminController

public function immagini()
{
        $img = new \Image('logo_foot.png',FALSE,'/images/template/');
        $img->resize(120,90);
        //$img->render();
        $img->dump();
    }

But I've tried also:

  1. $img = new \Image('logo_foot.png',FALSE,'/var/www/vhosts/mydomina/httpdocs/images/template/');
  2. moving "logo_foot.png" inside app/views and doing $img = new \Image('logo_foot.png');
  3. change UI in $f3->set('UI','app/views/;images/template/');
  4. change  $f3->route('GET /admin/immagini.png','AdminController->immagini'); in   $f3->route('GET /admin/immagini','AdminController->immagini');

Why I cannot solve my issue? :( Unfortunately in Apache LOG every time I load "/admin/immagini.png" I have so many errors that it is impossible to understand something.


Thank you

Alessandro Arici

unread,
Dec 8, 2013, 3:52:18 AM12/8/13
to f3-fra...@googlegroups.com
I moved image in "app/views/" and now I have this error:

[Sun Dec 08 09:48:25 2013] [warn] [client 121] mod_fcgid: stderr: Invalid argument supplied for foreach()
[Sun Dec 08 09:48:25 2013] [warn] [client 151.1] mod_fcgid: stderr: - /var/www/vhosts/xxxxxxx/httpdocs/lib/image.php:514 Base->{closure}(2,'Invalid argument supplied for foreach()','

public function immagini()
    {
        $img = new \Image('logo_head.png');
        $img->resize(120,90);
        $img->render('png');
    }

Thank you...

Alessandro Arici

unread,
Dec 8, 2013, 3:59:35 AM12/8/13
to f3-fra...@googlegroups.com
Solved with last release ^_^


Il giorno sabato 7 dicembre 2013 17:01:46 UTC+1, Alessandro Arici ha scritto:
Reply all
Reply to author
Forward
0 new messages