Magento 1.9.2.1 upload image issue. Disallowed file format - magento-1.9

Whenever I try to upload the image, the system throws the error
Disallowed file format.
I have tried a few solutions but nothing worked.
screenshot

You can change the configuration under:
System > Configuration > Catalog > Product Image
I had to change Maximum resolution for upload image to 5000px.
Then on Product > Images I got Maximum width and height dimension for upload image is 5000.
Note:- Please clean Cache after all the above steps

Related

images are broken on some of the MVC pages

I cannot see the image tec.png on Print.cshtml but same image is visible on PrintBos.cshtml
Print.cshtml code
<th>
<img style="
width:60%;
"src="..\img\tec.png">
</th>
printBos.cshtml code
<th>
<img style="
width:60%;
"src="..\img\tec.png">
</th>
As I can see,they are the same. What might be the reason?
Edit: I realized that images are shown on the default page only and using ~ doesn't work. Image file contents are not encrypted.
It is likely that the path to the image file is incorrect or the file is missing in the location specified.
You can try out the following steps may it help you out,
Verify that the path to the image file is correct in the Print.cshtml file. Also check for any typos or mistakes in the file path.
Next check if the image file exists or not for this go to the location specified in the Print.cshtml file and verify if the image file actually exists or not. If it does not, either upload the file or update the file path in the Print.cshtml file.
Also verify the format of the file because we need to make sure that the image file is in a format that can be displayed in a web page (such as PNG, JPG, or GIF).
As a last step check even if the image file exists, but image is still not visible, check the file permissions to ensure that it is accessible to the web server.
If these steps do not help and the issue is still there, you may need to further check out the code and configuration of your web application to find out the root cause.
Thanks.
I deleted the .. and it worked
<th>
<img style="
width:60%;
"src="\img\tec.png">
</th>

Why HTML background images not showing in live server in VS Code?

I have a problem with live server in VS Code .
When I use a background image in my HTML code, it works properly when I open that file without live server. But when I try to open it using live server it dosn't show background images.
1. here is my html code
my html code
2. here is the output when i open it chrome without live server
output in chrome without live server
here is the output when i open it using live server
output using live server
you should use either 'relative' paths of 'absolute' paths. Which means starting with a '/' (absolute) , or with a dot, '.' (relative).
On a live server environment a '/' points to your root website dir.
Make sure the image is in the same folder of your html, or a subfolder.
Your live server can not access your E: drive.
<img src="/image-in-root.jpg" alt="image in same dir as index.html"/>
or
<img src="./image-in-root.jpg" alt="image in same dir as index.html"/>
or
<img src="../../image-2-dirs-up.jpg" alt="image 2 dirs up from this file position"/>
or
<img src="/images/image-in-image-dir.jpg" alt="image in /image dir from root"/>
or
<img src="./images/image-in-image-dir.jpg" alt="image in /image dir one level below current"/>
There could be a few reasons why your HTML background image is not showing up when you use a live server in Visual Studio Code. Some possible causes include:
The path to the image is incorrect: Make sure that the path to the image file is correct and that the image file is located in the specified location.
The image file is not in a supported format: HTML supports a variety of image file formats, including JPEG, PNG, and GIF. Make sure that your image file is in one of these formats.
The image file is not properly encoded: If the image file has been improperly encoded, it may not display correctly.
There is a problem with the live server: If you are using a live server extension in Visual Studio Code, there may be an issue with the extension itself that is preventing the image from being displayed.
To troubleshoot these issues, you can try the following:
Check the path to the image file: Make sure that the path to the image file is correct and that the image file is located in the specified location.
Check the image file format: Make sure that the image file is in a supported format (JPEG, PNG, or GIF).
Check the image encoding: If the image file has been improperly encoded, it may not display correctly. Try re-saving the image in a different program to ensure that it is properly encoded.
Restart the live server: If you are using a live server extension in Visual Studio Code, try restarting the server to see if that resolves the issue.
Use the relative path for this problem of vs code live server.
If you are using external CSS then also use the relative path if the image is in the same folder or use the absolute path(full path) of the image if it is in another folder.
See the Output of my code I have to use the relative path of the image CLICK HERE TO SEE!
This output is with the absolute path (Full Path) of the image CLICK HERE TO SEE!
Relative Code
Absolute Code

Wordpress - Linking to images in HTML not working

