Giter Site home page Giter Site logo

imageloader's People

Contributors

keshrath avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

imageloader's Issues

Buggy saving google images to ImageList

Hello, first of all thanks for the library, saved me a lot of work.

I am having some issues getting the images from google, lots of images gives errors such as
Server returned HTTP response code: 403 for URL:
or
javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
or
Could not find a method to load https://images.unsplash.com/photo-1529157366686-70612f8b5fc5?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1000&q=80

I made a few videos of it happening because it sometimes acts different.

1
https://youtu.be/jFTqwLV3vqQ
After a few errors it looks like it freezes and cant get any further images. I show some parts of the code just to show how I initialized the library objects and how the percentage printed is being calculated -> relating the number of the list (that grows with every download or error) to the desired number of total results. When the list gets to that size it stops the loader.

https://youtu.be/4SyAPrCxzxg
By executing the same code you get different results, sometimes it stops with no error messages, sometimes it gives you a giant log of errors and stops, sometimes it finishes and go to the next function.
This time I lowered the maximum results to make it quicker.
This time it finishes loading (not common) using the library loader and when it does it calls another function to instantiate objects of a class I created and transfer the image and url to this instance. I use this test
if (img_List.getImage(i).getImg() != null)
to transfer only the ones that have an image and it works fine, but the downloading part is very glitchy, got giant error logs and nothing else prints after that (there are prints in draw which were supposed to be printing, drawing the images means it entered the draw function)

3
https://www.youtube.com/watch?v=ZuRdqC0yp9s&feature=youtu.be
On this one I am using the example from the library, and my google api. At the beggining there`s already some strange behavior by showing console messages on other sketch, from the previous try (not on video), than I get some errors when the random img from list had issues on loading

Any thoughts?
Is there any way to detect this errors faster and not add these images to the list?
The ones that download goes very fast but the errors make the procces a lot slower.

Thanks in advance.

Divide by Zero

When using the example

import at.mukprojects.imageloader.*;
import at.mukprojects.imageloader.gif.*;
import at.mukprojects.imageloader.giphy.*;

GifLoader loader;
GifList list;
PImage[] imgs;
int index;

void setup() {
  size(800, 450);
  frameRate(25);

  loader = new GiphyLoader(this, "dc6zaTOxFJmzC");
  list = loader.start("cat", false, 60 * 1000);

  index = 0;
}

void draw() {
  if (imgs == null) {
    if (list.size() > 0) {
      imgs = list.getRandom().getGifFrames();
    }
  } else {
    image(imgs[index], 0, 0, width, height);
    index++;
    if (index > imgs.length - 1) {
      index = 0;
    }
  }
}

void mousePressed() {
  imgs = list.getRandom().getGifFrames();
  index = 0;
}

You get a divide by zero error when it trys to getGifFrames()

Readme: Instagram access token generation appears to need "&scope=public"

When authenticating with Instagram via an "access token" generated as described in the Readme, I get this error on running the example program:

 INFO (InstagramLoader) - Starting Thread: Thread[InstagramTask,5,main]...
 INFO (InstagramTask) - Task is running...
ERROR (InstagramTask) - An error occured. The task will be stopped.
org.jinstagram.exceptions.InstagramBadRequestException: OAuthPermissionsException: This request requires scope=public_content, but this access token is not authorized with this scope. The user must re-authorize your application with scope=public_content to be granted this permissions.
    at org.jinstagram.entity.common.InstagramErrorResponse.throwException(InstagramErrorResponse.java:44)
    at org.jinstagram.Instagram.handleInstagramError(Instagram.java:1073)
    at org.jinstagram.Instagram.createInstagramObject(Instagram.java:1037)
    at org.jinstagram.Instagram.getRecentMediaTags(Instagram.java:831)
    at org.jinstagram.Instagram.getRecentMediaTags(Instagram.java:789)
    at at.mukprojects.imageloader.instagram.InstagramTask.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:745)
 INFO (InstagramTask) - Task has stopped.

When I re-generate my access token with "&scope=public" appended to the URL like this:
https://instagram.com/oauth/authorize/?client_id=[CLIENT_ID_HERE]&redirect_uri=http://localhost&response_type=token&scope=public
โ€ฆ the error disappears.

InstagramLoader doesn't load images

InstagramLoader isn't working for me: The resulting image list appears to be always empty. This is the code I am using (modified from the example code by adding debug printlns, excluding my access token and client id):

import at.mukprojects.imageloader.*;
import at.mukprojects.imageloader.instagram.*;
import at.mukprojects.imageloader.image.*;

// API with access token
String accessToken = /*my access token*/;

// API with client ID
String clientId = /*my client id*/;

ImageLoader loader;
ImageList list;
Image img;

void setup() {
  size(800, 450);

  // API with access token
  loader = new InstagramLoader(this, accessToken, "");

  // API with client ID
   //loader = new InstagramLoader(this, clientId);

  list = loader.start("vienna", false, 60 * 1000);
  while (list.size() == 0) {
    println("No images!");
    delay(1000);
  }
}

void draw() {
  if (img == null) {
    println("Picking random image...");
    img = list.getRandom();
    if (img != null)
      println("Image picked.");
  } else {
    image(img.getImg(), 0, 0, width, height);
  }
}

void mousePressed() {
  img = list.getRandom();
}

When I run it, it is stuck in setup(), outputting "No images!" continuously. Other than that, no error message.

(Edit: I just tested the FlickrLoader and it works, so it must really be about InstagramLoader.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.