Git Product home page Git Product logo

kraken-java's People

Contributors

dependabot[bot] avatar eemmiirr avatar juan-espinet-adpearance avatar karim79 avatar matylla avatar pavellishin avatar robiiinos avatar saurabh-r avatar zloesabo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

kraken-java's Issues

Resize subclasses need a uniform strategy to facilitate handling mixed collections

I have been building a batch processing queue and am forced to do some awkward workarounds when dealing with mixed types of AbstractResize.

For example if calling SquareResize and LandscapeResize, I have to resort to a switch to check strategy to set or output the width of the image, either by calling getWidth or getSize.

I have some ideas, but I wanted to open this up for discussion in case there was anything already underway on your end.

io.kraken.client.exception.KrakenIoException: Failed to unmarshall response

sometimes we get an exception from kraken 1.1.x client (1.1.1 also tested) when query with DirectFileUploadRequest:

io.kraken.client.exception.KrakenIoException: Failed to unmarshall response
Aug 17 16:28:11 backbone slika.jar[32570]:         at io.kraken.client.impl.DefaultKrakenIoClient.handleResponse(DefaultKrakenIoClient.java:197) ~[client-1.1.1.jar!/:na]
Aug 17 16:28:11 backbone slika.jar[32570]:         at io.kraken.client.impl.DefaultKrakenIoClient.directUpload(DefaultKrakenIoClient.java:165) ~[client-1.1.1.jar!/:na]
Aug 17 16:28:11 backbone slika.jar[32570]:         at io.kraken.client.impl.DefaultKrakenIoClient.directUpload(DefaultKrakenIoClient.java:133) ~[client-1.1.1.jar!/:na]

which Caused by:

Caused by: org.glassfish.jersey.message.internal.MessageBodyProviderNotFoundException: MessageBodyReader not found for media type=text/html;charset=utf-8, type=class io.kraken.client.model.response.AbstractUploadResponse, genericType=class io.kraken.client.model.response.AbstractUploadResponse.
Aug 17 16:28:11 backbone slika.jar[32570]:         at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$TerminalReaderInterceptor.aroundReadFrom(ReaderInterceptorExecutor.java:208) ~[jersey-common-2.30.1.jar!/:na]
Aug 17 16:28:11 backbone slika.jar[32570]:         at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor.proceed(ReaderInterceptorExecutor.java:132) ~[jersey-common-2.30.1.jar!/:na]
Aug 17 16:28:11 backbone slika.jar[32570]:         at org.glassfish.jersey.message.internal.MessageBodyFactory.readFrom(MessageBodyFactory.java:1072) ~[jersey-common-2.30.1.jar!/:na]
Aug 17 16:28:11 backbone slika.jar[32570]:         at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:882) ~[jersey-common-2.30.1.jar!/:na]
Aug 17 16:28:11 backbone slika.jar[32570]:         at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:816) ~[jersey-common-2.30.1.jar!/:na]
Aug 17 16:28:11 backbone slika.jar[32570]:         at org.glassfish.jersey.client.ClientResponse.readEntity(ClientResponse.java:298) ~[jersey-client-2.30.1.jar!/:na]
Aug 17 16:28:11 backbone slika.jar[32570]:         at org.glassfish.jersey.client.InboundJaxrsResponse$1.call(InboundJaxrsResponse.java:91) ~[jersey-client-2.30.1.jar!/:na]
Aug 17 16:28:11 backbone slika.jar[32570]:         at org.glassfish.jersey.internal.Errors.process(Errors.java:292) ~[jersey-common-2.30.1.jar!/:na]
Aug 17 16:28:11 backbone slika.jar[32570]:         at org.glassfish.jersey.internal.Errors.process(Errors.java:274) ~[jersey-common-2.30.1.jar!/:na]
Aug 17 16:28:11 backbone slika.jar[32570]:         at org.glassfish.jersey.internal.Errors.process(Errors.java:205) ~[jersey-common-2.30.1.jar!/:na]
Aug 17 16:28:11 backbone slika.jar[32570]:         at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:365) ~[jersey-common-2.30.1.jar!/:na]
Aug 17 16:28:11 backbone slika.jar[32570]:         at org.glassfish.jersey.client.InboundJaxrsResponse.runInScopeIfPossible(InboundJaxrsResponse.java:240) ~[jersey-client-2.30.1.jar!/:na]
Aug 17 16:28:11 backbone slika.jar[32570]:         at org.glassfish.jersey.client.InboundJaxrsResponse.readEntity(InboundJaxrsResponse.java:88) ~[jersey-client-2.30.1.jar!/:na]
Aug 17 16:28:11 backbone slika.jar[32570]:         at io.kraken.client.impl.DefaultKrakenIoClient.handleResponse(DefaultKrakenIoClient.java:186) ~[client-1.1.1.jar!/:na]
Aug 17 16:28:11 backbone slika.jar[32570]:         ... 80 common frames omitted

