Compare commits
2 Commits
feb69966d6
...
0e64245e90
Author | SHA1 | Date | |
---|---|---|---|
0e64245e90 | |||
5b49a8b6e4 |
|
@ -83,13 +83,14 @@ foreach ( $entries as $entry ) {
|
|||
}
|
||||
}
|
||||
|
||||
// Sort folders based on current sort order
|
||||
if ( $_SESSION["sortorder"] == SORTBYNAME ) {
|
||||
usort($folders, "compareNames");
|
||||
usort($issues, "compareNames");
|
||||
} else {
|
||||
usort($folders, "compareDates");
|
||||
usort($issues, "compareDates");
|
||||
}
|
||||
// Always sort issues by name
|
||||
usort($issues, "compareNames");
|
||||
|
||||
$data["compath"] = $compath;
|
||||
$data["contents"] = array_merge($folders, $issues);
|
||||
|
|
|
@ -44,8 +44,9 @@ if ( $ext == "cbz" ) {
|
|||
$opened = $zip->open($comicfull);
|
||||
for ( $i=0; $i<$zip->numFiles; $i++ ) {
|
||||
$imgname = basename($zip->getNameIndex($i));
|
||||
$myext = substr($imgname, -3);
|
||||
if ( ($myext == "jpg") || ($myext == "png") ) {
|
||||
//$myext = substr($imgname, -3);
|
||||
$myext = strtolower(pathinfo($imgname)['extension']);
|
||||
if ( ($myext == "jpg") || ($myext == "png") || ($myext == "webp") ) {
|
||||
$imgname = str_replace("#", "", $imgname);
|
||||
$imgcontents = $zip->getFromIndex($i);
|
||||
$written = file_put_contents($comicoutputfull . $imgname, $imgcontents);
|
||||
|
@ -58,8 +59,9 @@ if ( $ext == "cbz" ) {
|
|||
while ( false !== ($file = readdir($fh)) ) {
|
||||
$myfile = $comicoutputfull . $file;
|
||||
$mynewfile = $comicoutputfull . str_replace("#", "", $file);
|
||||
$myext = strtolower(substr($file, -3));
|
||||
if ( ($myext == "jpg") || ($myext == "png") ) {
|
||||
//$myext = strtolower(substr($file, -3));
|
||||
$myext = strtolower(pathinfo($imgname)['extension']);
|
||||
if ( ($myext == "jpg") || ($myext == "png") || ($myext == "webp") ) {
|
||||
rename($myfile, $mynewfile);
|
||||
$files[] = basename($mynewfile);
|
||||
}
|
||||
|
|
|
@ -45,9 +45,11 @@ function makeThumb($item = "") {
|
|||
$imgdata = null;
|
||||
for ( $i=0; $i<$zip->numFiles; $i++ ) {
|
||||
$imgname = basename($zip->getNameIndex($i));
|
||||
$imgext = strtolower(pathinfo($imgname)['extension']);
|
||||
if ( (strcmp($lowest, $imgname) > 0)
|
||||
&& ((strcasecmp(substr($imgname, -3), "jpg") == 0)
|
||||
|| (strcasecmp(substr($imgname, -3), "png") == 0)) ) {
|
||||
&& ((strcasecmp($imgext, "jpg") == 0)
|
||||
|| (strcasecmp($imgext, "png") == 0)
|
||||
|| (strcasecmp($imgext, "webp") == 0)) ) {
|
||||
$lowest = $imgname;
|
||||
$imgdata = $zip->getFromIndex($i);
|
||||
}
|
||||
|
@ -63,11 +65,12 @@ function makeThumb($item = "") {
|
|||
$lowest = "~";
|
||||
foreach ( $entries as $entry ) {
|
||||
$imgname = $entry->getName();
|
||||
$imgext = strtolower(pathinfo($imgname)['extension']);
|
||||
if ( (strcmp($lowest, $imgname) > 0)
|
||||
&& ((strcasecmp(substr($imgname, -3), "jpg") == 0)
|
||||
|| (strcasecmp(substr($imgname, -3), "png") == 0)) ) {
|
||||
&& ((strcasecmp($imgext, "jpg") == 0)
|
||||
|| (strcasecmp($imgext, "png") == 0)
|
||||
|| (strcasecmp($imgext, "webp") == 0)) ) {
|
||||
$lowest = $imgname;
|
||||
$ext = strtolower(substr($imgname, -3));
|
||||
$didwrite = $entry->extract(false, $outfile);
|
||||
if ( !$didwrite ) { return false; }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user