Commit 4847c0dcd578feda9dbc7e7f32985868ff883843
1 parent
42c5064b
Exists in
master
and in
7 other branches
Crítica do IMAGEPATH qd uma imagem é gerada
Showing
16 changed files
with
37 additions
and
0 deletions
Show diff stats
admin/admin.db
No preview for this file type
classesphp/classe_escala.php
... | ... | @@ -104,6 +104,8 @@ string com variáveis javascript. |
104 | 104 | function retornaBarraEscala() |
105 | 105 | { |
106 | 106 | $objImagem = $this->mapa->drawscalebar(); |
107 | + if($objImagem->imagepath == "") | |
108 | + {echo "Erro IMAGEPATH vazio";exit;} | |
107 | 109 | $nomer = ($objImagem->imagepath)."sca".$this->nomeImagem.".png"; |
108 | 110 | $objImagem->saveImage($nomer); |
109 | 111 | $nomer = ($objImagem->imageurl).basename($nomer); | ... | ... |
classesphp/classe_legenda.php
... | ... | @@ -277,6 +277,8 @@ string de variaveis no formato javascript que permitem montar a legenda. |
277 | 277 | } |
278 | 278 | $nomeImagem = nomeRandomico(); |
279 | 279 | $imgo = $this->mapa->drawlegend(); |
280 | + if($imgo->imagepath == "") | |
281 | + {echo "Erro IMAGEPATH vazio";exit;} | |
280 | 282 | $nomer = ($imgo->imagepath)."leg".$nomeImagem.".png"; |
281 | 283 | $imgo->saveImage($nomer); |
282 | 284 | $nomer = ($imgo->imageurl).basename($nomer); | ... | ... |
classesphp/mapa_googleearth.php
... | ... | @@ -212,6 +212,8 @@ function retornaWms($map_fileX,$postgis_mapa){ |
212 | 212 | |
213 | 213 | if(isset($_GET["TIPOIMAGEM"]) && trim($_GET["TIPOIMAGEM"]) != "" && trim($_GET["TIPOIMAGEM"]) != "nenhum") |
214 | 214 | { |
215 | + if($img->imagepath == "") | |
216 | + {echo "Erro IMAGEPATH vazio";exit;} | |
215 | 217 | $nomer = ($img->imagepath)."filtroimgtemp".nomeRandomico(); |
216 | 218 | $img->saveImage($nomer); |
217 | 219 | filtraImagem($nomer,$_GET["TIPOIMAGEM"]); |
... | ... | @@ -224,6 +226,8 @@ function retornaWms($map_fileX,$postgis_mapa){ |
224 | 226 | } |
225 | 227 | else{ |
226 | 228 | ob_clean(); |
229 | + if($img->imagepath == "") | |
230 | + {echo "Erro IMAGEPATH vazio";exit;} | |
227 | 231 | $nomer = ($img->imagepath)."imgtemp".nomeRandomico(); |
228 | 232 | $img->saveImage($nomer); |
229 | 233 | $img = imagecreatefrompng($nomer); | ... | ... |
classesphp/mapa_googlemaps.php
... | ... | @@ -252,6 +252,8 @@ if (!function_exists('imagepng')) |
252 | 252 | } |
253 | 253 | if(trim($_GET["TIPOIMAGEM"]) != "" && trim($_GET["TIPOIMAGEM"]) != "nenhum") |
254 | 254 | { |
255 | + if($img->imagepath == "") | |
256 | + {echo "Erro IMAGEPATH vazio";exit;} | |
255 | 257 | $nomer = ($img->imagepath)."filtroimgtemp".nomeRand().".png"; |
256 | 258 | $img->saveImage($nomer); |
257 | 259 | filtraImg($nomer,trim($_GET["TIPOIMAGEM"])); |
... | ... | @@ -266,6 +268,8 @@ else{ |
266 | 268 | if($cache == true) |
267 | 269 | {$nomer = salvaCacheImagem($_GET["BBOX"],$nomecache,$map_fileX,$_GET["WIDTH"],$_GET["HEIGHT"]);} |
268 | 270 | else{ |
271 | + if($img->imagepath == "") | |
272 | + {echo "Erro IMAGEPATH vazio";exit;} | |
269 | 273 | $nomer = ($img->imagepath)."imgtemp".nomeRand().".png"; |
270 | 274 | $img->saveImage($nomer); |
271 | 275 | } | ... | ... |
classesphp/mapa_inicia.php
... | ... | @@ -245,6 +245,8 @@ function iniciaMapa() |
245 | 245 | $m->salva(); |
246 | 246 | |
247 | 247 | $nomes = nomeRandomico(12); |
248 | + if($imgo->imagepath == "") | |
249 | + {echo "Erro IMAGEPATH vazio";exit;} | |
248 | 250 | $nomer = ($imgo->imagepath)."mapa".$nomes.".png"; |
249 | 251 | $imgo->saveImage($nomer); |
250 | 252 | if (isset($utilizacgi) && strtolower($utilizacgi) == "sim") | ... | ... |
classesphp/mapa_openlayers.php
... | ... | @@ -243,6 +243,8 @@ if (!function_exists('imagepng')) |
243 | 243 | } |
244 | 244 | if(trim($_GET["TIPOIMAGEM"]) != "" && trim($_GET["TIPOIMAGEM"]) != "nenhum") |
245 | 245 | { |
246 | + if($img->imagepath == "") | |
247 | + {echo "Erro IMAGEPATH vazio";exit;} | |
246 | 248 | $nomer = ($img->imagepath)."filtroimgtemp".nomeRand().".png"; |
247 | 249 | $img->saveImage($nomer); |
248 | 250 | filtraImg($nomer,$_GET["TIPOIMAGEM"]); |
... | ... | @@ -258,6 +260,8 @@ else{ |
258 | 260 | if($cache == true) |
259 | 261 | {$nomer = salvaCacheImagem($_GET["BBOX"],$nomecache,$map_fileX,$_GET["WIDTH"],$_GET["HEIGHT"]);} |
260 | 262 | else{ |
263 | + if($img->imagepath == "") | |
264 | + {echo "Erro IMAGEPATH vazio";exit;} | |
261 | 265 | $nomer = ($img->imagepath)."imgtemp".nomeRand().".png"; |
262 | 266 | $img->saveImage($nomer); |
263 | 267 | } | ... | ... |
ferramentas/3d/3d.php
... | ... | @@ -60,6 +60,8 @@ if ($mapa->width > 500) |
60 | 60 | $of = $mapa->outputformat; |
61 | 61 | $of->set("imagemode",MS_IMAGEMODE_RGB); |
62 | 62 | $imgo = $mapa->draw(); |
63 | +if($imgo->imagepath == "") | |
64 | +{echo "Erro IMAGEPATH vazio";exit;} | |
63 | 65 | $nome = ($imgo->imagepath).nomeRandomico().".png"; |
64 | 66 | $nomefinal = ($imgo->imagepath).nomeRandomico().".wrl"; |
65 | 67 | $imgo->saveImage($nome); | ... | ... |
ferramentas/imprimir/a4lpaisagempdf.php
... | ... | @@ -92,6 +92,8 @@ if($mapexten != ""){ |
92 | 92 | $o->set("imagemode",MS_IMAGEMODE_RGB); |
93 | 93 | $o->set("transparent","false"); |
94 | 94 | $imgo = $map->draw(); |
95 | +if($imgo->imagepath == "") | |
96 | +{echo "Erro IMAGEPATH vazio";exit;} | |
95 | 97 | $nomer = ($imgo->imagepath)."mapa".$nomes.".png"; |
96 | 98 | $imgo->saveImage($nomer); |
97 | 99 | $protocolo = explode("/",$_SERVER['SERVER_PROTOCOL']); | ... | ... |
ferramentas/imprimir/aggpng.php
... | ... | @@ -39,6 +39,7 @@ foreach(array_keys($_SESSION) as $k) |
39 | 39 | { |
40 | 40 | eval("\$".$k."='".$_SESSION[$k]."';"); |
41 | 41 | } |
42 | + | |
42 | 43 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
43 | 44 | // |
44 | 45 | //se as extensões já estiverem carregadas no PHP, vc pode comentar essa linha para que o processamento fique mais rápido |
... | ... | @@ -114,6 +115,8 @@ $o->set("imagemode",MS_IMAGEMODE_RGB); |
114 | 115 | $protocolo = explode("/",$_SERVER['SERVER_PROTOCOL']); |
115 | 116 | //mapa |
116 | 117 | $imgo = $map->draw(); |
118 | +if($imgo->imagepath == "") | |
119 | +{echo "Erro IMAGEPATH vazio";exit;} | |
117 | 120 | $nomer = ($imgo->imagepath)."mapa".$nomes.".png"; |
118 | 121 | $imgo->saveImage($nomer); |
119 | 122 | $nomemapa = strtolower($protocolo[0])."://".$_SERVER['HTTP_HOST'].($imgo->imageurl).basename($nomer); | ... | ... |
ferramentas/imprimir/geotif.php
... | ... | @@ -115,6 +115,8 @@ $o->set("imagemode",MS_IMAGEMODE_RGB); |
115 | 115 | $protocolo = explode("/",$_SERVER['SERVER_PROTOCOL']); |
116 | 116 | //mapa |
117 | 117 | $imgo = $map->draw(); |
118 | +if($imgo->imagepath == "") | |
119 | +{echo "Erro IMAGEPATH vazio";exit;} | |
118 | 120 | $nomer = ($imgo->imagepath)."mapa".$nomes.".tif"; |
119 | 121 | $imgo->saveImage($nomer); |
120 | 122 | $nomemapa = strtolower($protocolo[0])."://".$_SERVER['HTTP_HOST'].($imgo->imageurl).basename($nomer); | ... | ... |
ferramentas/imprimir/geraimagens.php
... | ... | @@ -63,6 +63,8 @@ if($interface == "openlayers"){ |
63 | 63 | } |
64 | 64 | |
65 | 65 | $imgo = $map->draw(); |
66 | +if($imgo->imagepath == "") | |
67 | +{echo "Erro IMAGEPATH vazio";exit;} | |
66 | 68 | $nomer = ($imgo->imagepath)."mapa".$nomes.".png"; |
67 | 69 | $imgo->saveImage($nomer); |
68 | 70 | $protocolo = explode("/",$_SERVER['SERVER_PROTOCOL']); | ... | ... |
ferramentas/imprimir/svg.php
... | ... | @@ -128,6 +128,8 @@ $map->selectOutputFormat("svg"); |
128 | 128 | $protocolo = explode("/",$_SERVER['SERVER_PROTOCOL']); |
129 | 129 | //mapa |
130 | 130 | $imgo = $map->draw(); |
131 | +if($imgo->imagepath == "") | |
132 | +{echo "Erro IMAGEPATH vazio";exit;} | |
131 | 133 | $nomer = ($imgo->imagepath)."mapa".$nomes.".svg"; |
132 | 134 | $imgo->saveImage($nomer); |
133 | 135 | $nomemapa = strtolower($protocolo[0])."://".$_SERVER['HTTP_HOST'].($imgo->imageurl).basename($nomer); | ... | ... |
ferramentas/imprimir/swf.php
... | ... | @@ -70,6 +70,8 @@ $of->set("imagemode","PC256"); |
70 | 70 | $of->setoption("OUTPUT_MOVIE","SINGLE"); |
71 | 71 | |
72 | 72 | $imgo = $map->draw(); |
73 | +if($imgo->imagepath == "") | |
74 | +{echo "Erro IMAGEPATH vazio";exit;} | |
73 | 75 | $nomer = ($imgo->imagepath)."mapa".$nomes.".swf"; |
74 | 76 | $imgo->saveImage($nomer); |
75 | 77 | $protocolo = explode("/",$_SERVER['SERVER_PROTOCOL']); | ... | ... |
geraminiatura.php
... | ... | @@ -182,6 +182,8 @@ function verificaMiniatura($map,$tipo,$admin=false) |
182 | 182 | } |
183 | 183 | if($tipo=="mini" || $tipo == "todos") |
184 | 184 | { |
185 | + if($objImagemM->imagepath == "") | |
186 | + {echo "Erro IMAGEPATH vazio";exit;} | |
185 | 187 | $nomecM = ($objImagemM->imagepath).$map.".mini.png"; |
186 | 188 | $objImagemM->saveImage($nomecM); |
187 | 189 | } | ... | ... |
testamapfile.php
... | ... | @@ -261,6 +261,8 @@ function verifica($map,$solegenda) |
261 | 261 | } |
262 | 262 | return; |
263 | 263 | } |
264 | + if($objImagem->imagepath == "") | |
265 | + {echo "Erro IMAGEPATH vazio";} | |
264 | 266 | $nomec = ($objImagem->imagepath).nomeRandomico()."teste.png"; |
265 | 267 | $objImagem->saveImage($nomec); |
266 | 268 | $nomer = ($objImagem->imageurl).basename($nomec); | ... | ... |