iwyg / jitimage

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

Docs #49

Open tomc3 opened 9 years ago

tomc3 commented 9 years ago

It will great if you add little docs to develop branch. I'm able to open image, but i'm not sure how to apply various operations, are does resizing still works the same as in master branch.

Thanks

iwyg commented 9 years ago

The URI schemes are basically the same, if that's what you mean. Are you using this with laravel? The sample configuration should give a glimpse

tomc3 commented 9 years ago

Yes i'm using laravel, I saw that file. But i'm not sure how to resize image with the updated version with and without recipes, if possible can you please provide a example.

Here are my steps that I follow right now now.

Now to how to resize image and get output, if possible can you please provide an example.

// What to use
Jmg::source('image.jpg') or
Jmg::make('thumb','image.jpg')
iwyg commented 9 years ago

In your template, e.g. resize:

<img src="{{ Jmg::take('image.jpg', 'images')->resize(200, 0) }}"/>

The second parameter is the path alias as defined in config.paths

You may also output an image tag instead of the source string

{!! Jmg::take('image.jpg', 'images', true, ['name' => 'image'])->resize(200, 0) !!}

will output something like:

<img src="/media/cached/68f93bf3/fs_9531c743df10eb1168f.jpg" width="200" height="100" name="image" />
tomc3 commented 9 years ago

Thanks a lot :) very clear now. Best image manipulation library ever. I can see there is also support for imagine also, but that is experimental. :)

iwyg commented 9 years ago

Yes, JitImage uses the thapp/image lib by default, but if you need more advanced stuff for custom filters, e.g. font support, you can go with Imagine, or you can just write your own adapter (e.g. for intervention/image).

garimathukral commented 9 years ago

I want to add a canvas in my project and image in that canvas will print in cmyk, is it possible with this package, if yes can u give me any suggestion and example code.