iwyg / jitimage

Just In Time image manipulation (GD, Imagick, imagemagick) with integration for laravel 4
MIT License
95 stars 8 forks source link

Cache route #7

Closed amitbl closed 11 years ago

amitbl commented 11 years ago

First of all, I would like to thank you for this fine package, it's very useful for me.

When I try to change the "cache.route" value from "jit/storage" I get 404 Error. Am I missing something or this is a bug?

iwyg commented 11 years ago

Apparently that's a bug if you haven't setup your dev site to a vhost. Fix is in the making.

Thanks for reporting

iwyg commented 11 years ago

Can you try the latest commit?

amitbl commented 11 years ago

I changed the value to "thumbs". it's working now when I type: http://127.0.0.1/project/thumbs/XXXXXX/r_XXXX.jpg But, when I generate image url (JitImage:source) this is the result: http://127.0.0.1/project/thumbs/thumbs/XXXXXX/r_XXXX.jpg

As you can probably see, now it is duplicating any given value.

iwyg commented 11 years ago

can you post your config file?

amitbl commented 11 years ago

<?php

return [

/* ------------------------------------------------
 * the base route:
 * ------------------------------------------------
 */

'route'      => 'images',

/* ------------------------------------------------
 * the base directory from where to dynamically resolve
 * images
 * ------------------------------------------------
 */

'base'       => public_path(),

/* ------------------------------------------------
 * driver that powers the image manipulation:
 *
 * `gd` (the GDlibraray), `im` (the Imagemagick library),
 *  or `imagick` (this Imagick php extension).
 * ------------------------------------------------
 */

'driver'      => 'gd',

/* ------------------------------------------------
 * cache settings
 * ------------------------------------------------
 */

'cache'       => [
/* ------------------------------------------------
 * cache directory
 * ------------------------------------------------
 */
    'path'         => storage_path(),
/* ------------------------------------------------
 * base route for resolving cached images
 * ------------------------------------------------
 */
    'route'        => 'thumbs',
/* ------------------------------------------------
 * name prefix for cached images
 * ------------------------------------------------
 */
    'prefix'       => 'r',
/* ------------------------------------------------
 * cache processed images only in this environments
 * ------------------------------------------------
 */
    'environments' => ['production']
],

/* ------------------------------------------------
 * the compression quality:
 * 0 - 100
 * ------------------------------------------------
 */

'quality'     => 60,

/* ------------------------------------------------
 * imagemagick specific settings:
 * ------------------------------------------------
 */

'imagemagick' => [
    'path' => '/usr/local/bin',
    'bin'  => 'convert',
],

/* ------------------------------------------------
 * image filter:
 * ------------------------------------------------
 */

'filter' => [
    'Circle'    => 'circ',
    'GreyScale' => 'gs'
],

/* ------------------------------------------------
 * only this expression should be allowed
 *
 * allow mode 2 crop rescale, with a 200x200 px crop and a grey scale
 * filter:
 *
 *  'thumbs' => '2/200/200/5, filter:gs'
 *
 * allow mode 1 resize, with a resize of 800px width
 * greyscale filter:
 *
 *  'gallery' => '1/800/0, filter:gs',
 *
 * allow mode 4 best fit, with a resize of max 800px width
 * and 600px height, no filters:
 *
 *  'preview' => '4/800/600'
 *
 * ------------------------------------------------
 */

'recipes' => [
],

/* ------------------------------------------------
 * a list of trusted sites that deliver assets:
 *  e.g. 'http://25.media.tumblr.com'
 * ------------------------------------------------
 */
'trusted-sites' => [
],

/* ------------------------------------------------
 * `generic` or `xsend`
 * ------------------------------------------------
 */
'response-type' => 'generic'

];

iwyg commented 11 years ago

Thanks

commit a99770aac32 removes the behaviour you've described above.

amitbl commented 11 years ago

Thank you, it's working perfect now.

iwyg commented 11 years ago

Great.