Skip to content

Commit

Permalink
#1 Moves example to test
Browse files Browse the repository at this point in the history
  • Loading branch information
Oz Ramos committed May 31, 2023
1 parent 187a25a commit 6dcf543
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 12 deletions.
Binary file not shown.
13 changes: 1 addition & 12 deletions src/image/loading_displaying.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,12 @@ import '../core/friendly_errors/fes_core';
* <code>
* function setup() {
* // here we use a callback to display the image after loading
* loadImage('assets/arnott-wallace-wink-single-frame.gif', img => {
* loadImage('assets/laDefense.jpg', img => {
* image(img, 0, 0);
* });
* }
* </code>
* </div>
* <div>
* <code>
* let img;
* function setup() {
* img = loadImage('assets/arnott-wallace-eye-loop-forever.gif');
* }
* function draw() {
* image(img, 0, 0);
* }
* </code>
* </div>
*
* @alt
* image of the underside of a white umbrella and grided ceililng above
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions test/manual-test-examples/p5.Image/load-gifs.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../styles.css">
<script language="javascript" src="../../../lib/p5.js"></script>
<script language="javascript" type="text/javascript" src="./load-gifs.js"></script>
</head>
<body>
</body>
</html>
15 changes: 15 additions & 0 deletions test/manual-test-examples/p5.Image/load-gifs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// For issue https://github.com/processing/p5.js/issues/6164
p5.disableFriendlyErrors = true;

let gifStatic, gifAnimated;

function setup() {
createCanvas(200, 100);
gifStatic = loadImage('rockies.gif');
gifAnimated = loadImage('arnott-wallace-eye-loop-forever.gif');
}

function draw () {
image(gifStatic, 0, 0);
image(gifAnimated, 100, 0);
}
Binary file added test/manual-test-examples/p5.Image/rockies.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6dcf543

Please sign in to comment.