Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jerrac’s picture

Is a port being worked on?

jcisio’s picture

Not yet.

jcisio’s picture

I hope I'll start working on it this weekend. FYI ImageAPI in D7 http://api.drupal.org/api/drupal/includes--image.inc/group/image/7

jerrac’s picture

Yeah, the image api in D7 is pretty good. But what I'm looking for is something like saving the image at 60% quality in jpg or png format. Which is what I think this module does... As in a really simple version of Photoshop's Save for Web options. The core api doesn't have that, just crop, resize, and that kind of thing. Which isn't quite enough.

jcisio’s picture

I didn't say that D7 had any functionality that this module provided, neither ;) That link is for changes in D7 core and ImageAPI D7 so that I can track down and port ImageAPI Optimize.

jerrac’s picture

heh, ok.

jcisio’s picture

Finally I won't have time this weekend :(

jcisio’s picture

FYI the ImageAPI module could be deprecated by #1028876: Future of ImageMagick toolkit. Of course ImageAPI D7 won't be dependant on ImageAPI D7, but only D7 core.

jerrac’s picture

Interesting. Would it be possible to rewrite this module to only depend on D7 core? I didn't see any indication that there are plans to add optimization functionality to ImageMagick or ImageCache actions. 'Course, I just may not have found the right issue yet. :D

jcisio’s picture

This module depends only on D7 core and is independant on any toolkit (GD, Imagemagick or anything else).

jerrac’s picture

ah, my bad.

threading_signals’s picture

Bump.

Wondering how the port is going.

siharris’s picture

Status: Active » Needs review
FileSize
3.33 KB

I wrote a port as I needed this for my site. Files attached.

Should this be renamed as it doesn't use ImageAPI?

jcisio’s picture

Convert it to a patch so that others can review. And a big thanks. For this moment, I'll keep the name.

Fidelix’s picture

Subscribing...

threading_signals’s picture

I enabled this module and compiled everything except for jfifremove, which "strip the optional JFIF header segment from JPEG" files. I think that one is the only one that removes metadata.

A number of questions.

1. Does any of the other tools remove metadata aside from jfifremove?
2. Once this module is enabled, does it optimize the image automatically? For example, I have a png logo that isn't optimized, and upon enabling the module and then visiting the frontpage which has the logo, that page is optimized and there is no going back? I checked and none of my pictures seems to require optimization according to pagespeed, yslow...
3. Here are the nginx folder configs for static assets (from perusio at github):

## If accessing an image generated by imagecache, serve it directly if
## available, if not relay the request to Drupal to (re)generate the
## image.
location ~* /imagecache/ {
access_log off;
expires 30d;
try_files $uri /index.php?q=$uri&$args;
}

## Drupal 7 generated image handling, i.e., imagecache in core. See:
## https://drupal.org/node/371374.
location ~* /files/styles/ {
access_log off;
expires 30d;
try_files $uri /index.php?q=$uri&$args;
}

## All static files will be served directly.
location ~* ^.+\.(?:css|js|jpg|jpeg|gif|ico|png|html|xml)$ {
access_log off;
expires 30d;
## No need to bleed constant updates. Send the all shebang in one
## fell swoop.
tcp_nodelay off;
}

I have a module called Gallery Formatter enabled (drupal.org/project/galleryformatter) which requires javascript. ImageAPI optimize seems to be based on D6 folder paths...? If I disable ImageAPI, then the pictures show up correctly. Please advise or correct the javascript or folder issues connected with this module.

Other than those three issues, I think the author's module does a great job at preparing assets for distribution by saving bandwidth, thank you.

jcisio’s picture

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

@vividgates: were you testing the patch and reporting issue in the D7 version?

As I don't have a "real" D7 site, I keep this issue open until there are a few users test and review it.

threading_signals’s picture

I'm using the d7 version of the module. I d/led the patch from #14 and got this:

patching file imageapi_optimize.info
Reversed (or previously applied) patch detected! Assume -R? [n] n
Apply anyway? [n] n
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file imageapi_optimize.info.rej
patching file imageapi_optimize.install
Reversed (or previously applied) patch detected! Assume -R? [n] n
Apply anyway? [n] n
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file imageapi_optimize.install.rej
patching file imageapi_optimize.module

After examining the patch, it appears that the d7 version from March has the patch incorporated already.

Thanks kindly for this module. Please also comment on the last three questions once you have the time, thanks again.

Sincerely,

Paul

jcisio’s picture

Status: Needs review » Fixed

Ooops, I committed that patch for easy review, and I completely forgot about it. Ok now we have a D7 version and about 20 users using it, I close this issue.

threading_signals’s picture

Ok, thanks. Disregard #1-3, it was a misconfiguration on my part and the other questions I have the answers to.

Status: Fixed » Closed (fixed)

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