Laravel 4 imagecache intervention not displaying images - laravel

Here's the product page with an imagecached image: http://kmk-prof.kz/product/dx700lc
As you can see - image is not being displayed and has following url: /imagecache/catalogue/dx700lc-541a82fe99ac3.jpg
But when i try to browse that image just in my uploads folder - http://kmk-prof.kz/uploads/dx700lc-541a82fe99ac3.jpg it displays just fine.
Why could imagecache not work?
Here's the imagecache config.php:
'route' => 'imagecache',
'paths' => array(
public_path('uploads'),
),
'templates' => array(
'catalogue' => function($image) {
return $image->fit(213, 213);
},
),

It's very hard to tell you why the image is not displaying without any code.
Looking at the site, your image (in the html) is looking for a file in /imagecache/catalogue/dx700lc-541a82fe99ac3.jpg when your file is in uploads/dx700lc-541a82fe99ac3.jpg.
you can do 2 things:
change the code to load the file from uploads/dx700lc-541a82fe99ac3.jpg.
or, change your image path to /imagecache/catalogue/dx700lc-541a82fe99ac3.jpg
if you want more help, please post your code.
PS. your IMAGE URL link doesn't work ^_^

Related

How to stop tinyMCE 5 to add ../../../../ before an absolute url received from alexusmai filemanager?

I am using Laravel 8, tinyMCE 5 and Alexusmai filemanager. My images are in the /public/assets/images folder.
The 'assets' disk is setup in config/filesystems.php :
// assets folder in public path
'assets' => [
'driver' => 'local',
'root' => public_path('assets'),
'url' => '/public/assets',
'visibility' => 'public',
]
FM returns the correct relatrive url, i.e. public/assets/images/xxx.jpg in a form field as a stand alone.
In tinyMCE 5, the same url is returned to the editor (the image is visible) but as soon as I look in the source3 code, the img scr is replaced by "../../../../public/assets/images/xxx.jpg". Why? How can I stop tiny to do that?
update...
It also seems that sometimestiny only adds ../ before public/assets... which results in the image not showing in the editor but displaying correctly in the website page. Weird!
How can I stop that please...
Seems like this is TinyMCE's "url handling": https://www.tiny.cloud/docs/configure/url-handling/
Try to add convert_urls: false to tinymce.init

Image not displayed in postman (readable) using Laravel API

