Jump to content
php.lv forumi

Jpeg image thumbnails


Robis

Recommended Posts

Izdariiju kaa tu teici!

Uz 700Kb bildi vinjsh raadiija to pashu iepriekshmineeto erroru, tachu pameegjinot uz 253Kb bildi, vinjsh izmeta shaadu erroru:

 

<br />

<b>Warning</b>: imagejpeg(): Unable to open '/home/virtual/site/var/www/html/pictures/thumbs/pic_11.jpg' for writing in <b>/home/virtual/site/var/www/html/pictures/pict_thumb.php</b> on line <b>44</b><br />

Mazās bildes saglabāšanas problēmas

 

Esmu neizpratnee! ???

Link to comment
Share on other sites

Uzliku rakstiishanas tiesiibas Apache, palaidu skriptu, norisinaajas Successful, bet bilde no 253Kb paarveertaas uz 13Kb un kvalitaate vienkaarshi drausmiiga, lai gan pie imagejpeg() ir uzlikta kvalitaate uz 100%. Vispaar kraasas gandriiz zudushas...

Link to comment
Share on other sites

  • 7 months later...

man ir tieshi taapati probleema ar imagecreatfromjpeg un memory erroru,

php.ini ir uzlikts:

memory_limit = 15M ; Maximum amount of memory a script may consume (15MB)

 

tad es testa peec izveidoju failinju kur ir tikai sekojoshas rindinjas:

$img=$PTH.'test.jpg';
$image = imagecreatefromjpeg($img);

 

test.jpg aiznjem ~3 MB

 

palaizham scriptu un sanjemam:

 

Fatal error: Allowed memory size of 15728640 bytes exhausted (tried to allocate 12140 bytes) in test_image_resize.php on line 12 (rindinja kuraa tiek izmantots imagecreatefromjpeg())

 

secinoshi: nav nekaadu ciklu, liidz imagedestroy nemaz netiekam, jo Fatal error nokillo scriptu, vai kaads var izstaastiit kadelj 3MB failu verot ar imagecreatejpeg(), rada vairaak kaa 15 MB memory vietu???

 

no ideas

Link to comment
Share on other sites

2 orion - tas pats errors pie lielaka attela - kaa jau mineeju scripts ir pareizs, un nav starpiiba ir cikls vai nav, bet tikko ir imagecreatefromXXX (jpeg, png, pat imagecreatfromstring() meeginaaju, tam nav starpiibas), pie 1,5 MB vel viss ir ok.

 

risinaajumi:

1) vai nu tas memory_limit jaaliek lielaaks par 16 M, ko ne iipashi gribes dariit admins

2) visdrizak tiks uzlikts un izmantots: http://www.imagemagick.org/ <b>convert</b> pasakums, kas itkaa pat kvalitaates zinjaa ieliek imagecreatefromjpeg un ari performances zinjaa sevi jau ir pieradijis

Link to comment
Share on other sites

×
×
  • Create New...