Cannot Initialize new GD image stream (101)

3.3 Forum ONLY: If you've run into a problem, such as an error message, blank page, or similar problem, this is where to look. Post any installation or other problems or questions here, and I and other users will try to help.
  
5 Aug '11 Fri Aug 05, 2011 08:06    
layingback
Site Admin  
  •  

Post Re: Cannot Initialize new GD image stream (101)

Yes and no. Using my test system (9.2.1 + my fixes, PHP5.3.0 and MySQL 5.1.37, 128MB memory_limit) the failure point is somewhere between 2700 and 2900 pixels.

And BTW I get nothing displayed if it fails, nor are there any files in upload. Suspect that is a 9.1.2.1 artifact that you are seeing.

Good sleuthing, but an awfully big image to upload - took measurable time on my dev system which has server and client on 1 machine so no actual upload transfer at all!

But I think I can explain it. I used same image scaled differently. At 2700h it was 1.6MB, at 2900h is was 2.2. Attempting to upload the larger one in coppermine gives a page load of warnings followed by an error message:

Code:
CMS Error /home/mark/public_html_bs/modules/coppermine/db_input.php line 276:
The picture you have attempted to upload is larger than 2M which is allowed by php



So I'm presuming that we are seeing the same thing here. Best I can think of doing is looking at the code cited in coppermine and see if I can replicate in some other way - I do not want to error out like coppermine does so that user doesn't lose the entire article that they are posting.

But going from these 2 links wiki link dragonflycms.org/Forum...2mb+image/ I suspect that changing upload_max_filesize in php.ini would address this. But I'm a bit pushed for time right now to test out my theory ...



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
  
5 Aug '11 Fri Aug 05, 2011 08:26    
macavity
Sponsor  Sponsor
  •  

Post Re: Cannot Initialize new GD image stream (101)

Thanks layingback.

I know it's a sensible assumption but I'm not sure about the filesize issue, my testing shows that it bombs out with an image (consisting of just a white background) over that height which is less than 30KB.



macavity's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

FreeBSD/Apache 10333100/MySQL 5.0.51/PHP 4.4.8/Dragonfly 9.1.2.1

 
 
 
 
  
5 Aug '11 Fri Aug 05, 2011 08:49    
layingback
Site Admin  
  •  

Post Re: Cannot Initialize new GD image stream (101)

Perhaps you are looking at a 9.1.2.1 limitation?

I just created 3 black images 2700h, 2900h and 5800h (11, 12.6 & 62KB respectively) and all loaded just fine - and resized down to 800h per Pro_News Config settings.

(Why don't you upgrade? 9.2.3 might have limited exposure, but 9.2.1 is solid as a rock. 9.2.3 is mostly just a roll up of fixes anyway. And the upgrade isn't hard.)



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
  
5 Aug '11 Fri Aug 05, 2011 09:00    
macavity
Sponsor  Sponsor
  •  

Post Re: Cannot Initialize new GD image stream (101)

Yeah, it's a good suggestion and it's solely a question of time. I've got so many little tweaks and edits here and there that upgrading (and testing) would just take longer than I have available right now. There may also be issues with theme compatibility.

BTW could you mail me with that large black image or attach it here so I can test with the same file (just out of interest)?



macavity's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

FreeBSD/Apache 10333100/MySQL 5.0.51/PHP 4.4.8/Dragonfly 9.1.2.1

 
 
 
 
  
5 Aug '11 Fri Aug 05, 2011 09:11    
layingback
Site Admin  
  •  

Post Re: Cannot Initialize new GD image stream (101)

Theme compatibility??? - reDesign3! (You can make it do almost anything, and it transforms DF.)

All 3 test images attached.



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
  
5 Aug '11 Fri Aug 05, 2011 10:29    
macavity
Sponsor  Sponsor
  •  

Post Re: Cannot Initialize new GD image stream (101)

Interesting, I can upload your 2 smaller files (both of which have heights larger than the limits I came across yesterday) but the largest one fails as before.

I'm not aware of reDesign3 - are there any good example sites I can look at? (Is this site running it?)



macavity's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

FreeBSD/Apache 10333100/MySQL 5.0.51/PHP 4.4.8/Dragonfly 9.1.2.1

 
 
 
 
  
5 Aug '11 Fri Aug 05, 2011 10:40    
layingback
Site Admin  
  •  

Post Re: Cannot Initialize new GD image stream (101)

- layingback

But going from these 2 links wiki link dragonflycms.org/Forum...2mb+image/ I suspect that changing upload_max_filesize in php.ini would address this. But I'm a bit pushed for time right now to test out my theory ...