The image is saved to the database and file path specified in the response. Trying to display the image or download it, it is not the displayed. I tried to read the same image but it is working.
storage_path('app/uploads/images/3.png')
I read the 3.png stored in the directory and it is working without displaying error but to display the image it doesn't display image.
[![if (empty($imag)){
return response()->json(\[
'success' => false,
'message' => 'There was a problem creating the postcard!'
\], 201);
}
return response()->json(\[
'success' => true,
'data' => file_get_contents(storage_path('app/public/uploads/images/'.$exportName)),
'message' => 'Postcard created successfully!'
\],200);
}
The directory where the image is saved is storage/app/public/uploads/
I used php artisan storage:link
Your storage path is
App/upload/images/3.png
And you are uploding image in
App/upload/public/images/3.png
So database is storing above path and image is not uploded in above path
Just remove public from above path it works...

Laravel File Manager UniSharp Incorrect Image URL

Displayed Image URL is incorrect. It should add "public/" in the url. How can I edit the url?
Instead of storing in public, I remove base directory as following:
'base_directory' => '',
'images_folder_name' => 'photos',
'files_folder_name' => 'files',
'shared_folder_name' => 'shares',
'thumb_folder_name' => 'thumbs',
And edit LfmHelpers.php under traits in line 113 as following:
$prefix = '/' . $prefix; And it works fine now.
If a UNISHARP then you need to have a look at this issue UNISHARP BUG as it suggest it is a bug.
The issue reporter find the solution by doing so
It worked after I removed the following from
vendor/unisharp/laravel-filemanager/src/views/script.blade.php
if (path.indexOf(ds) === 0) { path = path.substring(1); }
Hope it will solve yours.

Why wysiwyg plugin in magento gets me broken links?

When I try to insert an image to the wysiwyg editor in Magento it places the right variable of the image path in the media directory.
But, wysigyg doesn't find the right path/url, example:
I inserted:
<p><img src="{{media url="wysiwyg/blog/Screen_Shot_2013.png"}}" alt="" /></p>
But, in the preview it gets me the next broken src:
<img src="https://localhost/index.php/admin/cms_wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ii93eXNpd3lnL2Jsb2cvU2NyZWVuX1Nob3RfMjAxMy5wbmcifX0,/key/1a966015551bf00867319d23c9914b48/" alt="" data-mce-src="https://localhost/index.php/admin/cms_wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ii93eXNpd3lnL2Jsb2cvU2NyZWVuX1Nob3RfMjAxMy5wbmcifX0,/key/1a966015551bf00867319d23c9914b48/">
And of course, it doesn't show the image. Also this happens with links and other media files.
System -> Configuration -> General -> Content Management -> Use Static URLs for Media Content in WYSIWYG for Catalog to Yes
The option wich Le Nguyen gave is not really a good solution.
Like hsanders said:
There are some pretty big drawbacks to doing this: The static URL will be a non-secure URL and If you change your base URL the URLs on the images will not update to reflect that are the two I can think of immediately.
A possible solution to "fix" the problem (not the right way in my opinion, but at least better than the static Url option) would be to add some code to the following file:
vendor/magento/module-catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php
Add on line 747:
'add_variables' => false,
'add_widgets' => false,
'add_directives' => true,
Also change
lib/web/mage/adminhtml/wysiwyg/tiny_mce/setup.js and add the following on line 384 (below content = editor.getContent();:
content = this.decodeContent(content);
Now you need to execute the following command to complete the process:
php bin/magento cache:flush
Hope this helps.
(Keep in mind you've just edited core files)
in your Form.php you configuration should be like below
protected function _prepareForm()
{
$model = Mage::registry('testimonial_data');
$form = new Varien_Data_Form();
$this->setForm($form);
$form->setHtmlIdPrefix('testimonial_');
$wysiwygConfig = Mage::getSingleton('cms/wysiwyg_config')->getConfig(array('add_variables' => false, 'add_widgets' => false,'files_browser_window_url'=>$this->getBaseUrl().'admin/cms_wysiwyg_images/index/'));
$fieldset->addField('content', 'editor', array(
'name' => 'content',
'label' => Mage::helper('testimonials')->__('Content'),
'title' => Mage::helper('testimonials')->__('Content'),
'style' => 'width:700px; height:500px;',
'state' => 'html',
'config' => $wysiwygConfig,
'required' => true,
));
}
hope it will work for you.

Showing attached images of certain size in Wordpress posts

I am currently using WordPress to build my portfolio website. The site consists of:
a homepage showing "project" posts (using post categories).
an about us page
a projects page (very similar to homepage) showing thumbnails and titles of recent projects.
a project detail page (this is a click through from either the homepage or projects page and shows detail on a particular project.
On the project detail page I have an image slider which I want to show the work associated with that project. I have used the following function call to return all images associated with the post:
<?php display_images_in_list('medium'); ?>which calls the following function:
function display_images_in_list($size = thumbnail) {
if($images = get_posts(array(
'post_parent' => get_the_ID(),
'post_type' => 'attachment',
'numberposts' => -1, // show all
'post_status' => null,
'post_mime_type' => 'image',
'orderby' => 'menu_order',
'order' => 'ASC',
))) {
foreach($images as $image) {
$attimg = wp_get_attachment_image($image->ID,'medium');
echo "<div class='slide'>".$attimg."</div>";
}
}
}
Even though I have specified I would like medium images returned my slider still features the thumbnail image which I uploaded to show on another page.
How can I show only medium images?
when you upload image as attachment to post wp creates thumbnails. You cannot upload a thumbnail. If you upload big image, and thumb image both will be shown. You need to upload only big images and than it will show medium size as you wish.

Resources