Cant get Scale_Image to work
Cant get Scale_Image to work
Any tricks to this?
BO.Picture is a Picture attribute
Tried BO.Picture=Scale_IMage(BO.Picture,50)
Also BO.Picture=Scale_Image(BO.Picture,600,600)
Get in log value not changed because it was equal to the old value Picture=null
What am I doing wrong?
Cheers ROd
BO.Picture is a Picture attribute
Tried BO.Picture=Scale_IMage(BO.Picture,50)
Also BO.Picture=Scale_Image(BO.Picture,600,600)
Get in log value not changed because it was equal to the old value Picture=null
What am I doing wrong?
Cheers ROd
I've tried to reproduce this:
My Rule:
My Rule:
- If Object.Picture IS DEFINED
Then Object.Picture=SCALE_IMAGE(Object.Picture,500,500)
- + Evaluating rule 'Picture' If Object.Picture IS DEFINED Then Object.Picture=SCALE_IMAGE(Object.Picture,500,500)
- Evaluating condition Object.Picture IS DEFINED
- Condition evaluated to true: null
- Adding action Object.Picture=SCALE_IMAGE(Object.Picture,500,500) to the agenda
+ Executing action Object.Picture=SCALE_IMAGE(Object.Picture,500,500) from rules of object Object
- * Started evaluation of rules after data has been changed by the actions
* Executing action Object.Picture=SCALE_IMAGE(Object.Picture,500,500) from rules of object Object
-
- Posts: 7567
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
-
- Posts: 7567
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
Well they did work in a sense in that it rescaled the picture. However using the height and width functions it shows me that the height and width are both now set to 2500 which is 50*50. I would have thought they should be 50?
Maybe the height and width functions also have an issue? At least I can't get the scale image to work with a percentage.
Anyway totally confused now.
Cheers Rod
Maybe the height and width functions also have an issue? At least I can't get the scale image to work with a percentage.
Anyway totally confused now.
Cheers Rod
-
- Posts: 7567
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
Actually, if the function has two parameters the second parameter indicates scale as a number between 0 and 1 (for 50% use 0.5)
If there are 3 parameters the second and third parameters are width and height of the result in pixels. The documentation of the function is misleading
If there are 3 parameters the second and third parameters are width and height of the result in pixels. The documentation of the function is misleading
Aware IM Support Team
Re: Cant get Scale_Image to work
Hi,
Just wanted to bring some of this one to the forefront again. As mentioned a few times in the past it would be good to have an image scaled before it gets uploaded especially from mobile devices. Some phones now have very hi res cameras built in and produce quite large image file size. I have users tring to upload pictures 5 or even 10mb in size. If they have a crappy cell signal it takes ages to upload or even times out!
Is there anything that can be done about this? Anyone got any ideas?
Thanks
Just wanted to bring some of this one to the forefront again. As mentioned a few times in the past it would be good to have an image scaled before it gets uploaded especially from mobile devices. Some phones now have very hi res cameras built in and produce quite large image file size. I have users tring to upload pictures 5 or even 10mb in size. If they have a crappy cell signal it takes ages to upload or even times out!
Is there anything that can be done about this? Anyone got any ideas?
Thanks
Re: Cant get Scale_Image to work
Sadly my users had to stop uploading pictures via mobile phones as it takes far too long to upload them. Until something is done as you said to resize before uploading, then I can't see how one can use this feature at all on mobile devices.
Cheers Rod
Cheers Rod
Re: Cant get Scale_Image to work
For android, you can get an 'alternate' camera app that does this scaling BEFORE the upload.
Makes it very easy to upload smaller images.
Haven't looked on Apple (which I am). A customer reported this to me.
Makes it very easy to upload smaller images.
Haven't looked on Apple (which I am). A customer reported this to me.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
Re: Cant get Scale_Image to work
I'm using in the business rules :
IF IMAGE_WIDTH (PersPeri.Foto2) <= 300 AND IMAGE_HEIGHT(PersPeri.Foto2) <= 300 THEN
END PROCESS
ELSE
IF IMAGE_WIDTH (PersPeri.Foto2) > IMAGE_HEIGHT (PersPeri.Foto2) THEN
PersPeri.Foto2 = SCALE_IMAGE(PersPeri.Foto2, 300, IMAGE_HEIGHT (PersPeri.Foto2) / IMAGE_WIDTH (PersPeri.Foto2) * 300)
ELSE
PersPeri.Foto2 = SCALE_IMAGE(PersPeri.Foto2, IMAGE_WIDTH (PersPeri.Foto2) / IMAGE_HEIGHT (PersPeri.Foto2) * 300, 300 )
Unfortunately the photo is turned 90'.
This seems to a bug in the java plugin.
So I ask the users to take a photo in landscape format. In that case it will not turn 90'.
IF IMAGE_WIDTH (PersPeri.Foto2) <= 300 AND IMAGE_HEIGHT(PersPeri.Foto2) <= 300 THEN
END PROCESS
ELSE
IF IMAGE_WIDTH (PersPeri.Foto2) > IMAGE_HEIGHT (PersPeri.Foto2) THEN
PersPeri.Foto2 = SCALE_IMAGE(PersPeri.Foto2, 300, IMAGE_HEIGHT (PersPeri.Foto2) / IMAGE_WIDTH (PersPeri.Foto2) * 300)
ELSE
PersPeri.Foto2 = SCALE_IMAGE(PersPeri.Foto2, IMAGE_WIDTH (PersPeri.Foto2) / IMAGE_HEIGHT (PersPeri.Foto2) * 300, 300 )
Unfortunately the photo is turned 90'.
This seems to a bug in the java plugin.
So I ask the users to take a photo in landscape format. In that case it will not turn 90'.
Re: Cant get Scale_Image to work
Have written lots on this subject. Several years now.
Have scaled a lot.
EXIF data.
Have always reported error was on Vlad’s side when scaling.
Have scaled a lot.
EXIF data.
Have always reported error was on Vlad’s side when scaling.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
Re: Cant get Scale_Image to work
In the meantime I developed a resize application / module (in Delphi).
It is called in rule2.
Until now it works fine, pictures are resized / scaled from 3 a 4 Mb to 15 a 20 kB.
Rule0
IF FILE_EXISTS ('c:/mytemp/' +PersPeri.ID + '.jpg') = 'Yes' THEN
DELETE FILE 'c:/mytemp/' +PersPeri.ID + '.jpg'
Rule1
IF PersPeri.Foto2 IS DEFINED THEN
EXPORT DOCUMENT PersPeri.Foto2 TO FILE 'c:/mytemp/' +PersPeri.ID + '.jpg'
Rule2
IF FILE_EXISTS ('c:/mytemp/' +PersPeri.ID + '.jpg') = 'Yes' THEN
EXECUTE PROGRAM 'resizephoto.exe c:/mytemp/' +PersPeri.ID + '.jpg'
IMPORT DOCUMENT PersPeri.Foto2 FROM 'c:/mytemp/' +PersPeri.ID + '_scaled.jpg'
It is called in rule2.
Until now it works fine, pictures are resized / scaled from 3 a 4 Mb to 15 a 20 kB.
Rule0
IF FILE_EXISTS ('c:/mytemp/' +PersPeri.ID + '.jpg') = 'Yes' THEN
DELETE FILE 'c:/mytemp/' +PersPeri.ID + '.jpg'
Rule1
IF PersPeri.Foto2 IS DEFINED THEN
EXPORT DOCUMENT PersPeri.Foto2 TO FILE 'c:/mytemp/' +PersPeri.ID + '.jpg'
Rule2
IF FILE_EXISTS ('c:/mytemp/' +PersPeri.ID + '.jpg') = 'Yes' THEN
EXECUTE PROGRAM 'resizephoto.exe c:/mytemp/' +PersPeri.ID + '.jpg'
IMPORT DOCUMENT PersPeri.Foto2 FROM 'c:/mytemp/' +PersPeri.ID + '_scaled.jpg'