Mercurial > hg > fapweb
comparison faptool.php @ 1120:b2bca5f6d0ff default tip
Cosmetic cleanup: remove trailing whitespace.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 13 Dec 2020 13:47:13 +0200 |
parents | 0a2117349f46 |
children |
comparison
equal
deleted
inserted
replaced
1119:a4daa7ea7479 | 1120:b2bca5f6d0ff |
---|---|
68 return FALSE; | 68 return FALSE; |
69 } | 69 } |
70 | 70 |
71 if ($outDim !== FALSE) | 71 if ($outDim !== FALSE) |
72 { | 72 { |
73 // Get dimensions, setup background | 73 // Get dimensions, setup background |
74 $dim = $img->getImageGeometry(); | 74 $dim = $img->getImageGeometry(); |
75 // $img->setBackgroundColor(imagick::COLOR_BLACK); | 75 // $img->setBackgroundColor(imagick::COLOR_BLACK); |
76 $img->setGravity(imagick::GRAVITY_CENTER); | 76 $img->setGravity(imagick::GRAVITY_CENTER); |
77 | 77 |
78 // Act based on image size vs. desired size and $thumb mode | 78 // Act based on image size vs. desired size and $thumb mode |
170 $res = wtRenderSample($inFilename, $outFilename); | 170 $res = wtRenderSample($inFilename, $outFilename); |
171 else | 171 else |
172 $res = wtConvertSample($inFilename, $outFilename, | 172 $res = wtConvertSample($inFilename, $outFilename, |
173 array("-f" => "wav")); | 173 array("-f" => "wav")); |
174 break; | 174 break; |
175 | 175 |
176 case EFILE_IMAGE: | 176 case EFILE_IMAGE: |
177 $res = wtConvertImage( | 177 $res = wtConvertImage( |
178 $inFilename, | 178 $inFilename, |
179 $outFilename, | 179 $outFilename, |
180 FALSE, "PNG", 9, | 180 FALSE, "PNG", 9, |
339 if ($edata["class"] == $compo["preview_type"]) | 339 if ($edata["class"] == $compo["preview_type"]) |
340 { | 340 { |
341 // Single file | 341 // Single file |
342 $found = wtEntryToSource($compo, $filename, $edata, $filename, $pdata, $outFilename, $force); | 342 $found = wtEntryToSource($compo, $filename, $edata, $filename, $pdata, $outFilename, $force); |
343 } | 343 } |
344 | 344 |
345 if (!$found) | 345 if (!$found) |
346 { | 346 { |
347 echo "WARNING: Could not generate preview from entry ".wtNiceName($compo, $entry, $efile)."\n"; | 347 echo "WARNING: Could not generate preview from entry ".wtNiceName($compo, $entry, $efile)."\n"; |
348 return FALSE; | 348 return FALSE; |
349 } | 349 } |
367 } | 367 } |
368 } | 368 } |
369 if ($valid) | 369 if ($valid) |
370 return TRUE; | 370 return TRUE; |
371 } | 371 } |
372 | 372 |
373 // | 373 // |
374 // Either we now have a "user specified" source file or | 374 // Either we now have a "user specified" source file or |
375 // a generated source file - in any case, now convert it | 375 // a generated source file - in any case, now convert it |
376 // to the final form(s). | 376 // to the final form(s). |
377 // | 377 // |
888 } | 888 } |
889 echo "\n"; | 889 echo "\n"; |
890 wtPrintDivider(); | 890 wtPrintDivider(); |
891 } | 891 } |
892 break; | 892 break; |
893 | 893 |
894 case "cra": | 894 case "cra": |
895 echo "Not implemented. :D\n"; | 895 echo "Not implemented. :D\n"; |
896 break; | 896 break; |
897 | 897 |
898 default: | 898 default: |
899 die("ERROR! Invalid entry sub-command '".stCArg(2)."'.\n"); | 899 die("ERROR! Invalid entry sub-command '".stCArg(2)."'.\n"); |
900 break; | 900 break; |
901 } | 901 } |
902 break; | 902 break; |
942 | 942 |
943 if (!file_exists($setPrefix) || is_dir($setPrefix)) | 943 if (!file_exists($setPrefix) || is_dir($setPrefix)) |
944 { | 944 { |
945 // Create new one | 945 // Create new one |
946 wtMakeDir($setPrefix, 0755); | 946 wtMakeDir($setPrefix, 0755); |
947 | 947 |
948 // Create results.txt if it does not exist | 948 // Create results.txt if it does not exist |
949 $resultsFile = stMakePath(FALSE, TRUE, array($setPrefix, "results.txt")); | 949 $resultsFile = stMakePath(FALSE, TRUE, array($setPrefix, "results.txt")); |
950 if (!file_exists($resultsFile)) | 950 if (!file_exists($resultsFile)) |
951 { | 951 { |
952 // Use a header file if it exists | 952 // Use a header file if it exists |
962 file_put_contents( | 962 file_put_contents( |
963 $resultsFile, | 963 $resultsFile, |
964 $resultsText.stGetCompoResultsASCIIStr(FALSE, 0) | 964 $resultsText.stGetCompoResultsASCIIStr(FALSE, 0) |
965 ); | 965 ); |
966 } | 966 } |
967 | 967 |
968 foreach (stExecSQL("SELECT * FROM compos WHERE cpath <> '' AND cpath IS NOT NULL") as $compo) | 968 foreach (stExecSQL("SELECT * FROM compos WHERE cpath <> '' AND cpath IS NOT NULL") as $compo) |
969 foreach (stExecSQL("SELECT * FROM entries WHERE compo_id=".$compo["id"]) as $entry) | 969 foreach (stExecSQL("SELECT * FROM entries WHERE compo_id=".$compo["id"]) as $entry) |
970 { | 970 { |
971 wtUnpackEntry($compo, $entry, $setPrefix, TRUE, FALSE, TRUE); | 971 wtUnpackEntry($compo, $entry, $setPrefix, TRUE, FALSE, TRUE); |
972 } | 972 } |
1043 break; | 1043 break; |
1044 } | 1044 } |
1045 | 1045 |
1046 /* Dummy | 1046 /* Dummy |
1047 { | 1047 { |
1048 | 1048 |
1049 } | 1049 } |
1050 */ | 1050 */ |
1051 ?> | 1051 ?> |