Is there any way to reduce the size of a jpg image by...

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

Is there any way to reduce the size of a jpg image by...

Postby Edmilson Bringel » Thu Jan 28, 2010 4:21 pm

Hi everybody,

I am looking for a way to reduce an image size in JPG format ... (I know how to load an image from filesystem and how to get/set the image bytearray and other attributes from image object but I don't know how to manipulate its final size to get/rewrite a new reduced file - I would like to reduce jpeg files from 64K (or any size) to a new file with 18K size)...
I was thinking if the CgJPEGFileFormat or its superclass implements any method to do that (maybe compress:yComp:cbComp:crComp or somethink like that... but I did not found information about that)...

Any tip will be very appreciated.

Thanks

Edmilson Bringel
Edmilson Bringel
Apprise Consulting - Brazil
Edmilson Bringel
 
Posts: 6
Joined: Sat Nov 24, 2007 8:26 am
Location: Brazil

Re: Is there any way to reduce the size of a jpg image by...

Postby Edmilson Bringel » Thu Jan 28, 2010 4:24 pm

Sorry,

I mean: I did not "find" any information about that method.

Thanks again!

Edi
Edmilson Bringel
Apprise Consulting - Brazil
Edmilson Bringel
 
Posts: 6
Joined: Sat Nov 24, 2007 8:26 am
Location: Brazil

Re: Is there any way to reduce the size of a jpg image by...

Postby PhotonDemon » Fri Jan 29, 2010 7:19 am

Hi Edmilson,

I has been a long time since I played with graphic images but hopefully this will point you in the right direction.

#CgDeviceIndependentImage>scaledTo: will return a new image scaled to the given extent.

I think if you use something like (CgJPEGFileFormat new) loadFromFile: picturePath, you will get a #CgDeviceIndependentImage that you can scale.

Lou
Louis LaBrunda
Keystone Software Corp.
SkypeMe callto://PhotonDemon
mailto:Lou@Keystone-Software.com http://www.Keystone-Software.com
PhotonDemon
[|]
 
Posts: 176
Joined: Thu Dec 20, 2007 1:45 pm


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest