diff --git a/COPYRIGHT b/COPYRIGHT
index f78dfe178841cc3523d314850f1236cdf9ad55f2..60242009dad3543e55a41a53239b65d19a7990aa 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -20,6 +20,7 @@ FPDI              1.2.1    Apache Software License 2.0 No GPL3 only     PDF temp
 FPDI_Protection   1.0.2    Apache Software License 2.0 No GPL3 only     PDF encryption (8 files)
 GeoIP             x.x                                  Yes              GeoIP Maxmind conversion
 iWebkit			  4.6.2	   LGPL 3.0					   Yes				Iphone templates framework
+JCrop			  0.9.8	   MIT Licence				   Yes				JS library to crop images
 MagPieRss         0.72     GPL 2.0                     Yes              Load RSS
 NuSoap            0.7.3    LGPL 2.1                    Yes              Interfaces with third tools
 OdtPHP            1.0.1    GPL 2.0                     Yes              Mibrary to build/edit ODT files
@@ -44,6 +45,7 @@ Copyright (C) 2010
 - Regis Houssin <regis@dolibarr.fr>
 - simnandez
 - r2gnl
+- meos
 
 Copyright (C) 2009
 - Laurent Destailleur <eldy@users.sourceforge.net>
diff --git a/htdocs/lib/images.lib.php b/htdocs/lib/images.lib.php
index b85854b0fd447e900aaa334322f2139c48b601c2..1c494ed37ddf55d982e72cce55e8297a33322867 100644
--- a/htdocs/lib/images.lib.php
+++ b/htdocs/lib/images.lib.php
@@ -97,7 +97,6 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName='_small', $
 
 	$fichier = realpath($file); 	// Chemin canonique absolu de l'image
 	$dir = dirname($file); 			// Chemin du dossier contenant l'image
-	$dirthumb = $dir.($outdir?'/'.$outdir:''); 	// Chemin du dossier contenant les vignettes
 
 	$infoImg = getimagesize($fichier); // Recuperation des infos de l'image
 	$imgWidth = $infoImg[0]; // Largeur de l'image
@@ -140,6 +139,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName='_small', $
 	}
 
 	// On cree le repertoire contenant les vignettes
+	$dirthumb = $dir.($outdir?'/'.$outdir:''); 	// Chemin du dossier contenant les vignettes
 	create_exdir($dirthumb);
 
 	// Initialisation des variables selon l'extension de l'image