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 : Tuesday, September 11, 2012 8:51:34 AM(UTC)
KKopf

Rank: Member

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

hi!

...

$converter2->setThumbnailWidth(200);

$converter2->setThumbnailHeight(200);

...

after the upload is the biggest site from a picture 200px big -> height x width (133x200)!

i need the narrowest site with 200px (example: 200x2xx).

is this possible?

(the profilpictures are quadrangle -> example 100x100 or 200x200 (for photoalbum)).

at the moment must i stretch the picture from 133x200 of 200 x 2xx and the picture is characterized blurred.

Dmitry.Obukhov  
#2 Posted : Tuesday, September 11, 2012 7:21:00 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

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

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

To achieve your need you should set ThumbnailFitMode to Height:

Code:
$converter->setThumbnailFitMode("Height");
Best regards,

Dmitry Obukhov

Technical Support. Aurigma, Inc.

KKopf  
#3 Posted : Tuesday, September 11, 2012 7:54:05 PM(UTC)
KKopf

Rank: Member

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

hmm this function is not dynamic? my user load pictures with

133x200 (height>width)

OR

200x133(width>height)

(2 format variations).

from this pictures must the smalest site 200px be large.

the test with 200x133 is ok (after the upload 300x200) by the picture mit 133x200.

Dmitry.Obukhov  
#4 Posted : Wednesday, September 12, 2012 1:13:01 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

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

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Could you please show me on an example (screenshot) what you need to get?
Best regards,

Dmitry Obukhov

Technical Support. Aurigma, Inc.

KKopf  
#5 Posted : Wednesday, September 12, 2012 2:10:48 AM(UTC)
KKopf

Rank: Member

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

hi!

i see you have not a function (in documentation) for my problem:

Fit, height, width, ActualSize

i need a "height" and "width" combination

if(picturewidth > pictureheight)

{

**i need setThumbnailFitMode with "height"

}

if(picturewidth < pictureheight)

{

**i need setThumbnailFitMode with "width"

}

if(picturewidth == pictureheight)

{

**i need setThumbnailFitMode with "fit" btw. standardmode

}

that's not what I need.

i'm not home, (i work).

i can not write so $converter->setThumbnailFitMode("Height","Width");

(height OR width)

here the demo picture:

Edited by user Wednesday, September 12, 2012 8:02:08 PM(UTC)  | Reason: Not specified

KKopf attached the following image(s):
resource2.jpg
Dmitry.Obukhov  
#6 Posted : Wednesday, September 12, 2012 8:24:55 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

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

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

It seems we do not understand each other. Therefore, I will describe three case with resolutions:

Case#1 (see Case#1.PNG)

You need to create thumbnails:

  1. 133x200 px for portrait (vertical) images;

  2. 200x133 px for landscape (horizontal) images.

Resolution

Set ThumbnailFitMode to Fit:

Code:
$converter2->setThumbnailFitMode("Fit");

Case#2 (see Case#2.PNG)

You need to create thumbnail so that smallest side of image will be 200 px after upload.

Resolution

  1. Set FilesPerPackage property to 1:

    Code:
    $uploader->getUploadSettings()->setFilesPerPackage(1);

  2. Set up BeforeUpload and BeforePackageUpload events:

    Code:
    
    ...
    $uploader->getClientEvents()->setBeforeUpload("BeforeUpload");
    $uploader->getClientEvents()->setBeforePackageUpload("BeforePackageUpload");
    ...
    

  3. Then implement the handlers of these event. Here are code snippets of the handlers:

    Code:
    
    <script type="text/javascript">
    var width = [];
    var height = [];
    
    function BeforeUpload(){
      var uploader = $au.uploader('Uploader ID');
      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 BeforePackageUpload(){
      if (height[0] > width[0]){
        $au.uploader('UploaderId').converters([{ mode: '*.*=Thumbnail', thumbnailFitMode: 'Width', thumbnailHeight: 200, thumbnailWidth: 200}]);
      }
      if (width[0] > height[0] ){
        $au.uploader('UploaderId').converters([{ mode: '*.*=Thumbnail', thumbnailFitMode: 'Height', thumbnailHeight: 200, thumbnailWidth: 200}]);
      }
      height.shift();
      width.shift();
    }
    </script>
    

Case#3 (see Case#3.PNG)

You need to upload small images and increase their size as it shown in Case#3.PNG.

Unfortunately it is not possible.

Please feel free to let me know if you have any questions.

Edited by user Wednesday, September 12, 2012 9:06:36 PM(UTC)  | Reason: Not specified

Dmitry.Obukhov attached the following image(s):
Case#1.png
Case#2.png
Case#3.png
Best regards,

Dmitry Obukhov

Technical Support. Aurigma, Inc.

KKopf  
#7 Posted : Wednesday, September 12, 2012 9:10:24 PM(UTC)
KKopf

Rank: Member

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

hi the green picture is the correct example.

the example 2 is the point.

"You need to create thumbnail so that smallest side of image will be 200 px after upload."

the script must detection the picture:

vertical

OR

vertical

the datas with 133x200 oder 200x133 is only a example.

the users have different size's

i see in the online docu the mode:

OrientationalFit -> take the maximum size of a picture (i need the minimum site (green example (case 2)) of a picture ).

Edited by user Wednesday, September 12, 2012 9:35:42 PM(UTC)  | Reason: Not specified

Dmitry.Obukhov  
#8 Posted : Wednesday, September 12, 2012 9:14:19 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

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

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Okay :) I am glad that we figured out. So, please try the example code I provided and let me know about your result.
Best regards,

Dmitry Obukhov

Technical Support. Aurigma, Inc.

KKopf  
#9 Posted : Wednesday, September 12, 2012 9:43:55 PM(UTC)
KKopf

Rank: Member

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

problem solved, thanks!

Code:

<script type="text/javascript">
var width = [];
var height = [];
 
function BeforeUpload(){
  var uploader = $au.uploader('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 BeforePackageUpload(){
  if (height[0] > width[0]){
    $au.uploader('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.uploader('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>

better for the future, you programming a new thumbnailFitMode for this problem. is easier for us users.

Edited by user Wednesday, September 12, 2012 10:23:52 PM(UTC)  | Reason: Not specified

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.