It was not possible to determine the dimensions of the image

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Ideas Centre
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
latazyo
Registered User
Posts: 57
Joined: Fri Dec 10, 2004 9:30 pm
Location: St Louis, MO
Contact:

Re: It was not possible to determine the dimensions of the image

Post by latazyo »

if you have the option of changing your php.ini file, that works (as it just happened to me) and I modified the value for allow_url_fopen from off to on and it worked instantly and took me .01 seconds to complete
kernos
Registered User
Posts: 139
Joined: Fri Apr 04, 2003 8:28 pm
Location: Ozarks

Re: It was not possible to determine the dimensions of the image

Post by kernos »

When I add this hack, I get the following, when posting or replying:

Code: Select all

Parse error: syntax error, unexpected T_STRING in /home/.jacinth/bill501/druidry.org/board/dhp/includes/message_parser.php on line 302
Lines 300-303 are:

Code: Select all

300{
301			 if (function_exists('curl_exec'))
302            {
303              $c_img = curl_init();
I too am on Dreamhost.

Bill
mantykore
Registered User
Posts: 1
Joined: Fri Sep 14, 2007 1:03 am

Re: It was not possible to determine the dimensions of the image

Post by mantykore »

Hello,

In my forum, the [img] only doesn't work on signs.

I can post an imagen at the message's body but not in the signs. Some users can, but the great majority is using the [Flash=] code to post images in the signs.

On my server, in the php.ini, allow_url_fopen is ON. I use phpBB3_RC5.

Anyone knows why this is happen?

Regards,
mantykore.
medigeek
Registered User
Posts: 25
Joined: Fri Sep 14, 2007 1:00 pm

Re: It was not possible to determine the dimensions of the image

Post by medigeek »

I use dreamhost as well, the code posted before is a great workaround, but the image x and y were placed reverted, hence it will say "Your images may only be up to 150 pixels high." if you have a 200 (width) x 50 (height).

With my limited programming knowledge, I just reverted the imagesx and imagesy:
After the lines (AFTER, NOT BEFORE):

Code: Select all

			if ($stats === false)
			{
You will add:

Code: Select all

                if (function_exists('curl_exec'))
                {
                   $c_img = curl_init();
                   $c_timeout = 8; //The timeout, in seconds. You may want to change this
                   $c_max_filesize = 64000; //The max file size loaded into memory
                   curl_setopt($c_img, CURLOPT_URL, $in);
                   curl_setopt($c_img, CURLOPT_RETURNTRANSFER, 1);
                   @curl_setopt($c_img, CURLOPT_BUFFERSIZE, $c_max_filesize);
                   curl_setopt($c_img, CURLOPT_CONNECTTIMEOUT, $c_timeout);
                   curl_setopt($c_img, CURLOPT_FOLLOWLOCATION,1);
                   $grabbed_img = @curl_exec($c_img);
                   curl_close($c_img);
                   $stats[0] = $stats[1] = false;
                   if ($grabbed_img)
                   {
                      $grabbed_img = @imagecreatefromstring($grabbed_img);
                      $stats[1] = @imagesy($grabbed_img);
                      $stats[0]= @imagesx($grabbed_img);
                      unset($grabbed_img, $c_img);
                   }
                   if (!$stats[0] || !$stats[1])
                   {
                      $stats = false;
                   }
                }
             }
             if ($stats === false)
             {         
clight77
Registered User
Posts: 907
Joined: Sun May 11, 2003 11:09 pm

Re: It was not possible to determine the dimensions of the image

Post by clight77 »

You should be able to do this in .htaccess also if you do not have access to php.ini, by adding this line.

php_value allow_url_fopen On
I Follow Up On My Posts.
So Should Everybody...
banzaimonkey
Registered User
Posts: 11
Joined: Mon Nov 12, 2007 8:54 am
Contact:

Re: It was not possible to determine the dimensions of the image

Post by banzaimonkey »

medigeek wrote:I use dreamhost as well, the code posted before is a great workaround, but the image x and y were placed reverted, hence it will say "Your images may only be up to 150 pixels high." if you have a 200 (width) x 50 (height).

With my limited programming knowledge, I just reverted the imagesx and imagesy:
After the lines (AFTER, NOT BEFORE):
Thanks for the correction. I tested the hack and was wondering why it wasn't working. I didn't think to check that the dimensions had been reversed.

Cheers. :)
luchope
Registered User
Posts: 14
Joined: Fri Oct 21, 2005 5:50 pm

Re: It was not possible to determine the dimensions of the image

Post by luchope »

Hi, my hosting also disabled the PHP setting: "allow_url_fopen". It is explained as follows:
http://phpsec.org/projects/phpsecinfo/t ... fopen.html .

Today I added the code you guys put in this forum, but only got an error:
Parse error: syntax error, unexpected '/' in /forum/phpBB3/includes/message_parser.php on line 445
Ive cleared style cache, template cache and general cache, but doesnt work ... :( Have PHPBB3 Gold

please help!

Byep!
luchope
Registered User
Posts: 14
Joined: Fri Oct 21, 2005 5:50 pm

Re: It was not possible to determine the dimensions of the image

Post by luchope »

Has somebody tried something else? :cry:
pinkshades05
Registered User
Posts: 36
Joined: Tue Mar 27, 2007 12:41 am

Re: It was not possible to determine the dimensions of the image

Post by pinkshades05 »

I tried the MOD and it didn't work for me, either. I also got a Parse error. Any other ideas??
luchope
Registered User
Posts: 14
Joined: Fri Oct 21, 2005 5:50 pm

Re: It was not possible to determine the dimensions of the image

Post by luchope »

Ive installed another new installation of Gold Edition. It works fine with the basic DB whicih installas, but while changing DB in config.php it doesnt let post images again.


Has somebody know how to setup the DB for fixing this issue?
Which value from config table?

Byep!
RKumono
Registered User
Posts: 1
Joined: Wed Dec 26, 2007 12:46 am

Re: It was not possible to determine the dimensions of the image

Post by RKumono »

Dreamhost Users:

You CAN edit your PHP.INI file. I had to dig around for this myself, as we were getting the 'not possible' error on signature and avatar images. Too many places to try and custom recode quickly, so I looked for solutions.

The message workaround is great, but as I said--signature and avatar linked images.

I managed to find instructions on Dreamhost's on wiki to create your domain's own php.ini file, so you can edit it and turn on allow_url_fopen.

Here is how:
  1. Acquire a shell access program (I used PuTTY: http://www.chiark.greenend.org.uk/~sgtatham/putty/ )
  2. Make sure your username and password on your Dreamhost account has Shell access through their web panel.
  3. Start PuTTY (or whatever you use) and enter your domain name (http://www.mysite.com) and connect
  4. Login with your account username/password
  5. Now for the commands you need
    • For PHP5:

      Code: Select all

      mkdir mysite.com/cgi-bin
      cp /dh/cgi-system/php5.cgi mysite.com/cgi-bin/php.cgi
      cp /etc/php5/cgi/php.ini mysite.com/cgi-bin/php.ini
      exit
    • For PHP4:

      Code: Select all

      mkdir mysite.com/cgi-bin
      cp /dh/cgi-system/php.cgi mysite.com/cgi-bin/php.cgi
      cp /etc/php5/cgi/php.ini mysite.com/cgi-bin/php.ini
      exit
  6. Through FTP access, download mysite.com/cgi-bin/php.ini
  7. Edit your php.ini to change allow_url_fopen = On
  8. Upload and Overwrite the mysite.com/cgi-bin/php.ini with your modified file
  9. Create or Edit your mysite.com/.htaccess file using/adding the following lines:
    • mysite.com/.htaccess

      Code: Select all

      AddHandler php-cgi .php
      Action php-cgi /cgi-bin/php.cgi
  10. Assign file permissions as follows via FTP
    • mysite.com/.htaccess to 644
    • mysite.com/cgi-bin to 755
    • mysite.com/cgi-bin/php.cgi to 750
    • mysite.com/cgi-bin/php.ini to 644
  11. Delete all files via FTP from your phpBB3's /cache folder
And you are done. Now everything works fine. No modifications needed to any of the phpBB code this way.

If your phpBB installation is in your domain's root, you have to edit the phpBB3 .htaccess file for the lines needed in the instructions above, adding them to the beginning of the file.

If your phpBB installation is NOT in your domain's root, you create an .htaccess file for your domain's root folder (or edit what is there) to have those lines at the top. You only change the .htaccess file in the root of your domain.

And everything works. And it was good.

Remember, this is for Dreamhost. Other Host Providers may be different.
Down2thec
Registered User
Posts: 30
Joined: Thu Mar 30, 2006 12:50 pm

Re: It was not possible to determine the dimensions of the image

Post by Down2thec »

PowWeb claims my allow_url_fopen is on with the default php.ini for PHP4, but the sizing didn't work. I used the code hack listed above with some success. It does the trick but if you point it to a huge image that busts that 64000 limit, it gives the blank page crash for me. Might freak out the board users so I'll bump it up some for starters.

Not sure if there's any exception trapping for php that I might use to wrap that part up... I'll have to do some googling.
heosemys
Registered User
Posts: 13
Joined: Wed Nov 21, 2007 4:14 pm
Contact:

Re: It was not possible to determine the dimensions of the image

Post by heosemys »

My site is hosted by siteground. I've tried many things, but in the end the solution was very simple:
- In the cPanel select 'Hotlink protection'.
- enable 'Allow direct requests'. ;)
>>>Ana
Registered User
Posts: 5
Joined: Thu Aug 09, 2007 9:51 am

Re: It was not possible to determine the dimensions of the image

Post by >>>Ana »

oki guys i have possible other solution for this freeko think.

i had exactly same error, 2 funny facts:

1.) it worked before.
2.) there was no code changes and no system changes.

hmm. haxors? black cats? voodo sure.

oki heres reason. the webserver is in lan behind firewall. so the php went to www myadress com and got internet ip. so data goes to the router and back. since there were some changes in that router this "hookback" didnt run anylonger. and anyways its "dirty" thing
fix? find the HOSTS file, enter domains there with local ip or localhost manually. ping ur domains to be sure it works. dont forget to give every domain normal and www name if u dont mod_rewrite :)

as i said, this solution is only interesting if ure behind router or have mad firewalling.

another fun could be to assign the internet ip a second time on some lan interface of webserver (ip alias). dunno if that will lead into some problems. anyways, with this solution we wouldnt have to make entry in hosts file for every new vhost in apache.
Image
hoffy
Registered User
Posts: 38
Joined: Wed Jan 30, 2008 1:05 pm

Re: It was not possible to determine the dimensions of the image

Post by hoffy »

RKumono wrote:Dreamhost Users:

You CAN edit your PHP.INI file. I had to dig around for this myself, as we were getting the 'not possible' error on signature and avatar images. Too many places to try and custom recode quickly, so I looked for solutions.

Thank you very much!!!! I am Very happy indeed with this & it worked a treat!

Cheers
Locked

Return to “[3.0.x] Support Forum”