Jump to content
php.lv forumi

imagecreatefromjpeg


Analgiins

Recommended Posts

vienam forumam taisu bilzhu uploadoshanas skriptu. probleemas ir ar bildeem, kuraam paplashinaajums ir .jpg Uz servera upload_max_filesize = 2M. Ja meegjinu uploadot 100 KB lielu bildi, tad viss ok, ja 200KB lielu bildi, tad skripts vienkaarshi nomirst, neizdot pat nekaadu kljuudas pazinjojumu. Vieta, kur tas notiek ir:

$image = imagecreatefromjpeg($attachment['tmp_name']);

Shitas $image (resource) man ir vajadziigs taalaak lai uztaisiitu mazo bildiiti.

Kaapeec tas imagecreatefromjpeg neizdot nekaadu kljuudu? Tjipa atminjas par maz, lai PHP uztaisiitu bildi?

GD:

Version - bundled (2.0.28 compatible)

JPG Support - enabled

Link to comment
Share on other sites

vienam forumam taisu bilzhu uploadoshanas skriptu. probleemas ir ar bildeem, kuraam paplashinaajums ir .jpg Uz servera upload_max_filesize = 2M. Ja meegjinu uploadot 100 KB lielu bildi, tad viss ok, ja 200KB lielu bildi, tad skripts vienkaarshi nomirst, neizdot pat nekaadu kljuudas pazinjojumu. Vieta, kur tas notiek ir:

$image = imagecreatefromjpeg($attachment['tmp_name']);

Shitas $image (resource) man ir vajadziigs taalaak lai uztaisiitu mazo bildiiti.

Kaapeec tas imagecreatefromjpeg neizdot nekaadu kljuudu? Tjipa atminjas par maz, lai PHP uztaisiitu bildi?

GD:

Version - bundled (2.0.28 compatible)

JPG Support - enabled

22228[/snapback]

 

Error reporting on? server prodakšen?

Link to comment
Share on other sites

error_reporting(E_ALL & ~E_NOTICE);

@set_time_limit(0);

OS Linux

PHP Version 4.3.11

 

njaa.. uzliku ini_set('display_errors', 'on'); (production serveris, taapeec arii off)

shis man izmeta

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 7168 bytes) in /bla/bla/bla on line 139

Ko lai ar shito dara, maybe adminam serverii kaut kas jaapamaina?

Link to comment
Share on other sites

error_reporting(E_ALL & ~E_NOTICE);

@set_time_limit(0);

OS Linux

PHP Version 4.3.11

 

njaa.. uzliku ini_set('display_errors', 'on'); (production serveris, taapeec arii off)

shis man izmeta

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 7168 bytes) in /bla/bla/bla on line 139

Ko lai ar shito dara, maybe adminam serverii kaut kas jaapamaina?

22254[/snapback]

Neskaties uz fizisko izmēru imagecreatefromjpg veidojot attelu pateeree atminjas daudzumu, kas vienaads ar - platums x augstums x dziljums.

Piemēram ja bilde ir 1024x768 ar dziljumu 24, tad tiks izmantoti 18874368 bytes.

 

A mok bitos? kaut kā tur bija biti vai baiti....

btw, manuprāt kaut kur tepat foruma kaadreiz tika runāts par to jau...

Link to comment
Share on other sites

×
×
  • Create New...