Images not showing in TinyMCE suddenly

Permalink
When editing a html block with Tiny MCE the images are not visible. When inserting an image from the library the code inserted is as follows:

<img src="/concrete5/index.php/download_file/-/view_inline/9/" alt="office1.jpg" width="494" height="480" />

When the block is saved, the images becomes visible and the path is corrected.

It has worked correctly but suddenly this problem occurred.

What's causing this? Is it some kind of setting?

I'm using version 5.3.3.1

Webcreatives
 
Webcreatives replied on at Permalink Reply
Webcreatives
I noticed that the change in the url is as it should be, leaving the question why the image is not showing with this code:

<img src="/concrete5/index.php/download_file/-/view_inline/9/" alt="office1.jpg" width="494" height="480" />

Any idea anybody?
Mnkras replied on at Permalink Reply
Mnkras
after the upgrade did you rescan all images?
Webcreatives replied on at Permalink Reply
Webcreatives
Thanks for your reply but unfortunately that did not fix it
digirunt replied on at Permalink Reply
digirunt
I know this is an old thread but I am having the same problem described here. The problem started after the upgrade to 5.4.2 but I have since renewed the entire contents of the Concrete folder with the latest version 5.4.2.1 and the problem persists. I have cleared the cache and the problem exists for new or existing files. I have checked any overides I have in my folder directory structure and cannot see anything that would cause this. The html viewer shows the view_inline link although when saved the correct file location is used and the images appear fine.

Any assistance would be appreciated.

Thanks
jjcdesign replied on at Permalink Reply
Did you manage to find a solution? I am having a similar problem with tinymce - I am also not getting a captcha image or the ability to edit an uploaded image in picnik
Ale replied on at Permalink Reply
I had the same problem, but managed to find a fix for it. The problem seems to be caused by some file printing out empty space (or line change) before the image output starts. The empty character is enough to corrupt the image.

To fix the problem, go to yoursite/concrete/controllers/download_file.php and find the function view_inline(). Modify it to use ob_clean() to wipe out any unwanted characters. See the code below:

$contents = $fc->getContents($file->getPath());
ob_clean(); //ADD THIS ROW
header("Content-type: $mimeType");
print $contents;


Please note that this is a direct fix to the core file itself. You may want to copy the download_file.php to yoursite/controllers and make the modifications there to make the override "the right way".

I'm still not sure where the empty space came from, but I noticed it by adding die("---"); to the start of the view_inline() function and checked the source code.
jjcdesign replied on at Permalink Reply
Thanks for the reply, hopefully this will help other people out who get a similar problem. I was able to find and successfully use a different solution:

In /config/site.php I needed to remove any extra spaces

see:http://www.concrete5.org/community/forums/customizing_c5/tiny-mce-i...


fingers crossed anyone else getting similar problems will be able to implement one or both of these 'fixes'