.JPG Image not working

Recommended Posts



I am working in one of the HTML5 app and trying to learn PIXI.js. While using .JPG Image every things works fine but not shown in the state. The same code shows other images in other format like .jpeg and .png

Is there any thing i have to do to render the image



Here is the code.

'use strict';/// <reference path="../typings/tsd.d.ts" />/*global $, PPT, Circle, Cross, CircleCross*/(function() {		let Container = PIXI.Container,    autoDetectRenderer = PIXI.autoDetectRenderer,    loader = PIXI.loader,    resources = PIXI.loader.resources,    Sprite = PIXI.Sprite;		let currentImageIndex = 0;		let renderer = autoDetectRenderer(938, 800);  let stage = new Container();		renderer.render(stage);	document.getElementById('workspace-holder').appendChild(renderer.view);	let runApp = () => {			renderer.render(stage);			requestAnimationFrame(runApp);	}	  let setup = () => {		let img = new Sprite(resources["assets/images/6.JPG"].texture);		img.x = 0;		img.y = 0;		stage.addChild(img);		renderer.render(stage);		runApp();		  };  let handleImageLoadingProgress = (loader, resources) => {		// handle resources progress here  }  $(function() {    		loader      .add("assets/images/6.JPG")      .on('progress', handleImageLoadingProgress)      .load(setup);  })}()); 
Madhu Rakhal Magar

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.