Coder Social home page Coder Social logo

mm's People

Contributors

mariuswilms avatar whoem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mm's Issues

Mime_Type::guessName() not working with if $file comes with a path?

Instead of returning "document" Mime_Type::guessName("path/pdf.pdf") returns "generic". This will not happen in all other cases tested:

  • filename only
  • correct mime-type instead of file
  • open file handle

Example code:

use mm\Mime\Type;
require_once 'libs/vendor/davidpersson/mm/bootstrap.php';

$file = "files/pdf.pdf";

// one bad case
echo Mime_Type::guessName($file); // returns "generic"

// four good cases
$filename_only = "pdf.pdf";
echo Mime_Type::guessName($filename_only); // returns "document"

$mimeType = "application/pdf";
echo Mime_Type::guessName($mimeType); // returns "document"

$mimeType = Mime_Type::guessType($file);
echo Mime_Type::guessName($mimeType); // returns "document"

$handle = fopen($file, 'r');
echo Mime_Type::guessName($handle); // returns "document"

Error when uploading a transparent image

When uploading a GIF image I got this error:

Warning (2): imagecolorsforindex() [function.imagecolorsforindex]: Color index 235 out of range [APP/plugins/media/libs/mm/src/Media/Process/Adapter/Gd.php, line 295]

The warning is:
Debugger::handleError() - CORE/cake/libs/debugger.php, line 306
imagecolorsforindex - [internal], line ??
Media_Process_Adapter_Gd::adjustTransparency() - APP/plugins/media/libs/mm/src/Media/Process/Adapter/Gd.php, line 295
Media_Process_Adapter_Gd::resize() - APP/plugins/media/libs/mm/src/Media/Process/Adapter/Gd.php, line 212
Media_Process_Image::fitInside() - APP/plugins/media/libs/mm/src/Media/Process/Image.php, line 52
Media_Process_Image::fit() - APP/plugins/media/libs/mm/src/Media/Process/Image.php, line 32
GeneratorBehavior::makeVersion() - APP/plugins/media/models/behaviors/generator.php, line 266
ModelBehavior::dispatchMethod() - CORE/cake/libs/model/model_behavior.php, line 171
BehaviorCollection::dispatchMethod() - CORE/cake/libs/model/model_behavior.php, line 467
Model::call
_() - CORE/cake/libs/model/model.php, line 496
Overloadable::__call() - CORE/cake/libs/overloadable_php5.php, line 50
Attachment::makeVersion() - APP/plugins/media/models/behaviors/generator.php, line 169
GeneratorBehavior::make() - APP/plugins/media/models/behaviors/generator.php, line 169
GeneratorBehavior::afterSave() - APP/plugins/media/models/behaviors/generator.php, line 120
ModelBehavior::dispatchMethod() - CORE/cake/libs/model/model_behavior.php, line 171
BehaviorCollection::trigger() - CORE/cake/libs/model/model_behavior.php, line 494
Model::save() - CORE/cake/libs/model/model.php, line 1363

Sending file to David separately.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.