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

Notification

Icon
Error

Options
Go to last post Go to first unread
KKopf  
#1 Posted : Friday, September 14, 2012 10:43:40 PM(UTC)
KKopf

Rank: Member

Groups: Member
Joined: 4/18/2011(UTC)
Posts: 15

my old topic:
http://forums.aurigma.co...after-Upload-------.aspx

my code for the FLASH Uploader:

Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
var width = [];
var height = [];
 
function ImageUploaderFlash1_BeforeUpload(){
  var uploader = $au.ImageUploaderFlash('Uploader1');
  var files = uploader.files();
  var count = files.count();
  for (i = 0; i < count; i++){
    height.push(files.get(i).height());
    width.push(files.get(i).width());
  }
}
 
function ImageUploaderFlash1_BeforePackageUpload(){
  if (height[0] > width[0]){
    $au.ImageUploaderFlash('Uploader1').converters([
	{mode: '*.*=SourceFile'},
	{mode: '*.*=Thumbnail', thumbnailFitMode: 'Width', thumbnailHeight: 200, thumbnailWidth: 200},
	{mode: '*.*=Thumbnail', thumbnailFitMode: 'Width', thumbnailHeight: 50, thumbnailWidth: 50}
	]);
  }
  if (width[0] > height[0] ){
    $au.ImageUploaderFlash('Uploader1').converters([
	{mode: '*.*=SourceFile'},
	{mode: '*.*=Thumbnail', thumbnailFitMode: 'Height', thumbnailHeight: 200, thumbnailWidth: 200},
	{mode: '*.*=Thumbnail', thumbnailFitMode: 'Height', thumbnailHeight: 50, thumbnailWidth: 50}
	]);
  }
  height.shift();
  width.shift();
}
</script>
    <?php

	  require_once 'Profil/Fotos/Uploader2/Scripte/ImageUploaderFlash.class.php';
      ImageUploaderFlash::renderCssRules();
    ?>
</head>
<body>
<?php 

	
        // create ImageUploaderFlash object and specify its ID and size
        $uploader = new ImageUploaderFlash("Uploader1");
        $uploader->setHeight('700px');
        $uploader->setWidth('900px');
        $uploader->setLicenseKey("76FF4-00483-54094-48E44-8E4CC-2FA27F");
		$uploader->setLanguage('de');


        $uploader->setEnableDescriptionEditor(TRUE);
        $uploader->setEnableRotation(TRUE);
		$uploader->getUploadPane()->setViewMode("Tiles");
		
		$uploader->getUploadSettings()->setActionUrl('Profil/Fotos/Uploader/upload.php');
		$uploader->getClientEvents()->setBeforeUpload("ImageUploaderFlash1_BeforeUpload");
		$uploader->getClientEvents()->setBeforePackageUpload("ImageUploaderFlash1_BeforePackageUpload");



		$uploader->getRestrictions()->setFileMask("[['Images (*.jpg;*.jpeg;*.png;*.gif;*.bmp)', '*.jpg;*.jpeg;*.png;*.gif;*.bmp']]");                                   
		$uploader->getMetadata()->setExif('ExifGpsLatitude;ExifGpsLongitude;ExifGpsLatitudeRef;ExifGpsLongitudeRef');		
		
		
		
		          /* Configure converters */
                  $converter1 = new Converter();
                  $converter1->setMode('*.*=SourceFile');
				  
				  $converter2 = new Converter();                  
				  $converter2->setMode('*.*=Thumbnail');                  
				  $converter2->setThumbnailWidth(200);                  
				  $converter2->setThumbnailHeight(200);
				  
                  
                  $converter3 = new Converter();
                  $converter3->setMode('*.*=Thumbnail');
                  $converter3->setThumbnailWidth(60);
                  $converter3->setThumbnailHeight(60);
                  
                  $uploader->setConverters(array(
                    $converter1,
                    $converter2,
                    $converter3
                  ));
        
        // render ImageUploaderFlash
        $uploader->render();
		

?>
</body>
</html>


the script will not the image resize (the smallest size of picture must be 200px), why?
Dmitry.Obukhov  
#2 Posted : Monday, September 17, 2012 1:22:38 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups: Member
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hello Mario,

This code is working for Java/ActiveX uploader only. Please use this code for HTML5/Flash Uploader:
Code:

function ImageUploaderFlash1_BeforePackageUpload(){
  var uploader = $au.ImageUploaderFlash('Uploader1');
  var files = uploader.files();
  var count = files.count();
  var height = files.get(0).height();
  var width = files.get(0).width();
   if (height > width){
    $au.ImageUploaderFlash('Uploader1').converters([
    {mode: '*.*=SourceFile'},
    {mode: '*.*=Thumbnail', thumbnailFitMode: 'Width', thumbnailHeight: 200, thumbnailWidth: 200},
    {mode: '*.*=Thumbnail', thumbnailFitMode: 'Width', thumbnailHeight: 50, thumbnailWidth: 50}
    ]);
  }
  if (width > height){
    $au.ImageUploaderFlash('Uploader1').converters([
    {mode: '*.*=SourceFile'},
    {mode: '*.*=Thumbnail', thumbnailFitMode: 'Height', thumbnailHeight: 200, thumbnailWidth: 200},
    {mode: '*.*=Thumbnail', thumbnailFitMode: 'Height', thumbnailHeight: 50, thumbnailWidth: 50}
    ]);
  }
}

Edited by user Monday, September 17, 2012 1:24:18 AM(UTC)  | Reason: Not specified

Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
KKopf  
#3 Posted : Monday, September 17, 2012 8:17:24 AM(UTC)
KKopf

Rank: Member

