You are here: Re: Grayscaling images causes mangled image + segfault « PHP Programming Language « IT news, forums, messages
Re: Grayscaling images causes mangled image + segfault

Posted by Steve on 04/16/07 19:21

| Also, in your constructor you're saving things in $this->$val, which is
| incorrect in two counts. It should be $this->val, and you never defined
| $val in your class. No idea what the code would do in this case.

as i pointed out, it seems an attempt to dynamically create the class
interface names. nothing else makes sense.

| And I'm not sure just what you're trying to accomplish in the foreach()
| loop in your constructor. If you're trying to use this to create
| variables in your class, that's the hard way to go about it, and the
| values you're defining are temporary and will disappear at the end of
| the function. Rather, you should just define them as members of the
| class (probably private).

hmmm...sounds familiar. :)

| Also, I'm not sure what's in $section, but I think you're trying to get
| the width and height of the image.

so we agree that global $section is magic. i suppose you didn't read my
initial response.

| As for your makeGray() function -
|
| You should first define $colorNDX as an array, i.e.
|
| $colorNDX = array();

that only matters if he's displaying notices. otherwise he is dynamically
filling $colorNDX as an array type with allocated colors - he just doesn't
check to see if the color has *already* been allocated and does this in a
loop. but then again, i already pointed out these two flaws.

| Your if statement following the for loop is unnecessary - you already
| know it's an array of 256 elements because you just created it. And the
| following nested for statements are referencing variables which don't
| exist any more.

another reason why i said the author was 'brain-dead' thinking that this
version of code has better performance potential than the built-in php
function he was aiming to supplant!

| These are just off the top of my head, and may not be correct. But I
| did find our class to be pretty hard to understand.

so jerry, you found that my initial response to phil did not add anything to
the post. i find that interesting since you restated exactly 3 things there
i've already covered. and, off-the-top-of-MY-head i stated even more
potential problems with the op's eye-sore coding.

if it's the language i used that was offensive to you, then damn the
language...else, why nullify your opinion by restating what i've already
said!

as it is jerry, i did not know the op was in fact the author of this class.
perhaps i would have been more gentil and guarded with my flurry of insults
had i known before hand. i just find it hard for you to agree that i've not
added anything to resolving the problem at hand when you are mirroring my
findings...simply because you don't like the tone of my delivery.

oh well.

later.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация