Yes, both do.

JCrop has an aspectRatio option. You specify a decimal, or a ratio (16 / 9
for wide, or 1.0 for square). See

http://deepliquid.com/content/Jcrop_Manual.html#Setting_Options

jQuery UI Resizables has a similar option (same key - aspectRatio). If
specified as a boolean/true it will maintain the original aspect ratio. Or
you can specify it as a number. Also if the aspectRatio option is not set,
you can hold the shift-key down while resizing and a square ratio will be
enforced. See

http://docs.jquery.com/UI/Resizables/resizable#options (click on the options
tab)

- Richard

On Wed, Sep 17, 2008 at 3:27 PM, Sam Sherlock <[EMAIL PROTECTED]>wrote:

> Please forgive me if this has been raised before (I may have missed it)
> but do either of these plugins have a "contrained aspect ratio" feature
>
> 2008/9/17 Richard D. Worth <[EMAIL PROTECTED]>
>
>
>> On Wed, Sep 17, 2008 at 10:37 AM, Kelly <[EMAIL PROTECTED]> wrote:
>>
>>>
>>> Thanks Richard W. And thanks to everyone who has commented.
>>> I am glad that most of the issues raised have been purely
>>> philosophical. :)
>>>
>>> Jose, please use whatever plugin you feel is best suited for you
>>> needs.
>>> The whole purpose of a plugin is you don't need to worry about what's
>>> inside.
>>> If you have a conviction that you want to use jQuery UI somewhere,
>>> please do.
>>
>>
>> Both good points.
>>
>>
>>>
>>> I've seen that jQuery UI-based cropping demo and frankly it's broken.
>>> I don't think that's jQuery UI's fault, but it does not make a very
>>> compelling demo.
>>> Nor does the demo include documentation, downloads, or anything else I
>>> can see.
>>
>>
>> Agreed. Though I didn't author that demo, I've been meaning to fix it up
>> for some time. Seeing what you've done has re-inspired me.
>>
>>
>>>
>>> Surely jQuery UI could have been used, but I was not/am not familiar
>>> enough with it.
>>> Therefore, I cannot comment if it would actually benefit more than my
>>> coding time.
>>> I also wanted to minimize the codebase and dependencies.
>>>
>>> I do plan to experiment with the UI libraries. If they prove
>>> beneficial, a future release may use it.
>>> Or, I may incorporate some of UI's optimizations in my own code, if
>>> applicable.
>>
>>
>> Either way, :-)
>>
>>
>>>
>>> As with the naming (e.g. Jcrop vs. jCrop), these are issues I
>>> considered a lot.
>>> It's very possible that I made some wrong choices.
>>>
>>> This is the first time I've ever seen lack of a dependency as a
>>> detriment to someone.
>>
>>
>> If someone is already using jQuery UI it's a bit reversed, as the
>> duplication/dependence on additional code would be coming from your plugin,
>> not the other way around. Of course it goes further than just code size. Not
>> to say there's no place for Jcrop. There will always be a place for
>> stand-alone plugins. But jQuery UI could really benefit from having
>> available such a stellar image crop plugin as well.
>>
>> I'll take a crack at merging some bits of what you've done with what
>> jQuery UI has. We'll see where it lands us. As I said, I'd been meaning to
>> do something like this anyway, and you've done a lot of really great and
>> hard work. So, thanks :)
>>
>> - Richard
>>
>>
>

Reply via email to