Groups: Member
Joined: 4/18/2011(UTC)
Posts: 15

hmm your script not work.

my thumbnail is still by 200x112.

the demo image must have a size 356x200 (i have this upload with your java program -> this is the correct size for this demo image -> thumbnail).

hmm a idea?

my complete code:

Code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/html">
<head>
<script type="text/javascript">

var width = [];
var height = [];

function ImageUploaderFlash1_BeforePackageUpload(){
  var uploader = $au.ImageUploaderFlash('Uploader1');
  var files = uploader.files();
  var count = files.count();
  var height = files.get(0).height();
  var width = files.get(0).width();
  
   if (height > width){
    $au.ImageUploaderFlash('Uploader1').converters([
    {mode: '*.*=SourceFile'},
    {mode: '*.*=Thumbnail', thumbnailFitMode: 'Width', thumbnailHeight: 200, thumbnailWidth: 200},
    {mode: '*.*=Thumbnail', thumbnailFitMode: 'Width', thumbnailHeight: 50, thumbnailWidth: 50}
    ]);
  }
  if (width > height){
    $au.ImageUploaderFlash('Uploader1').converters([
    {mode: '*.*=SourceFile'},
    {mode: '*.*=Thumbnail', thumbnailFitMode: 'Height', thumbnailHeight: 200, thumbnailWidth: 200},
    {mode: '*.*=Thumbnail', thumbnailFitMode: 'Height', thumbnailHeight: 50, thumbnailWidth: 50}
    ]);
  }
}
</script>

<?php
$RootV = $Root.'Profil/Fotos/Uploader2/Scripte/';
require_once $RootV.'ImageUploaderFlash.class.php';
ImageUploaderFlash::renderCssRules();
?>

</head>
<body>
<?php 

        // create ImageUploaderFlash object and specify its ID and size
        $uploader = new ImageUploaderFlash("Uploader1");
        $uploader->setHeight('700px');
        $uploader->setWidth('900px');
        $uploader->setLicenseKey("76FF4-00483-54094-48E44-8E4CC-2FA27F");
		$uploader->setLanguage('de');


        $uploader->setEnableDescriptionEditor(TRUE);
        $uploader->setEnableRotation(TRUE);
		$uploader->getUploadPane()->setViewMode("Tiles");
		
		$uploader->getUploadSettings()->setActionUrl('Profil/Fotos/Uploader/upload.php');

		$uploader->getClientEvents()->setBeforePackageUpload("ImageUploaderFlash1_BeforePackageUpload");

		$uploader->getRestrictions()->setFileMask("[['Images (*.jpg;*.jpeg;*.png;*.gif;*.bmp)', '*.jpg;*.jpeg;*.png;*.gif;*.bmp']]");                                   
		$uploader->getMetadata()->setExif('ExifGpsLatitude;ExifGpsLongitude;ExifGpsLatitudeRef;ExifGpsLongitudeRef');		
		
		
		
		          /* Configure converters */
                  $converter1 = new Converter();
                  $converter1->setMode('*.*=SourceFile');
				  
				  $converter2 = new Converter();                  
				  $converter2->setMode('*.*=Thumbnail');                  
				  $converter2->setThumbnailWidth(200);                  
				  $converter2->setThumbnailHeight(200);
				  
                  
                  $converter3 = new Converter();
                  $converter3->setMode('*.*=Thumbnail');
                  $converter3->setThumbnailWidth(60);
                  $converter3->setThumbnailHeight(60);
                  
                  $uploader->setConverters(array(
                    $converter1,
                    $converter2,
                    $converter3
                  ));
        
        // render ImageUploaderFlash
        $uploader->render();
		
?>
</body>
</html>



and a other problem:

the Localization (language) ind IE9 correct (in german) and in Firefox 15.01 english AND german

and the design is different -> IE9 vs. FF 15.01

why? (language and design)

Edited by user Monday, September 17, 2012 8:32:29 AM(UTC)  | Reason: Not specified

KKopf attached the following image(s):
IE9.jpg
FF15.01.jpg
Dmitry.Obukhov  
#4 Posted : Tuesday, September 18, 2012 9:09:39 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups: Member
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hello,

As for setting converters at runtime for Flash Uploader. I have discussed this issue with our developer team. Unfortunately, this is not possible for Flash Uploader. I am sorry for the misunderstanding. You can set converters in BeforePackageUpload for Java/ActiveX uploader only.

Quote:

the Localization (language) ind IE9 correct (in german) and in Firefox 15.01 english AND german

and the design is different -> IE9 vs. FF 15.01

why? (language and design)

Design is different because HTML5 uploader is loaded in Firefox, but Flash Uploader is loaded in IE9. I assume you need to get same user interface of the control. In this case, please set type property to "flash":
Code:

$uploader->setType("flash"); 

Edited by user Tuesday, September 18, 2012 9:10:18 PM(UTC)  | Reason: Not specified

Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
KKopf  
#5 Posted : Tuesday, September 18, 2012 9:33:12 PM(UTC)
KKopf

Rank: Member

Groups: Member
Joined: 4/18/2011(UTC)
Posts: 15

hmm and a NEW Fit mode for this problem?

you have almost all variants with FitMode for thumbs, this problem is the one was missing.

hmm this is a big problem, this is a important function was i need.

ahhh design problem is solved, thanks.

Edited by user Tuesday, September 18, 2012 9:39:26 PM(UTC)  | Reason: Not specified

Dmitry.Obukhov  
#6 Posted : Tuesday, September 18, 2012 11:08:51 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups: Member
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Unfortunately it is not possible. Converter cannot be set in the BeforePackageUpload event.
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
Users browsing this topic
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.