Comments (11)
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.
Hi ogrosko,
this issue was fixed in 0.3.1
Are you sure you are using the latest version?
from mr_tinypng.
@saphrus
Yes I'm using latest version from typo3-ter
"typo3-ter/mr-tinypng" : "0.3.1",
from mr_tinypng.
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.
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.
Hmm wierd
I am using typo3 v7.6.4 and php v5.6
Is the correct version in typo3 ter?
from mr_tinypng.
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.
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.
@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.
👍
from mr_tinypng.
Can you also update extension in TYPO3 TER?
from mr_tinypng.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mr_tinypng.