Forums

Welcome Guest Search | Active Topics | Members

REQ: Optimized upload based on max. pixels Options
nl2dav
Posted: Wednesday, May 28, 2008 6:38:35 AM
Rank: Newbie
Groups: Member

Joined: 5/27/2008
Posts: 4
Points: 12
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
Eugene Kosmin
Posted: Thursday, May 29, 2008 1:28:13 AM
Rank: Advanced Member
Groups: Member

Joined: 9/19/2006
Posts: 351
Points: 174
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.

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.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Yet Another Forum.net version 1.9.1.6 running under Cuyahoga.
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.