PNG image won't show in IE7 or Firefox but works in Opera - browser

I got a webservice which creates a PNG-file and returns a link to it.
Then this graphic is used by a website (ASP.NET).
IE7 & Firefox 3 can't show this image but in Opera 9.5 it works fine.
Did anyone run across the same problem before?
Edit:
Content-type is set to image/png.
The image is created with the library from a 3rd party vendor which is not available to the public.
Any chance to check the png-file for compliance to the standard?

In principle, both IE7 and FF can display PNG images. As it seems your PNG is not fully compliant to the rendering engines of these browsers (or to the standard?).
It is hard to tell where the problem lies exactly without knowing how the image was created. Which lib are you using? Do you have sample code?
EDIT (After reading the comment by Yuval A):
You could also check whether the HTTP response sent by your web server has the correct content type set for PNG images. This might be needed by browsers to display the image correctly.

Check how your web service is "returning the link" to it.
Is it represented correctly on the HTML response? (i.e. in an IMG tag with a correct src?)

Turns out that the png wasn't rendered with the right dpi settings. A subtle bug that emerged after some months.

Related

HTML to PDF without headless Chrome

I'm trying to find a solution to generate PDFs from HTML but everything I find used headless Chrome.
Does anyone know about a solution that doesn't involve using a headless Chrome instance?
Thanks!
Maybe PrinceXML, which despite its name produces PDF from HTML.
As a bonus it supports Paged Media CSS standards that no browser wants to support (as of today).
I have no relation to Prince, just have used it in the past.

mapbox offline custom style -> need png

I have created a custom style, with custom tileset, which displayed correctly in Chrome, but not in Safari or in iOS app (tiles are downloaded for offline).
I am trying to figure out how to specify that I require png tile set and so far came up with nothing.
Can you please point me in the right direction?
Edit: Perhaps it is not png, vs jpeg after all and something else that is not configured correctly, but the guess so far is that it is due to the fact that jpeg is not transparent and thats why custom layer sent as jpeg does not show layer below. Although I am not sure why it is working in Chrome and not in Safari
Your raster tiles are being rendered as expected in Chrome but not Safari, because Chrome supports WebP images.
You can see detailed discussion of the issue here. The linked issue also discusses possible workarounds such as turning the image into an Image source on the map. Unfortunately, there's no easy solution to implement on the Mapbox side because of the limitations of the JPG format and browser support for WebP.

Load locally stored images through css with inspect element

