Comments (18)
What Craft version are you using?
from redactor.
Sorry, that would have been helpful:
Image driver & version | Imagick 3.4.3 (ImageMagick 6.9.6-2)
-- | --
Craft Pro 3.0.7
-- | --
Redactor | 2.0.1
from redactor.
I can't reproduce the problem.
- Craft PRO 3.0.7
- Redactor 2.0.1
Assets Configuration:
- Volume: local (
@webroot/uploads
) - Transformer: Thumb / Small / Medium ( copied from the HappyLager example)
I have tested it with the following:
- Upload image via Redactor Editor
- Upload image via Assets page and choose it via the Redactor Editor
Question:
- If you have no transformer defined, is it working?
- Are all directory permissions set correctly
from redactor.
Ok thanks @noxify - I'll dig deeper into it and try to get more info.
from redactor.
If you have no transformer defined, is it working?
Yes
Are all directory permissions set correctly
They are. This was working before I updated from Craft 3.0.5 and Redactor 2.0.0.1
For what it's worth, both of these are in Matrix blocks. Not sure if that makes a difference but I'll keep testing to see if I can isolate the problem.
from redactor.
I have tested it with an Matrix field - and it's working, too.
from redactor.
Maybe you can give it a try with a fresh installation?
from redactor.
Thanks for the help @noxify. I'll keep digging.
from redactor.
Not sure this helps at all, but for some reason it's not getting the full file path for my transformed image, just the filename:
5. in /vendor/craftcms/cms/src/helpers/FileHelper.php at line 260 – yii\helpers\BaseFileHelper::getMimeType('test-file.jpg', null, true)
/**
* @inheritdoc
*/
public static function getMimeType($file, $magicFile = null, $checkExtension = true)
{
try {
$mimeType = parent::getMimeType($file, $magicFile, $checkExtension);
} catch (\Throwable $e) {
if (!$checkExtension) {
throw $e;
}
$mimeType = null;
}
from redactor.
I had this issue just happen. What I figured out in my case, is that the selected image source had a smaller resolution/size than the transform selected, resulting in the file not being found.
Seems like a bug that you could select a transform that doesn't exist... OR... craft should fall back on the next available transform.
For example, if the transform 'full' is 1600px wide, but your source image is 800px, the source image should be served if 'full' is selected as the transform to insert. Or better yet, you shouldn't be able to select that transform when inserting the image.
from redactor.
Thanks @jameskrill -- Unfortunately that's not it in my instance.
I've tracked this down to a change in vendor\craftcms\cms\src\elements\Asset.php
on line 708
in either 3.0.6 or 3.0.7
Specifically FileHelper::isGif($this->filename)
is causing my problem. If I remove that, the issue is gone.
from redactor.
@andris-sevcenko Not sure it's worth the paper it's printed on, but adding the full path to the image fixed my problem.
I changed line 708
of vendor\craftcms\cms\src\elements\Asset.php
From:
if (FileHelper::isGif($this->filename) && !Craft::$app->getConfig()->getGeneral()->transformGifs) {
return AssetsHelper::generateUrl($volume, $this);
}
To:
if (FileHelper::isGif(FileHelper::normalizePath($volume->getRootPath().DIRECTORY_SEPARATOR.$this->getPath())) && !Craft::$app->getConfig()->getGeneral()->transformGifs) {
return AssetsHelper::generateUrl($volume, $this);
}
Without being more familiar with the codebase I'm not sure if there are repercussions to this.
from redactor.
@page-8 - Is this then not a craftcms/cms issue?
Btw. The path info was removed in this commit:
craftcms/cms@112e2f6#diff-1439c2c7558601e6752050108ba410d4L708
from redactor.
@page-8
Without being more familiar with the codebase I'm not sure if there are repercussions to this.
This will fail for remote Volumes, sadly.
The codeblock you pasted above is there exactly because Craft sometimes needs to decide on the mimetype based just on the filename. It's curious that it's not working for you, though.
Are you, by any chance, overriding or disabling the error handler component in your app configuration? That particular block of code relies on Yii's error handler converting errors to exceptions.
from redactor.
That's what's really weird about this. The only place the exception is (seemingly) not getting caught is in the Redactor Transform. For example, I'm not getting an error on the Assets Listing page.
Are you, by any chance, overriding or disabling the error handler component in your app configuration?
No, this is the only thing in my general config:
'*' => [
'defaultWeekStartDay' => 0,
'enableCsrfProtection' => true,
'omitScriptNameInUrls' => true,
'cpTrigger' => 'webmaster',
'securityKey' => getenv('SECURITY_KEY'),
'useEmailAsUsername' => true,
'allowUpdates' => false,
'phpSessionName' => 'MTMSessId',
'sendPoweredByHeader' => false,
],
This is happening on my local environment using MAMP 4 and the Arcustech server where we have the site hosted.
This is also happening for me on a fresh installation of Craft 3 with only the Redactor plugin installed and one field type called Body
with one Transform called testTransform
Per your comment @noxify , it seems like it's only happening with Redactor's use of this only when it comes to a transform. (as far as I can tell)
from redactor.
Got it, I'll see if I can reproduce!
from redactor.
See the issue, working on a fix
from redactor.
Sweet, thanks @andris-sevcenko !
from redactor.
Related Issues (20)
- Image position setting is broken
- Craft 3.8.11 update - no longer have video or hr available in redactor field
- redactor should contain at most 65535 charcters HOT 1
- Absolute fallback url in links
- README typo
- Button for imagemanager plugin not appearing in toolbar
- How to prevent strip out js embed codes?
- Every redactor field gets random font-size styling
- Inline styles not being removed for ul and li elements, despite setting enabled in Advanced section
- "linkNewTab" config setting seems to have no effect
- [4.5.5]: Redactor not allowing parenthesis HOT 3
- Overlay in fullscreen when inserting a link to an entry does not fade when Preview is active HOT 2
- Linking to Asset results in 404 HOT 1
- Display custom element sources in Redactor HOT 3
- HTML button for non-admin users HOT 1
- Server error when entry form is opened HOT 2
- Can't select available volumes
- Format styles dropdown does not show the currerntly active selection
- Text added to asset link?
- Abandoned? HOT 13
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 redactor.