The Smush.it service is no longer available at smush.it.

It has been moved to http://imgopt.com/

And it seems like the API has changed too - e.g. it takes an 'img' parameter now.

The module throws errors on save now as it cannot find the service.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pixelsweatshop’s picture

Priority: Normal » Critical

Yup, this makes this module unusable (well for smush.it imgopt anyways). Updating status to reflect that.

charlyie’s picture

We launched this tool (resmush.it) to replace the Yahoo's implementation. It has exactly the same features and works great with ImageAPI Optimize :)

Plits’s picture

Attached a patch for using the resmush.it service with ImageAPI Optimize.
Hope it helps :)

rj’s picture

Works for me. Attached is a patch with an update hook to change the imagecache_optimize_service variable to 'resmushit' if it is currently set to smushit.

anthonylindsay’s picture

Fantastic! I'll try resmushit later on today and report back.

anthonylindsay’s picture

Whilst the patch in #3 applied cleanly, I can't get it to work. As far as I can see the CURL request to the resmushit service fails because Drupal throws this error:

Notice: Trying to get property of non-object in imageapi_optimize_services_resmushit() (line 43 of /modules/contrib-patch/imageapi_optimize/services/resmushit.inc).

A couple of DPM calls reveals that the error is thrown because there is no JSON object because no $data is returned from the CURL call.

Does anyone else get similar results? Or am I doing something odd?

PhoenixAvenger’s picture

The patch in #3 worked for me.

khayong’s picture

Note that the resmush url should be 'http://www.resmush.it/ws.php' instead of 'http://www.resmushit.com/ws.php'. The wrong url cause no JSON object returned.

handrus’s picture

Just re-roling patch number #4 with the correct URL

Plits’s picture

Oh my bad, thanks handrus, i pushed the wrong patch here !

jsdix’s picture

My from #9 works, but with PHP 5.5 fails with changes in PHP 5.5 (see https://www.drupal.org/node/2333345). I've adjusted #9 to account for those changes.
See below #12

jsdix’s picture

krueschi’s picture

The patch from #12 works like a charm for me.
Thanks!
-- php 5.6.10 --

Should we update the issue to "Needs review"?

charlyie’s picture

Works for me too. Yes, it should be updated to "Needs review" :)

krueschi’s picture

Status: Active » Needs review
handrus’s picture

Status: Needs review » Reviewed & tested by the community

I've made various tests with all image formats supported.
I'm going to have patch #12 applied on a production website.

jcisio’s picture

Status: Reviewed & tested by the community » Needs work

It basically work. But we need some fixes to meet the coding standard.

  1. +++ b/imageapi_optimize.install
    @@ -37,3 +37,14 @@ function imageapi_optimize_update_7000() {
    +  drupal_flush_all_caches();
    

    Why do we need this?

  2. +++ b/services/resmushit.inc
    @@ -0,0 +1,58 @@
    +  if (!function_exists('json_decode')) {
    +    drupal_set_message(t('Required function, json_decode(), is not available.'), 'error');
    +    return FALSE;
    +  }
    

    There will be ton of messages for the wrong target (end user). hook_requirements would be better.

joelpittet’s picture

That function_exists message isn't necessary at all because this is for D7 and that function was available in > 5.2.0

Drupal 7: PHP 5.2.5 or higher (5.4 or higher recommended).

@see https://www.drupal.org/requirements/
@see https://secure.php.net/json_decode

jcisio’s picture

It is compiled into PHP by default but could be turned off. Moreover, distros like Debian remove it from the bundle (because of license issue) and require to install php5-json package.

joelpittet’s picture

Version: 7.x-1.2 » 7.x-1.x-dev

could be turned off.

Kidding me right? I have 50 uses in the contrib modules I'm using. This is the only module that does an exist check on it. (over 350 contrib modules).

Drupal core even uses it as it's wrapped drupal_json_decode() function.

Should we have to bloat our modules just for all the edge cases?

Sorry for coming off angry but there has got to be some reasonable expectations on your servers?

anthonylindsay’s picture

Status: Needs work » Reviewed & tested by the community

Patch at #12 works.

funana’s picture

#12 works perfectly. Thank you!

pixelsweatshop’s picture

#12 Works. Is it possible to roll a new release now, jcisio?

BigBrother2010’s picture

I managed to apply #12 and have no errors now.
Might be stupid question but how can i be sure its working ? I am looking for files in all directories and can only find original images i uploaded, no idea where are optimized stored.

I read on smush.it that it wont handle files larger then 2mb, so what happens in this case ? Does the module swtich to something else (internal) to process the image ?

ptmkenny’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
3.63 KB

New patch that makes the changes requested by the maintainer in #17 and also removes the smush.it service file because it no longer works, so there's no point in having it as an option.

alexloganlee’s picture

Is everyone here using 7.x-1.x-dev together with ImageMagick 7.x-1.x-dev? I can't seem to get it to work. My image styles are appearing as broken images.

rbomhof’s picture

I was able to apply #25 and can confirm it works after I update my database, though when I inspected the json response after uploading my images i see percent = 0, which means I'm not getting any savings. I'm using it with ImageMagick 7.x-1.0. Curious if anyone else is having the same problem.

edit: should have added that i do see a savings when using GD, though it is only at 2%.

rootwork’s picture

Status: Needs review » Reviewed & tested by the community

Yep -- #25 works!

  • jcisio committed 234f208 on 7.x-1.x authored by ptmkenny
    Issue #2458453 by handrus, Plits, jsdix, rj, ptmkenny: Smush.it service...
jcisio’s picture

Status: Reviewed & tested by the community » Fixed

Thanks. Committed and pushed #25.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

sic’s picture

The url has changed to api.resmush.it

giupenni’s picture

As sic said, the url has changed to api.resmushit.it
http://resmush.it/api#compression

rootwork’s picture

Commenting on a closed issue isn't likely to be seen.

If it's directly related to the original issue (i.e. if the patch caused a regression or other error) you should re-open the issue by marking it as active when you make your comment.

In this case, although it's obviously related, this is a new issue (reSmush.it changed its address after this patch went in) and so I've opened a new issue:

#2717517: Update reSmush.it endpoint

Should be a pretty easy patch if anyone wants to take it.