GithubHelp home page GithubHelp logo

Comments (11)

ogrosko avatar ogrosko commented on June 18, 2024 1

Hi I made little investigation

In method \Scarbous\MrTinypng\Service\TinypngService->shrinkImage() I'm receiving images but all types. So it crashes when in my case image /typo3conf/ext/bb_boilerplate/Resources/Public/Images/wsw_neu_rgb.svg comes for shrinking

So I thnik there is also necessary check mime-type of image like in \Scarbous\MrTinypng\SignalSlots\FileProcessingService->preFileProcess

Temporary I fix this bug as follow:

public function shrinkImage($source, $target = NULL) { if (!in_array(mime_content_type($source), array('image/jpeg', 'image/png'))) return; //...

from mr_tinypng.

saphrus avatar saphrus commented on June 18, 2024

Hi ogrosko,

this issue was fixed in 0.3.1
Are you sure you are using the latest version?

from mr_tinypng.

ogrosko avatar ogrosko commented on June 18, 2024

@saphrus
Yes I'm using latest version from typo3-ter

"typo3-ter/mr-tinypng" : "0.3.1",

from mr_tinypng.

saphrus avatar saphrus commented on June 18, 2024

Hi ogrosko,

as far as i can see your system is trying so send an svg, what should actually not be possible, since mr_tinypng checks wether your file is a png or a jpeg before it is sent to the tinify-api. I will have a look into this on next tuesday (after easter weekend ;)).

from mr_tinypng.

Scarbous avatar Scarbous commented on June 18, 2024

Hi ogrosko,
the problem with unsupported mime types was fixed at Version 0.3.1.
Which TYPO3 and PHP version has your installation?

from mr_tinypng.

ogrosko avatar ogrosko commented on June 18, 2024

Hmm wierd
I am using typo3 v7.6.4 and php v5.6

Is the correct version in typo3 ter?

from mr_tinypng.

ogrosko avatar ogrosko commented on June 18, 2024

Using the latest version v0.3.3 from dev-master I'm still getting same error.
Would be also possible to use composer versioning e.g. git tagging, or update latest typo3-ter version?

from mr_tinypng.

Scarbous avatar Scarbous commented on June 18, 2024

Thank you @ogrosko.
I will add it to the extension.
In a future Version I need this because it will shrink Images from CSS, so I have to check the mime-type.

from mr_tinypng.

ogrosko avatar ogrosko commented on June 18, 2024

@Scarbous
Your fix is wrong. please change it from

if (!in_array(mime_content_type($source), array('image/jpeg', 'image/png'))) {
to
if (in_array(mime_content_type($source), array('image/jpeg', 'image/png'))) {

also you uses 'image/jpeg' and 'image/png' on multiple places. Use it as const or public property etc.

from mr_tinypng.

ogrosko avatar ogrosko commented on June 18, 2024

👍

from mr_tinypng.

ogrosko avatar ogrosko commented on June 18, 2024

Can you also update extension in TYPO3 TER?

from mr_tinypng.

Related Issues (7)

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.