selective-php / image-type

Image type (format) detection for PHP
MIT License
7 stars 4 forks source link

Enhance parseType method #3

Closed peter279k closed 5 years ago

peter279k commented 5 years ago

As title, I found that the ImageTypeDetector::parseType method is very complicated for detecting different image formats.

The image formats have different approach about reading byte lengths.

To enhance parseType method, my following suggestions are as follows:

What do you think about this, @odan?

odan commented 5 years ago

I just optimized the parseType() method. The code quality increased from D to A :-)

peter279k commented 5 years ago

@oda, thanks.

I've looked at the latest commit, and it's better than previous approach :).