Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
nl2dav  
#1 Posted : Tuesday, May 27, 2008 10:38:35 PM(UTC)
nl2dav

Rank: Newbie

Groups: Member
Joined: 5/26/2008(UTC)
Posts: 4

Is it possible to dynamically adjust the width and height per image at the moment?

I'm afraid not...

Is it possible to build this in a new version? Its really simple code (thanks to netPBM);

$scale = sqrt( $max_amount_pixels / ( $width_old * $height_old ));

$width_new = $width_old * $scale;

$height_new = $height_old * $scale;

I need it because my images have various width and heights in different scales (panorama's).

* Ah! I submitted this as a request feature Dancing

Edited by user Tuesday, May 27, 2008 10:47:15 PM(UTC)  | Reason: Not specified

Eugene Kosmin  
#2 Posted : Wednesday, May 28, 2008 5:28:13 PM(UTC)
Eugene Kosmin

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 9/19/2006(UTC)
Posts: 505

Was thanked: 41 time(s) in 41 post(s)
Hello,

Do you need to set thumbnail size for each image individually, right? If so, you can do it with PackageBeforeUpload event and FilesPerOnePackageCount property.

Let’s assume that we need thumbnail size equal to half of the original image. We can get it in such way:

Code:
<script language="javascript">
    function ImageUploader_PackageBeforeUpload(PackageIndex)
    {
        var imageUploader = getImageUploader("ImageUploader");
        var imageHeight = imageUploader.getUploadFileHeight(1);
        var imageWidth = imageUploader.getUploadFileWidth(1);

        if (imageHeight > 0 && imageWidth > 0)
        {
            imageUploader.setUploadThumbnail1Width(imageWidth/2);
            imageUploader.setUploadThumbnail1Height(imageHeight/2);            
        }
    }


    var iu = new ImageUploaderWriter("ImageUploader", 800, 400);

    iu.javaAppletCodeBase = "../";
    iu.javaAppletJarFileName="ImageUploader5.jar";

    iu.addParam("Action", "ExtractFiles.aspx");

    iu.addParam("ShowDebugWindow", "true");
    iu.addParam("FilesPerOnePackageCount", "1");

    // Initial thumbnail params
    iu.addParam("UploadThumbnail1FitMode","Fit"); 
    iu.addParam("UploadThumbnail1Width","100"); 
    iu.addParam("UploadThumbnail1Height","100"); 
    iu.addParam("UploadThumbnail1ResizeQuality", "Medium"); 
    iu.addParam("UploadThumbnail1JpegQuality","100");

    iu.addEventListener("PackageBeforeUpload", "ImageUploader_PackageBeforeUpload");

    iu.writeHtml();
</script>
Best regards,

Eugene Kosmin

The Aurigma Development Team

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.