as i understood - there is a wrong answer from kraken endpoint, because answer with unexpected "text/html" mime type for jersey client

any ideas?

Make timeouts configurable

I appreciate your product, but when the image is big, your server or mine is slow.
Timeouts are reached.

Current timeouts are hardcoding to 3 seconds, can you make it configurable?

I'm talking about DefaultIOKrakenClient class

private Client createClient(ObjectMapper objectMapper) {
        final ClientConfig clientConfig = new ClientConfig();
        clientConfig.property(ClientProperties.FOLLOW_REDIRECTS, true);
        clientConfig.property(ClientProperties.CONNECT_TIMEOUT, 3000);
        clientConfig.property(ClientProperties.READ_TIMEOUT, 3000);
        clientConfig.property(ClientProperties.FEATURE_AUTO_DISCOVERY_DISABLE, true);

        final JacksonJsonProvider jacksonJsonProvider = new JacksonJsonProvider(objectMapper);
        final Client client = ClientBuilder.newClient(clientConfig).register(jacksonJsonProvider).register(MultiPartFeature.class);
        final Feature feature = new LoggingFeature(JERSEY_LOGGER, Level.FINE, LoggingFeature.Verbosity.PAYLOAD_ANY, null);
        client.register(feature);
        return client;
    }

Results are not posted to callback_url but kraked images are uploaded back to the specified bucket

We use callback_url approach for processing images

webClient
      .postAbs(config.getString("https://api.kraken.io/v1/url"))
      .putHeader("Content-Type", "application/json")
      .putHeader("Accept", "application/json")
      .rxSendStream(Observable.just(buffer))
      .doOnError(err -> logger.error("Error while uploading to kraken", err));

We get the success response

HTTP/1.1 200 OK

{
    "id": "18fede37617a787649c3f60b9f1f280d"
}

Looks like the submitted job is successful. We can see the kraked images in our s3 buckets. Results are not posted to the specified callback_url

There was a major outage last week as learnt from https://status.kraken.io
Your twitter handle says it's fixed but it's not working
Can you please help us out as it affecting our clients?

Need a way to call via a proxy

My planned usage will run through a proxy server, but with the implementation I don't see a way to configure a proxy for just this API call. The only alternative I see is to configure the proxy using system properties, and this has the downside of being "all or nothing"

withDev() missing from maven dependency

The version in the maven dependency is 1.0.0. with no other versions available. This is actually subtly different from the version on GitHub (1.0.1). For example, the documented withDev() method is missing from 1.0.0.

Doesn't work with Spring Boot 1.5

We're looking to use the Java API to do some very basic processing, but it doesn't seem possible to do without specifying a quality and a conversion.

imageUrlUploadCallbackUrlRequest = ImageUrlUploadCallbackUrlRequest
	.builder(new URL("http://website.com/images/image.png"), 
                     new URL("http://website.com/somecallback"))
        .build();

Throws:
quality is not of a type(s) number; convert is not of a type(s) object

Adding :

.withLossy(false)

into the builder makes no difference: it still complains that the quality is missing.

Will dig into it myself if I get a chance.

Can't upload SVG

While uploading an SVG image I'm getting an Unsupported Media Type exception

DirectUploadRequest directUploadRequest = DirectUploadRequest.builder(new ByteArrayInputStream(input)).build();

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.