Had chance to try and I can confirm. Raising upload_max_filesize from 2MB to 20MB I was able to upload the 2.2MB 2900px high image in Pro_News.

So went ahead and tried other large images: 4.7MB 4368px high was fine and fairly quick, but 11.4MB 3104px high failed, but also takes too long to process (minutes). So I wouldn't recommend raising upload_max_filesize too high, maybe 4MB or perhaps 6-8MB? All depends on how tolerant your host is, I guess.



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
  
5 Aug '11 Fri Aug 05, 2011 11:02    
layingback
Site Admin  
  •  

Post Re: Cannot Initialize new GD image stream (101)

- macavity

Interesting, I can upload your 2 smaller files (both of which have heights larger than the limits I came across yesterday) but the largest one fails as before.

I'm not aware of reDesign3 - are there any good example sites I can look at? (Is this site running it?)


This site uses reDesign as in the first version, reDesign3 is short for reDesign version 3. Results are similar, but it is more complete (eg. coppermine) and is much easier to follow, change and most importantly maintain, than either v1 or v2.

Essentially what it does is to provide CSS for _everything_ in DF. But note only standard DF modules. After that you are on your own. But that handles most of the stuff. And Pro_News is all CSS. Means you can use CSS to change most things. Result is that it brings DF up-to-date.

All the sites listed here are reDesign3 except the last one (reDesign pre-release IIRC). rosbif also has a newer site that exploits it, he essentially built his own theme, which is so easy to do - relative to pre-reDesign. I think accadra.com is a great example not because of the look-and-feel per se but because I was able to create it with pixel-for-pixel accuracy from a complete design spec - with images - from a UK Brand Design company. I did not need to force any compromises on the design, reDesign3 allowed me to implement everything exactly as required. Blew the designer away to see his design implemented spot on. Even the fancy top menu, and the left-hand sub-menu.

I wouldn't build a website of almost any type without DF 9.2.1, reDesign3 and - of course - Pro_News. Certainly not if I wanted to maintain it over the long haul. Add Treasury, CPGNuCalendar and Storez if required, and it's kinda hard to see what is missing. ( OK, Classifieds, but I think I can do that in a Pro_News template Wink )

EDIT: Oh, and of course greenday2K's greenday2k.net site that he posted on our DF discussion.



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
  
5 Aug '11 Fri Aug 05, 2011 11:57    
macavity
Sponsor  Sponsor
  •  

Post Re: Cannot Initialize new GD image stream (101)

[quote="layingback"]

- layingback

So I wouldn't recommend raising upload_max_filesize too high, maybe 4MB or perhaps 6-8MB? All depends on how tolerant your host is, I guess.


Thanks, I tried doing the same but couldn't seem to get the same results (i.e. raising upload_max_filesize didn't fix the issue). Not to worry at the moment, though.

Thanks also for the info on reDesign3.



macavity's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

FreeBSD/Apache 10333100/MySQL 5.0.51/PHP 4.4.8/Dragonfly 9.1.2.1

 
 
 
 
  
3 Mar '12 Sat Mar 03, 2012 20:47    
minor
Sponsor  Sponsor
  •  

Post Re: Cannot Initialize new GD image stream (101)

I believe, I have learned all related topics at cmsdragonfly forum, came here but my issue is slightly different.
My newly installed web was working since beginning properly but after seventh article the above message in title appeared and I cannot upload any new articles.

All my directories are at CHMOD 777, I have cleared cache directory several times, have 96MB in gd2.inc..., tried another set of pictures (using only JPEG), no progress. The original JPG file is uploaded, thumbnail is not created.
Reportedly the web provider did not changed any setings in the meantime.
This is the General setings list from my web:

Code:
CMS Version	9.3.3.0
PHP Version	5.3.10
MySQL Version	5.5.16 (client: mysqlnd 5.0.8-dev - 20102224 - $Revision: 321634 $)
GD Version	bundled (2.0.34 compatible)
CMS path	/hosting/www/minory.cz/www/
Core path	/hosting/www/minory.cz/www/includes/
Session save_path	/hosting/session/minory.cz
Process Owner	nobody (0) 
File Owner	N/A (18994)
Group	1001
System 	Linux nibbler.onebit.cz 2.6.18-274.7.1.el5 #1 SMP Thu Oct 20 16:21:01 EDT 2011 x86_64 


Has anybody any advice? Thank you.



minor's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

