A
A
Artyom Innokentiev2015-09-27 19:19:48
Django
Artyom Innokentiev, 2015-09-27 19:19:48

What are sessions used for in Django?

What are sessions used for in Django?
PS If it's not difficult, please, a detailed answer or a link to a good answer.

Answer the question

In order to leave comments, you need to log in

14 answer(s)
S
Sergey, 2015-09-27
Protko @Fesor

to store state between requests on the server.

@
@sledopit, 2011-07-07
_

If in linux'e/*bsd, then you can use the imagemagick package. You get something along the lines of:
for IMAGE in *jpg ; do convert $IMAGE -resize 100x100 ${IMAGE/.jpg/}_small.jpg ; done

S
s0rr0w, 2011-07-07
@s0rr0w

If the process does not need to be automated, you can try the free Faststone image viewer
www.faststone.org/

K
Kindman, 2011-07-07
@Kindman

It is possible like this:

<?php
function image_resize($src, $dst, $width, $height, $crop=0)
    {
    if(!list($w, $h) = getimagesize($src))
      return false;// "Unsupported picture type!";
    $type = strtolower(substr(strrchr($src,"."),1));
    if($type == 'jpeg') $type = 'jpg';
  switch($type)
  {
  case 'bmp': $img = imagecreatefromwbmp($src); break;
  case 'gif': $img = imagecreatefromgif($src); break;
  case 'jpg': $img = imagecreatefromjpeg($src); break;
  case 'png': $img = imagecreatefrompng($src); break;
  default : return false; // "Unsupported picture type!"
  }
    // resize
    if($crop)
      {
      if($w < $width or $h < $height)
        return false; // "Picture is too small!"
      $ratio = max($width/$w, $height/$h);
      $h = $height / $ratio;
      $x = ($w - $width / $ratio) / 2;
      $w = $width / $ratio;
      } else {
      if($w < $width and $h < $height)
        return false // "Picture is too small!"
      $ratio = min($width/$w, $height/$h);
      $width = $w * $ratio;
      $height = $h * $ratio;
      $x = 0;
      }
    $new = imagecreatetruecolor($width, $height);
    // preserve transparency
    if($type == "gif" or $type == "png")
      {
      imagecolortransparent($new,
       imagecolorallocatealpha($new, 0, 0, 0, 127));
      imagealphablending($new, false);
      imagesavealpha($new, true);
      }
    imagecopyresampled($new, $img, 0, 0, $x, 0, $width, $height, $w, $h);
  switch($type)
  {
  case 'bmp': imagewbmp($new, $dst); break;
  case 'gif': imagegif($new, $dst); break;
  case 'jpg': imagejpeg($new, $dst); break;
  case 'png': imagepng($new, $dst); break;
  }
    return true;
    }

T
TheAlien, 2011-07-07
@TheAlien

If Windows:
I use XnView. There is also batch processing with a bunch of settings.

T
Taxup, 2011-07-08
@Taxup

no heavyweights needed. under Windows there is an excellent Resize Pictures utility from Microsoft itself. Embedded in the context menu.

A
antivir, 2011-07-07
@antivir

If you need for Windows, then there are a lot of programs:
Free
- PIXresizer
Paid -
Light Image Resizer
Batch Image Resizer
Picture Resize Genius

R
ryzhyy, 2011-07-07
@ryzhyy

I can recommend a good program for Macintosh. It's called Resize. One negative, since OS X Lion (10.7) it is not supported.
How to use:
1. Open the program;
2. Select a folder with pictures;
3. Set the resolution;
4. Start the process and wait for the result.
You can also use online services, or native iPhoto. But for mass resizing, I still advise you to use the Resize program.

A
ArtemSmirnov, 2011-07-07
@ArtemSmirnov

habrahabr.ru/blogs/webdev/99108/

H
hybridcattt, 2011-07-07
@hybridcattt

habrahabr.ru/blogs/linux/82394/

K
Konstantin Frolov, 2011-07-07
@nitro80

ACDSee can

P
Puma Thailand, 2011-07-07
@opium

irfan view can resize by a bunch of parameters, + watermarks and a million other goodies, the function is called batch.

D
Denis, 2011-07-12
@newpdv

Try the free IrfanView.
There is a special tool with quite flexible settings for both resizing and renaming.
image
If that File -> Batch Conversion/Rename

S
Stadinov Denis, 2013-12-26
@StaDi

Photoshop has a similar tool.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question