i tried all the versions of ie but it is not showing only 1 image.
<asp:Image ID="img" runat="server" ImageUrl="~/images/FlorDecor.jpg" BorderColor="AliceBlue" BorderStyle="None" Height="126px" Width="90px" />
i tried placing this image outside the folder and giving
url = "FlorDecor.jpg"
url = "../FlorDecor.jpg"
url="~/FlorDecor.jpg"
i tried all this stuff pls help me..
Your URL references were not all valid in Silverlight (should have been "images/FlorDecor.jpg" if the file is in the images folder of your Silverlight App).
Silverlight uses different URL methods depending on whether the image is in the Silverlight project or somewhere on the source website (or an external site).
If the problem persists the cause is more likely that your JPG is not compatible for some reason.
Convert it to a PNG with Paint.Net or similar to test that theory, or just grab another JPG from the Internet instead.
Do not use .jpg file, use .png. It will works.
Related
If I upload an image with a suffix .JPG the thumbnail will not display in the browse images area. I can select it and place it just fine, but the thumbnail will not display. If I change the suffix to lowercase .jpg on the server, the thumbnail will display. Is this a bug or something that can be fixed in the config? Using the ColdFusion connectors.
It's a bug caused by misfortunate behaviour of ColdFusion described here: Problems determining a file's mime type in ColdFusion. Download version 2.5.0.1 (released a minute ago ;)) and the thumbnails should be working.
I have a logo that shows up in Safari but in Chrome it appears as a broken link and simply does not show up at all in Firefox.
<img src="images/logo-01.png"/>
I have re-uploaded it many times and have even tried alternative paths and file names.
anyone know how i might be screwing this up?
I ran into this same problem. For me, it turns out the image was corrupt. If i tried to open the png file up in photoshop, i would get an error saying it could not parse the file.
For whatever reason, safari could display the corrupt file, but chrome could not. This is how i fixed my issue. I noticed "preview" on my macbook could open the file fine. If you are using windows, possibly try paint or gimp or some other program besides photoshop.
I downloaded the corrupt file onto my macbook, opened it with preview (open with > preview)
In the preview app, go to file > duplicate, which makes a copy of your image
Save that duplicated image
As a test, i tried opening that new copied image in photoshop and i was able to!
Upload new file to website. I was able to view the image in chrome now.
Hope that helps anyone who ran into the same problem.
It could be an issue with your file structure. Right now your links are using relative paths (e.g. href="index.html"). This is fine if the file you're referencing is in the same directory as the current page file. But if your current page is located elsewhere, like in a 'pages' directory or something, then you need to tell the links to start from the site root. That would look like href="/index.html" (note the slash). So for the image, you'd have:
<img src="/images/logo-01.png"/>
I've got a bit tricky problem... I've got this file upload control which is only used for uploading profile images. When it is clicked it opens a Windows explorer Browse window. I would like this window to have the filter preselected on image files (.jpg, .png, etc.) and mine only has "All Files". This is what I'm talkin about:
I would also like to set a default location for the folder. Is there any way to set this Browse window?
You could achieve that if your browser supports HTML5 by adding the accept tag to your file input:
<input type="file" name="file" accept="image/jpg, image/gif" />
If your browser doesn't support HTML5 you are pretty much busted. Prefiltering file input dialogs in legacy browsers to a certain file type simply is not supported. You will have to use Flash or some equivalent client side scripting technology. You might take a look at some file upload controls such as Plupload, BlueImp and Uploadify which are abstracting much of this hassle for you.
In my Silverlight project, images for which the source URI does not contain the file extension don`t display, although the documentation says it should.
I set the image source like so:
imgCompanyLogo.Source = new BitmapImage(new Uri(Application.Current.Host.Source, "/Files/" + logoName));
Now, if "logoName" contains the file extension (like ".png" for example), the image is displayed fine, but it simply doesn't if the file is stored without an extension.
This seems to contradict the documentation here which states:
"The format-specific filename extensions such as .png are not necessarily required to be in the URI naming, but if the retrieved file is not determined to be a valid image format, a runtime exception is thrown."
I'm not getting any runtime exception either.
Is this a known issue or am I missing something simple?
Thanks!
PS: Just a little twist, the images display fine while debugging, not when the system is deployed...
I've made some test and the problem seems to be due to the response from the server.
If you try using .png within your project with a Build Action sets to Resource, both images will load regardless the extension.
Now if you try with images hosted on a server, it won't have the same behavior. Actually, if you try to browse the link to an image without extension directly in your browser, it will result in something else. On Chrome it will download the file, and on IE it will display the result as plain text.
That's because of the MIME type. A png should be returned with the type image\png.
There is a trick with .htaccess to set up the MIME-type but you need to have to specify for which extension. It works like this:
AddType image\png yourExtension [Extension2] [Extension3] ..
And if you want to see if why the image didn't load on your Image control, you can add an eventhandler to the ImageFailed event:
<Image Source="..." ImageFailed="Image_ImageFailed" />
But the error message that you will see is not really helpful:
ErrorException = {System.Exception: AG_E_NETWORK_ERROR}
I've added a PNG file to a directory in my VS2k8 webforms project, and when I run the app, it refuses to render my image - it even knows the dimensions but renders a box with a red X.
Oddly enough, if I double click the PNG file within VS2k8, it opens up in the IDE and displays fine (but only within the IDE).
Does anyone have any clues?
The path is correct.. I just have a basic default.aspx page with this in the body
<img src="img/logo.png" />
if i navigate to img/logo.png in the browser, it shows a box with the same dimensions as my image, but a red x. Its finding the image, just not rendering it. It's showing up in IE running under the vs2k8 web server (localhost:5512/default.aspx)
I've dropped a JPG in the same directory, and it shows up just fine.
I'm not sure what type of PNG it is, but here is the kicker.... If i make an HTML file that references that image, copy both this HTML file and PNG file to my webserver (or just double click on the HTML page), it comes up JUST FINE.
Its leading me to believe that the Visual Studio web server may not recognize PNG files (at least this one) properly?
Try changing the path to:
<img src="/img/logo.png" />
Try to use Firebug on the running page. It will let you change the path dynamically so that you can see if there is a problem with the path. Alternatively you can also just copy your dev path, say "http://localhost:<someport>/img/logo.png" and see whether it loads there.
As a third alternative you could use the <asp:Image id="imageLoge" runat="server" ImageUrl="..."/>. The advantage is that it will let you browse in the folders and select your image. In this way you're guaranteed that it is not a problem with your path.