I'm trying to redesign a small portion of vastly huge site and I was told that I can load custom images to Inspect Element (Chrome) if they are located in the same path as the stylesheet to which the site is remapped. (all done through css via 'content: url('...');') but the webpage is still looking for them in its own resources. So is there a way to use a locally stored image with Inspect Element?
When you're passing images in locally you can use, for example:
file:///C:/Users/[username]/Desktop/picture.png
So if I was to change a background image I would use
background-image:url("file:///C:/Users/Julia/Desktop/background.png");
But note that a lot of sites don't allow you to load local resources, so an error may appear in the inspect console when you try.
Actually, it only works with background instead of background-image (not sure if it works) but background without image seems to work. So put in:
file:///Users/[YourName]/Documents/picture.png
Like this:
background:url("file:///Users/[YourName]/Documents/picture.png")
I just decided to contribute because I just wanted to try it out myself as well and found this as the first answer despite the post being 2-3 yrs old; although for other users it might be helpful.
Also, this was done on Opera, but haven't tried it on other browsers, but it does work for me. Don't include the drive name. But you can simply copy the URL, by dragging the image into the browser (if it loads it) and copy the link. It should work (usually older browsers that don't auto-download the image).

Why does google.com look different on blackberry & phonegap vs. blackberry & browser

I'm tyring to get phonegap up and running on blackberry storm (9530 simulator). I had been testing my webapp from withing BB's built in browser, and it was looking ok, but then it totally bit once I tried to look at the some code from within phonegap, even though I was pointing phonegap to the same url (I hadn't yet gotten to the point of running code locally on the device).
I tried a test case on google and got similiar results. see below. I suspect that I'm missing something basic here. I would have expect both images to be nearly identical.
Browser
http://www.eleganttechnologies.com/outside/ImgDeviceBB9530WebGoogle.jpg
Phonegap
http://www.eleganttechnologies.com/outside/ImgDeviceBB9530PgGoogle.jpg
[Update]
To shed some light on what is happening, I ran the browser and the embedded browser (phonegap) against the W3 mobile web acid test: http://www.w3.org/2008/06/mobile-test/
I definitely notice differences between the two, but I don't yet know the 'why' and the 'how-to-address'.
Acid via built-in browser
(source: eleganttechnologies.com)
BTW - I ran this earlier today and got a couple more green square than just now.
Acid via browser embedded into phonegap
http://www.eleganttechnologies.com/outside/ImgDeviceBb9530PgAcid.jpg
Disclaimer: I don't know anything about phonegap, but have a pretty good theory. By default the embedded browser control on BlackBerry uses an older version of the rendering engine than the BlackBerry browser itself does.
At the BlackBerry developer conference last year, a talk was given about this, and there's an undocumented option to use the newer rendering engine. \
The option ID is 17000 (yes, a magic number, which could change, use at your own risk etc), and should be set to true. Not sure how you'd pass this option through phonegap (I'm not familiar with the toolkit) but using the BlackBerry APIs it's something like:
BrowserContent content;
...
content.getRenderingOptions().setProperty(RenderingOptions.CORE_OPTIONS_GUID, 17000, true);
I don't know the specifics of the browsers you are using, but I do know that most of the big sites will detect your OS + browser combination to decide what HTML to show you.
If Google is seeing a different user agent, you might get a generic mobile version of the HTML instead os the Blackberry specific HTML you get for the built in browser.
If you have access to a web server, try hitting it with both browser setups and see if there is any difference in the log file. That might tell you something interesting.
As we can see in your Acid tests...
One browser (the built-in one) is reporting correctly as a BlackBerry9530, and the other (phonegap) is not presenting the user-agent ["Testing with ."].
In this case, Google is providing you with the default view of their homepage, whereas when you are reporting yourself as a BlackBerry device, you will get the BlackBerry specific rendering.
By the sounds of things, using phonegap is removing the default user-agent (most probably because it's not recognising your device). As phonegap is open-source, the best bet is to get in there, and debug it and find out what happens with the user-agent when the http requests leave the device and track it back from there.
Maybe one browser has capabilities that another one does not?
Hm. By looking at the screenshot I would say that the second page is probably missing some resources. It may be missing some images, scripts and the CSS files, which would explain different l&f. Knowing how Blackberry Browser Field API works, I would guess that the implementation that uses the BrowserField was not done correctly. Just my guess. In addition to that, when the browser field is initialized the caller needs to configure it properly by enabling the appropriate browser features - scripts, styles etc. Again, the API is done in a very weird way, I have gotten myself into this trap once. When setting the options, you cannot just create one mask (like CSS | WML | SCRIPT) and make one call. Options are numeric and, I believe, non-overlapping - but you still need to call the API for setting each option independently.
Also the way asynchronous loading of the resources for BrowserField takes time to understand.
Just my $0.02.

What quirks are in the Blackberry Web Browser that a developer should be aware of?

Before I start pulling my hair out on any "known issues", is there any quirks or problems that I should be aware of.
Specifically with cookies, JavaScript, HTML, CSS and images.
PS I have a copy of the docs provided by RIM, but I'm hoping others know of some lesser known issues.
Here are a few that I've noticed:
For some reason, the BB browser doesn't seem to handle underscores in the hostname correctly. I don't remember what happened, but if you hostname is like this: http://some_host/blah, I remember it having problems.
This can be corrected with a DNS entry that removes the _
Another thing we've seen is serving up .jad files for Java downloads. If your module contains _ or other special characters, the BB browser displays a HTTP 500 error when trying to fetch the .jar or parse the .jad. This is especially annoying because it's not actually an HTTP error, the server is serving up a file, but the BB browser just can't parse it, so it blames the server.
We fixed this by using Fiddler to hit the .jad URL and view the contents of the HTTP response. If your .jad has any special characters (or sometimes URL/HTTP encoded strings) you might need to simplify your module name to only use A-Za-z0-9
I know those aren't exactly html/css things, but thought I'd post this anyway!
I had used the blackberry browsers on emulator versions to test my web pages.
These are some i would like to point out.
Please forgive me in case of any deviation with a real case because these are specific to emulator versions on windows 7 OS. I dint have the devices to check and verify.
When we are coming down to a BB OS version below 5.X (eg. BB 9630), the browsers support for java script will be turned off by default. So you need to go browser options turn on it manually.
When we go further down to BB OS version 4.2, the style sheet support will be turned off by default. Causing your webpages to render without applying style sheet. So that time you need both the java script and style sheet supports to be turned on manually.
Even when i was on a OS version 7.X or 6.X, the internet connection was working and i could connect to pages. When i went down to version 5, those emulator browsers shown issues for connection. On googling i found that MDS is a requirement when we go down the versions and seek internet access.
I installed MDS, still it was not working for versions below 6, reason being the JAVA_HOME environment variable was not set in my advanced system settings in my-computer properties. But it was not even pointing out the issue and the MDS was closing instantly.
So after setting my JAVA_HOME to "C:\Program Files (x86)\Java\jre1.6.0_07" the place i installed JDK(we need JDK for MDS), internet connection started working.
Also if you are using g zip compression for your pages, below Blackberry OS version 6, the browsers no longer requests for a compressed one. (found it on OS version 5 emulators BB 9700,BB 8520).
Also when you are going to use a css property or html entity that you doubt support, be sure to go to the corresponding OS version content developer guide and find from which version are they providing the full support and partial support.
Check out the BlackBerry Browser Version 4.2 Content Developer Guide. It is for the older 4.2 browser but still has lots of good info about what HTML, CSS, and javascript is supported.
My experience with BB 8700 is that you should not use JavaScript, neither depend on CSS to be rendered correctly. It also has no flash player by default so you're off to plain server-side HTML form processing/ASP/CGI. Also beware of size, as internet can get pretty slow while on the road.
One known issue is that the Blackberry browser completely ignores the css display property, so you can't use display:none to hide content.
We've also had trouble with basic form submittal - sometimes, the POST doesn't happen at all, other times it happens but some or all of the form fields go AWOL. We haven't been able to get to the bottom of this issue, but it seems to occur mostly with the BB Curve series.

Resources