print("None of TIFF (".bin2hex(START_TIFF).") or JP4/JPEG (".bin2hex(START_JP).") markers found in the first ".$chunksize." bytes of the file $path/$file\n");
return-1;
}
if($pos_jp===false){
$file_type=1;// tiff
}elseif(($pos_tiff!==false)&&($pos_tiff<$pos_jp)){// reducing probability of stray START_JP
print("None of TIFF (".bin2hex(START_TIFF).") or JP4/JPEG (".bin2hex(START_JP).") markers found in the first ".$chunksize." bytes of the file $path/$file\n");
}else{
print("None of TIFF (".bin2hex(START_TIFF).") or JP4/JPEG (".bin2hex(START_JP).") markers found in the remaining ".strlen($s)." bytes of the file $path/$file\n");
}
return-1;
}
if($pos_jp===false){
$file_type=1;// tiff
}elseif(($pos_tiff!==false)&&($pos_tiff<$pos_jp)){// reducing probability of stray START_JP
$end_pos=strpos($s,END_JP,MIN_JP_LEN);// PHP Warning: strpos(): Offset not contained in string in /home/elphel/git/elphel-tools-x393/extract_images_tiff.php on line 254
}
if(!$end_pos&&$next_path){// try reading from the next file define('MAX_IMG_LEN', 0x1000000); // maximal image size (16M) to look for the end marker
$f1=fopen($next_path,"r");
$s.=fread($f1,MAX_IMG_LEN);// beginning of the next file
fclose($f1);
$end_pos=strpos($s,END_JP,MIN_JP_LEN);// PHP Warning: strpos(): Offset not contained in string in /home/elphel/git/elphel-tools-x393/extract_images_tiff.php on line 254
if($end_pos&&(DEBUG_LEVEL>=1)){
printf("Found image continued in the next file %s\n",$next_path);