If I look at
ImageIOImageProcessorjnilib.m what it does is takes the greater between the
resize height and the resize width and makes that the max pixel size. So, I'd
like to change it that if the height is greater then it will take the original
image's size and then calculate what the max width should be.
i.e.
if (! maxPixelSizeByWidth) {
originalImage = CGImageSourceCreateThumbnailAtIndex(source, 0,
(CFDictionaryRef)thumbnailOpts);
NSInteger oWidth = CGImageGetWidth(originalImage);
NSInteger oHeight = CGImageGetHeight(originalImage);
maxPixelSize = (oWidth * maxPixelSize) / oHeight;
}
but I'm struggling on build it >:(
I tried renaming the file but when I do that ERAttachment just ignores the
native way and defaults back to Java.
Best,
Johnny
On Oct 29, 2010, at 2:19 PM, Mike Schrag wrote:
> i seem to recall it tries to fit he image into a 90x90 square? it's a bit of
> a blur
>
> On Oct 29, 2010, at 5:09 PM, Johnny Miller wrote:
>
>> Hi,
>>
>> I'm using ERAttachment + JNI and I want an image upload to be auto scaled so
>> that it's max height is X. The width is not a concern.
>>
>> So I set the following in my properties file (per
>> http://webobjects.mdimension.com/hudson/job/Wonder53/javadoc/er/attachment/package-summary.html)
>>
>> er.attachment.MyEntity.MyAttachmentRelationship.height=90
>>
>> But when the image is scaled it sets the width to 90 and the height to
>> something less. Is there a configuration that I'm missing? i.e.
>>
>> er.attachment.MyEntity.MyAttachmentRelationship.width=auto
>>
>>
>> TIA,
>>
>> Johnny Miller
>> Kahalawai Media Corp
>> http://www.kahalawai.com
>>
>>
>>
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list ([email protected])
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/webobjects-dev/mschrag%40pobox.com
>>
>> This email sent to [email protected]
>
Johnny Miller
Kahalawai Media Corp
http://www.kahalawai.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]