我真的不明白爲什麼GD具有裝載圖像,就像不同的功能:爲什麼有imageCreateFrom *如果有imageCreateFromString?
imagecreatefromjpeg()
imagecreatefrompng()
imagecreatefromgif()
雖然是一個單一的功能,如果圖像是字符串?
imagecreatefromstring()
事實上這是更好的讀取圖像到字符串,並將其傳遞給函數,是這樣的:
$imgBlob = file_get_contents($imagePath);
imagecreatefromstring($imageBlob);
unset($imgBlob); //> Free memory, but I am not interested in memory consumpation
?或者我錯過了什麼?這可能導致潛在的混亂爲新用戶
也許他們只是忘記了創建一個功能imageCreateFromFile()
?
Ps。我當然使用file_get_contents
方法
嗯。公平的問題。這是PHP的核心庫亞.... –
因爲PHP的生活目標是臃腫充滿無用的東西,你可以輕鬆地做一個額外的線。 –