Apache/ MySQL Version 5.5.16/PHP Version 5.3.10/CMS Version9.3.3.0

 
 
 
 
  
3 Mar '12 Sat Mar 03, 2012 23:19    
layingback
Site Admin  
  •  

Post Re: Cannot Initialize new GD image stream (101)

Can you still upload the same images as previously? If so then nothing has changed on the system/server and it must be the image.

Can you attach the image so I can try here please?

Can you enable debug, and post any errors that you see - esp ones like this: CMS Error /home/mark/public_html_bs/modules/coppermine/db_input.php line 276:
The picture you have attempted to upload is larger than 2M which is allowed by php



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
  
4 Mar '12 Sun Mar 04, 2012 09:18    
minor
Sponsor  Sponsor
  •  

Post Re: Cannot Initialize new GD image stream (101)

Thank you for your assistance:
- I cannot upload any picture, neither new nor already uploaded.
- It is strange, that although I enabled debug, there is no report at the bottom at he page reporting Cannot Initialize new GD image stream (101).
- I am not using such big files to be uploaded. All my files used are up to about 300 kB
You can see files attached.

I believe, the only change in Pro-news since the last successful upload was a new article category input.
BTW: Coppermine is still working and creating thumbnails.
Just to add all:
I'v suspected new Irfanview installtion too, because I set it for creation a size limited pictures and this first picture was generated with this seting.
That is why I tried to clear cache directory. Simply re-named it and created new ... my idea, possibly wrong. And I tried to clean all cokies...



minor's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

Apache/ MySQL Version 5.5.16/PHP Version 5.3.10/CMS Version9.3.3.0

 
 
 
 
  
4 Mar '12 Sun Mar 04, 2012 13:37    
layingback
Site Admin  
  •  

Post Re: Cannot Initialize new GD image stream (101)

Well those pictures upload OK on my test site. And as you cannot now upload images that you could upload last week, something may have changed on your server.

If you look at line 961 (or there abouts) in modules/Pro_News/admin/admin_functions.php:

PHP:
					$reimage = imagecreatetruecolor($sizemax[0], $sizemax[1]) or die('Cannot Initialize new GD image stream (101)');		// die by xfunsoles Mar 07


either imagecreatetruecolor works or you get the gd/101 error.

(Note coppermine does not use imagecreatetruecolor so it will not exhibit this error.)

You can confirm that this is the cause by uploading a very small image (< 50 x 50) and it will skip the imagecreatetruecolor step. (An image bigger than icon will fail with gd/103, and bigger than thumb will fail gd/102).

In Admin > System > System Info > PHP Modules search for gd and see if version2 is available. See here php.net/manual/en/func...ecolor.php for info about PHP4 v PHP5.



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
  
4 Mar '12 Sun Mar 04, 2012 16:02    
minor
Sponsor  Sponsor
  •  

Post Re: Cannot Initialize new GD image stream (101)

- When uploadïng an icon sized picture, no change exept #(201)

Code:
gd
GD Support     enabled
GD Version     bundled (2.0.34 compatible)
FreeType Support     enabled
FreeType Linkage     with freetype
FreeType Version     2.2.1
GIF Read Support     enabled
GIF Create Support     enabled
JPEG Support     enabled
libJPEG Version     6b
PNG Support     enabled
libPNG Version     1.2.10
WBMP Support     enabled
XBM Support     enabled 


- I sent an additional questions to net provider because there is a short period between my last uploaded article and failed, to consider last changes on server side.
I will keep you informed about the response.

I highly appreciate your help.



minor's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

Apache/ MySQL Version 5.5.16/PHP Version 5.3.10/CMS Version9.3.3.0

 
 
 
 
  
4 Mar '12 Sun Mar 04, 2012 16:16    
layingback
Site Admin  
  •  

Post Re: Cannot Initialize new GD image stream (101)

Your GD is same as mine except FreeType version is newer (mine is 2.1.7) so no issue there.

201 error is same error as 101 but from user (vs admin) side Submit Article.

If you are getting 101 (or 201) errors then image is > than your Thumbnail size! Try uploading a 16x16 icon?

What settings do you have in Admin> Pro_News > Config under:
Max Thumbnail Width: (Default is 200)
Max Thumbnail Height: (Default is 200)
Max Image Dimension: (Default is 800)

[Icon size is 1/4 thumbnail, ie. 50x50 with default settings.]



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
Link  QR 
Share this Printer Friendly Page  facebook   google+   linkedin   twitthis  
Show more ...

Go to page  Previous  1, 2, 3  Next