I have already uploaded the image from a form and I can resize according a value and a level of quality. But I want to Auto resize an image according to a max size(byte). So,
IF (IMAGE_UPLOADED_SIZE > MAX_SIZE)
{
WHILE(IMAGE_UPLOADED_SIZE > MAX_SIZE)
{
// MAIN CALCULTATIONS
imagecreatetruecolor(); // CREATION NEW RESIZED IMAGE
imagecopyresampled(); // COMPOSE THE NEW IMAGE
IMAGE_UPLOADED_SIZE = getNewSize();
}
}
The loop works but it becomes wrong because I have to get the new SIZE of the new resized image generated from "imagecreatetruecolor()" that with a print_r() command return RESOURCE#[id].