Images rotated on chromecast - chromecast

I have a Chromecast sender application developed. I try to take a photo in portrait mode with my phone camera. When I try to send it to the Chromecast device, I see it rotated 90 degrees.
This occurred on Samsung Note S3. On Nexus 5, it was showing in portrait mode. I have tried similar applications downloaded from the Google Play and the results were different. Some apps had the same issue while others could cast the photo in its correct orientation.
On another note, Is there a way to have a smooth transition between photos? currently I have the Default receiver app installed and the fade out is working fine. However, new images loads in chunks ... any suggestion on how to fix this?
Thanks

You can create a custom receiver and use CSS to fade between images. Create a div with two image tags and set the CSS style for the div to:
-webkit-transition: opacity 3s linear;
Then use Javascript to toggle the opacity of the images:
image1.style.opacity=0;
image2.style.opacity=1;

Related

How do I tell my app to rotate -90º for a specific monitor which doesn't report orientation?

I need to place some content on a TV screen. The TV is vertically placed and agnostic of it's orientation. The best way for me is to use HTML, CSS and JS for animations.
How do I tell the whole viewport should rotate -90º?
Or is this not possible using HTML?
Thanks in advance!
I've tried #media queries orientation property, but the screen is agnostic of its orientation

A-frame mobile scaling

I can't seem to figure out why the mobile view of a-frame camera aspect ratio is completely off. it's scaled so everything looks skinny in portrait mode and wide in landscape. I am also getting this error in console:
dpdb.js:79 Failed to recalculate device parameters.
I've adjusted the CSS and set the canvas width/height on a settimeout after it renders. Any way around this issue?

What is the best aproach to display images in different devices: CSS3 or jQuery resizing?

I have a webpage with different images of different proportions. I want to display in the best format for different devices: desktop, tablet, smartphone, etc.
Is it best to use CSS3 #media (mx-width: ** px ) or jQuery $( window ).resize(function() and $( document ).ready(function() { with a change in the size of the image?
The last step works very well and does not require to set a lot of different media sizes as in the case of CSS3, but if Javascript is disabled it will not work.
Basically, I want the images to be responsive, but not with re-scaling of the screen of the device, which is what I get with the Javascript code, but offering the full width of the container div when the page and images are displayed in a smartphone. I think that the approach would involve PHP code to get the Client data ( $_SERVER['USER_AGENT'] ) because don't want images to be too big to go outside the screen, and when using a smartphone I don't want the images to be too small to be seen, and here I have the problem of screen resolutio: the pixels of the image can be 1200 px, but it is shown very small because of screen pixel density or resolution.
The best approach these days is using a technique called "responsive image sizes" along with good old CSS to handle image scaling on devices with similar screen sizes.
Using 'resize' event to manipulate the DOM with jQuery is a staging way to bad performance and bad user experience.
The core idea is to load smaller images on smaller screens and down-scale them in browser if image is bigger than required, using:
img {
display: block;
/* You should never upscale raster images in browser */
max-width: 100%;
height: auto;
}
Here is a good article, that covers the concept in details: Responsive Images in Practice
I would recommend checking out lazysizes, it implements lazy-loading as a bonus.
This is how you use it in your markup:
<img
data-sizes="auto"
data-src="image2.jpg"
data-srcset="image1.jpg 300w,
image2.jpg 600w,
image3.jpg 900w" class="lazyload" />

fix for blurry images on browsers used by a mac retina

I am making a game sorta like cookie clicker, and I want the images to look 8 bit. I use a macbook pro retina, which has four pixels for every one pixel on a normal screen. On Chrome and Safari, instead of each pixel being represented by 2x2 pixels, I get a bunch of blurry blobs... I don't have this problem on FireFox. There's this one website called pixeljoint.com that is made for pixel art, and I don't have the blurry problem there. Whenever I open one of the images from PixelJoint in a new tab, the image goes back to blurry. I heard that the problem is that the images are scaled before they are displayed on chrome and safari, but I'm not too sure.
Here are two screenshots to show what I'm talking about:
I would also like to point out that the images are normal .gif files.
I am aware that you can convert a gif file to an svg with this link
and an svg file looks fine on retina.
All I want to know is how PixelJoint makes the pixels look so smooth.
I figured it out, you need to use CSS!
<style>
img {image-rendering: optimizeSpeed;image-rendering: -moz-crisp-edges;image-rendering: -webkit-optimize-contrast;image-rendering: optimize-contrast;image-rendering: pixelated; -ms-interpolation-mode: nearest-neighbor; }
</style>
I found this in the source code, so I guess this is how PixelJoint does it.

Safari Rendering image background black on load

I'm currently working on a website and having an issue with Safari. When loading an image there is a black background that is placed as a stand in. I would rather this be transparent or white, but I can't seem to figure it out. Check it out:
http://blazing-ocean-6482.herokuapp.com/
I've made html and body have background-color:white; but this doesn't seem to have changed the issue.
Just save the PNG image with interlaced option
I had the same problem in safari 6.
My image was in grayscale color space. I switched it to rgb and the problem disappeared.
Try to check your images color space settings!
This happens because the PNG has no alpha channel.
Photoshop saves the image with the alpha channel only if the image has transparent pixels.
In order to work properly in Safari, IHDR chunk of PNG image must have "truecolor-apha" in it contents.
You can see the png chunks in tweakpng (http://entropymine.com/jason/tweakpng/) or similar programs.
I've had the same issue as above (only in Safari too). My body tag has a background image, is repeat-x and is used as the background for the whole website. When a user goes to the page in Safari, there is a flash of black on page load. I've searched for ages for a solution to this, but it appears to be an unresolved bug with Safari.
I'ved tried adding "style: background-color: #FFF" to the html and body tags and also tried using the old school "bgcolor: #FFF" - none work.
The only way I could get Safari to behave was to use CSS + jQuery. Give the body a class of "bg-on" in your html and CSS files. In a linked .js file or in the of your html page in tags:
jQuery(function ($) {
$(document).ready(function(){
$('body').removeClass('bg-on');
});//end document ready
/* NOTE (window).load fires when images have been fully loaded */
$(window).load(function() {
$('body').addClass('bg-on');
});//end window load function
});//end jQuery function no conflict mode
What the above does is when the DOM is loaded by the browser, it removes the class from the body, therefore Safari won't show a black background as no background-image is there. Then when the window.load event fires, when all assets have been loaded, the body is given the background image...
It won't affect JS disabled browsers either, as the class of "bg-on" is hardcoded into the html.
Not a particularly elegant solution, but it works for me.
I had this problem recently in Safari 6.0.2, which also showed up in mobile Safari (at least in iOS 6). Saving my background as interlaced didn't work across the board & the colour space was RGB. Thankfully my background had very few colours & converting it to GIF fixed the problem entirely.
My problem was, that I have uploaded correct file, but with page builder I have edited the image - and was converted to jpg from png.
First make png with alpha and then upload - worked.

Resources