I am creating a website using Wordpress and currently trying to put social media buttons on the header using a text widget to input HTML but the images are not showing and I am wondering if it something to do with file permissions as when I started out developing the website I was trying to upload a header image and was getting the error "Unable to create directory [directory name] Is its parent directory writable by the server?" So I went into termnial and entered sudo chmod -R a+w /Applications/XAMPP/xamppfiles/htdocs/sitename/wp-content/ which solved my upload issue.
I am developing locally and when I use an external website as the src for the image it displays the button on my website.
My images are stored in:
/Applications/XAMPP/xamppfiles/htdocs/sitename/wp-content/myimages/
The website files are located in:
/Applications/XAMPP/xamppfiles/htdocs/sitename/wp-content/themes/twentyfifteen-child/
Now the src link should be:
src="../../myimages/instagram.png"
but it is not and I have tried other variations even using the full link beginning from /Applications
So my question is whether this is indeed a file permission issue and if so what permissions should I use and how to enter it. However if it isn't related to permissions what else can I do to rectify the problem?
either "/wp-content/myimages/img1.png" or just upload the images through the media upload in the cms, then grab the url from there. That makes it quicker also
you will be success to get images please try this
in you text widget please try to pass the file Path like below:
<img src="http://www.sitename.com/wp-content/myimages/img1.png" />
befor this please confirm the image location to load image path to browser http://www.sitename.com/wp-content/myimages/img1.png
i am sure this will helps!!

Pictures not showing up in site hosted by GitHub

I have a website hosted by Github and I am having issues with displaying pictures. I recently tried to upload new pictures but despite the path being right, the page fails to load the images and gives a 404 error in the source as it tries to find the path. Here is the repo of my site: https://github.com/jeanturban/jeanturban.github.io
I think it might have something to do with Picasa as when I download a picture from the internet and update the path accordingly it works fine. But when I try to use pictures from my computer, or if I try to export from Picasa to my "img" folder, then it breaks. Perhaps Picasa is making a hidden folder upon exporting the pictures that is not being uploaded? Anyone have any insight on this? Or a workaround?
It looks like your images are not loading due to the wrong file extension. You are trying to load "http://jeanturban.com/img/Current/light1.jpg" when it should be "http://jeanturban.com/img/Current/light1.JPG" -- notice the capital JPG at the end.
The issue in my case was my images where in a .attachments folder (coming from Azure DevOps) and I guess GitHub pages skipped hidden folders.
I had same issue but image case was not problem.
What fixed it was shortening image file name from 26 characters with three underscores to 16 characters and one underscore.
I had to change the path for where my media files were stored for my case:
before my file setup was:
-myusername.github.io
-->index.html
-->index.css
->media
-->myImage.jpg
after I changed it to the setup below, it worked:
I had to change it to this:
->myusername.github.io
-->index.html
-->index.css
-->media
--->myImage.jpg

Unusual issue with HTML image and 'file://' specified src

I'm loading an image on the page with a 'file:///some_dir/image.jpg' src path. I can access the image in a regular tab using this path. Also, saving the page as HTML and using this path for the image works. However, the image does not load on the live page. In chrome it shows part of the alt text, and in firefox it shows a narrow strip. I have tried changing width and height but to no avail. Is there something I'm missing?
<img title="Click to enlarge" src="file:///Users/Aram/uploads/profile.image.985b0f707d972bf3.4372696242656464696e67616e645465657468696e67437269625261696c436f7665722e6a7067.jpg" class="profile-image">
EDIT:
I noticed I am getting this in the console:
Not allowed to load local resource
Is there any way around this?
EDIT 2:
Since I could not access the image through an http path, I have decided to read it in as base64 data. For anyone else using web2py or another Python framework:
# Load the image data
import os
path = os.path.join(request.folder, 'uploads', filename)
data_uri = open(path, 'rb').read().encode('base64').replace('\n', '')
data = 'data:image/png;base64,%s' % data_uri
return html.IMG( _src=data, _class='profile-image', _title='Click to enlarge' )
Websites are not allowed to use local files on the user's computer. Use a relative path to from the html file's directory.
You can also encode and embed the image directly:
How to embed the encoded stuff: http://www.sweeting.org/mark/blog/2005/07/12/base64-encoded-images-embedded-in-html
Python Encoding Instructions: http://www.daniweb.com/software-development/python/code/216635
The problem is you are trying to load a file directly off of a clients computer. Browsers prevent this.
You can read about the exact details here:
http://en.wikipedia.org/wiki/Same_origin_policy
It is called the Origin Policy. It prevents malicious sites from directly loading files off of a clients computer. Try using a relative path from your page to display the image.
In some situations (rare) I've used a light web server to host the site so that I could load the files from the server (as opposed to having it load off of what the browser sees, as a clients computer).