@@ -2,7 +2,7 @@ |
||
2 | 2 | // $Id: xb4.php,v 1.1.8.1 2008/06/12 20:34:32 smk Exp $ |
3 | 3 | |
4 | 4 | return array( |
5 | - 'en' => array('dwaen', 'dwaenj', 'dwaenh', 'dwaed', 'dwael', 'dwaelg', 'dwaelm', 'dwaelb', 'dwaels', 'dwaelt', 'dwaelp', 'dwaelh', 'dwaem', 'dwaeb', 'dwaebs', 'dwaes', |
|
5 | + 'en' => array('dwaen', 'dwaenj', 'dwaenh', 'dwaed', 'dwael', 'dwaelg', 'dwaelm', 'dwaelb', 'dwaels', 'dwaelt', 'dwaelp', 'dwaelh', 'dwaem', 'dwaeb', 'dwaebs', 'dwaes', |
|
6 | 6 | 'dwaess', 'dwaeng', 'dwaej', 'dwaec', 'dwaek', 'dwaet', 'dwaep', 'dwaeh', 'doe', 'doeg', 'doegg', 'doegs', 'doen', 'doenj', 'doenh', 'doed', |
7 | 7 | 'doel', 'doelg', 'doelm', 'doelb', 'doels', 'doelt', 'doelp', 'doelh', 'doem', 'doeb', 'doebs', 'does', 'doess', 'doeng', 'doej', 'doec', |
8 | 8 | 'doek', 'doet', 'doep', 'doeh', 'dyo', 'dyog', 'dyogg', 'dyogs', 'dyon', 'dyonj', 'dyonh', 'dyod', 'dyol', 'dyolg', 'dyolm', 'dyolb', |
@@ -2,7 +2,7 @@ |
||
2 | 2 | // $Id: x02.php,v 1.1.8.1 2008/06/12 20:34:31 smk Exp $ |
3 | 3 | |
4 | 4 | return array( |
5 | - 'en' => array('A', 'a', 'A', 'a', 'E', 'e', 'E', 'e', 'I', 'i', 'I', 'i', 'O', 'o', 'O', 'o', |
|
5 | + 'en' => array('A', 'a', 'A', 'a', 'E', 'e', 'E', 'e', 'I', 'i', 'I', 'i', 'O', 'o', 'O', 'o', |
|
6 | 6 | 'R', 'r', 'R', 'r', 'U', 'u', 'U', 'u', 'S', 's', 'T', 't', 'Y', 'y', 'H', 'h', |
7 | 7 | 'N', 'd', 'OU', 'ou', 'Z', 'z', 'A', 'a', 'E', 'e', 'O', 'o', 'O', 'o', 'O', 'o', |
8 | 8 | 'O', 'o', 'Y', 'y', 'l', 'n', 't', 'j', 'db', 'qp', 'A', 'C', 'c', 'L', 'T', 's', |
@@ -2,7 +2,7 @@ |
||
2 | 2 | // $Id: x16.php,v 1.1.8.1 2008/06/12 20:34:31 smk Exp $ |
3 | 3 | |
4 | 4 | return array( |
5 | - 'en' => array('kka', 'kk', 'nu', 'no', 'ne', 'nee', 'ni', 'na', 'mu', 'mo', 'me', 'mee', 'mi', 'ma', 'yu', 'yo', |
|
5 | + 'en' => array('kka', 'kk', 'nu', 'no', 'ne', 'nee', 'ni', 'na', 'mu', 'mo', 'me', 'mee', 'mi', 'ma', 'yu', 'yo', |
|
6 | 6 | 'ye', 'yee', 'yi', 'ya', 'ju', 'ju', 'jo', 'je', 'jee', 'ji', 'ji', 'ja', 'jju', 'jjo', 'jje', 'jjee', |
7 | 7 | 'jji', 'jja', 'lu', 'lo', 'le', 'lee', 'li', 'la', 'dlu', 'dlo', 'dle', 'dlee', 'dli', 'dla', 'lhu', 'lho', |
8 | 8 | 'lhe', 'lhee', 'lhi', 'lha', 'tlhu', 'tlho', 'tlhe', 'tlhee', 'tlhi', 'tlha', 'tlu', 'tlo', 'tle', 'tlee', 'tli', 'tla', |
@@ -2,7 +2,7 @@ |
||
2 | 2 | // $Id: x6c.php,v 1.1.8.1 2008/06/12 20:34:31 smk Exp $ |
3 | 3 | |
4 | 4 | return array( |
5 | - 'en' => array('Lu ', 'Mu ', 'Li ', 'Tong ', 'Rong ', 'Chang ', 'Pu ', 'Luo ', 'Zhan ', 'Sao ', 'Zhan ', 'Meng ', 'Luo ', 'Qu ', 'Die ', 'Shi ', |
|
5 | + 'en' => array('Lu ', 'Mu ', 'Li ', 'Tong ', 'Rong ', 'Chang ', 'Pu ', 'Luo ', 'Zhan ', 'Sao ', 'Zhan ', 'Meng ', 'Luo ', 'Qu ', 'Die ', 'Shi ', |
|
6 | 6 | 'Di ', 'Min ', 'Jue ', 'Mang ', 'Qi ', 'Pie ', 'Nai ', 'Qi ', 'Dao ', 'Xian ', 'Chuan ', 'Fen ', 'Ri ', 'Nei ', NULL, 'Fu ', |
7 | 7 | 'Shen ', 'Dong ', 'Qing ', 'Qi ', 'Yin ', 'Xi ', 'Hai ', 'Yang ', 'An ', 'Ya ', 'Ke ', 'Qing ', 'Ya ', 'Dong ', 'Dan ', 'Lu ', |
8 | 8 | 'Qing ', 'Yang ', 'Yun ', 'Yun ', 'Shui ', 'San ', 'Zheng ', 'Bing ', 'Yong ', 'Dang ', 'Shitamizu ', 'Le ', 'Ni ', 'Tun ', 'Fan ', 'Gui ', |
@@ -2,7 +2,7 @@ |
||
2 | 2 | // $Id: xb8.php,v 1.1.8.1 2008/06/12 20:34:32 smk Exp $ |
3 | 3 | |
4 | 4 | return array( |
5 | - 'en' => array('reoss', 'reong', 'reoj', 'reoc', 'reok', 'reot', 'reop', 'reoh', 're', 'reg', 'regg', 'regs', 'ren', 'renj', 'renh', 'red', |
|
5 | + 'en' => array('reoss', 'reong', 'reoj', 'reoc', 'reok', 'reot', 'reop', 'reoh', 're', 'reg', 'regg', 'regs', 'ren', 'renj', 'renh', 'red', |
|
6 | 6 | 'rel', 'relg', 'relm', 'relb', 'rels', 'relt', 'relp', 'relh', 'rem', 'reb', 'rebs', 'res', 'ress', 'reng', 'rej', 'rec', |
7 | 7 | 'rek', 'ret', 'rep', 'reh', 'ryeo', 'ryeog', 'ryeogg', 'ryeogs', 'ryeon', 'ryeonj', 'ryeonh', 'ryeod', 'ryeol', 'ryeolg', 'ryeolm', 'ryeolb', |
8 | 8 | 'ryeols', 'ryeolt', 'ryeolp', 'ryeolh', 'ryeom', 'ryeob', 'ryeobs', 'ryeos', 'ryeoss', 'ryeong', 'ryeoj', 'ryeoc', 'ryeok', 'ryeot', 'ryeop', 'ryeoh', |
@@ -2,7 +2,7 @@ |
||
2 | 2 | // $Id: xbd.php,v 1.1.8.1 2008/06/12 20:34:32 smk Exp $ |
3 | 3 | |
4 | 4 | return array( |
5 | - 'en' => array('bols', 'bolt', 'bolp', 'bolh', 'bom', 'bob', 'bobs', 'bos', 'boss', 'bong', 'boj', 'boc', 'bok', 'bot', 'bop', 'boh', |
|
5 | + 'en' => array('bols', 'bolt', 'bolp', 'bolh', 'bom', 'bob', 'bobs', 'bos', 'boss', 'bong', 'boj', 'boc', 'bok', 'bot', 'bop', 'boh', |
|
6 | 6 | 'bwa', 'bwag', 'bwagg', 'bwags', 'bwan', 'bwanj', 'bwanh', 'bwad', 'bwal', 'bwalg', 'bwalm', 'bwalb', 'bwals', 'bwalt', 'bwalp', 'bwalh', |
7 | 7 | 'bwam', 'bwab', 'bwabs', 'bwas', 'bwass', 'bwang', 'bwaj', 'bwac', 'bwak', 'bwat', 'bwap', 'bwah', 'bwae', 'bwaeg', 'bwaegg', 'bwaegs', |
8 | 8 | 'bwaen', 'bwaenj', 'bwaenh', 'bwaed', 'bwael', 'bwaelg', 'bwaelm', 'bwaelb', 'bwaels', 'bwaelt', 'bwaelp', 'bwaelh', 'bwaem', 'bwaeb', 'bwaebs', 'bwaes', |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | $class = new $class_name($this); |
301 | 301 | |
302 | 302 | try { |
303 | - $this->option_analyze and $class->Analyze(); |
|
303 | + $this->option_analyze and $class->Analyze(); |
|
304 | 304 | } |
305 | 305 | catch (getid3_exception $e) { |
306 | 306 | throw $e; |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | // CalculateReplayGain() { |
384 | 384 | if (@$this->info['replay_gain']) { |
385 | 385 | if (!@$this->info['replay_gain']['reference_volume']) { |
386 | - $this->info['replay_gain']['reference_volume'] = 89; |
|
386 | + $this->info['replay_gain']['reference_volume'] = 89; |
|
387 | 387 | } |
388 | 388 | if (isset($this->info['replay_gain']['track']['adjustment'])) { |
389 | 389 | $this->info['replay_gain']['track']['volume'] = $this->info['replay_gain']['reference_volume'] - $this->info['replay_gain']['track']['adjustment']; |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | |
404 | 404 | // ProcessAudioStreams() { |
405 | 405 | if (@!$this->info['audio']['streams'] && (@$this->info['audio']['bitrate'] || @$this->info['audio']['channels'] || @$this->info['audio']['sample_rate'])) { |
406 | - foreach ($this->info['audio'] as $key => $value) { |
|
406 | + foreach ($this->info['audio'] as $key => $value) { |
|
407 | 407 | if ($key != 'streams') { |
408 | 408 | $this->info['audio']['streams'][0][$key] = $value; |
409 | 409 | } |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | 'group' => 'audio', |
545 | 545 | 'module' => 'ac3', |
546 | 546 | 'mime_type' => 'audio/ac3', |
547 | - ), |
|
547 | + ), |
|
548 | 548 | |
549 | 549 | // AAC - audio - Advanced Audio Coding (AAC) - ADIF format |
550 | 550 | 'adif' => array ( |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | 'module' => 'aac_adif', |
554 | 554 | 'mime_type' => 'application/octet-stream', |
555 | 555 | 'fail_ape' => 'WARNING', |
556 | - ), |
|
556 | + ), |
|
557 | 557 | |
558 | 558 | |
559 | 559 | // AAC - audio - Advanced Audio Coding (AAC) - ADTS format (very similar to MP3) |
@@ -563,7 +563,7 @@ discard block |
||
563 | 563 | 'module' => 'aac_adts', |
564 | 564 | 'mime_type' => 'application/octet-stream', |
565 | 565 | 'fail_ape' => 'WARNING', |
566 | - ), |
|
566 | + ), |
|
567 | 567 | |
568 | 568 | |
569 | 569 | // AU - audio - NeXT/Sun AUdio (AU) |
@@ -572,7 +572,7 @@ discard block |
||
572 | 572 | 'group' => 'audio', |
573 | 573 | 'module' => 'au', |
574 | 574 | 'mime_type' => 'audio/basic', |
575 | - ), |
|
575 | + ), |
|
576 | 576 | |
577 | 577 | // AVR - audio - Audio Visual Research |
578 | 578 | 'avr' => array ( |
@@ -580,7 +580,7 @@ discard block |
||
580 | 580 | 'group' => 'audio', |
581 | 581 | 'module' => 'avr', |
582 | 582 | 'mime_type' => 'application/octet-stream', |
583 | - ), |
|
583 | + ), |
|
584 | 584 | |
585 | 585 | // BONK - audio - Bonk v0.9+ |
586 | 586 | 'bonk' => array ( |
@@ -588,15 +588,15 @@ discard block |
||
588 | 588 | 'group' => 'audio', |
589 | 589 | 'module' => 'bonk', |
590 | 590 | 'mime_type' => 'audio/xmms-bonk', |
591 | - ), |
|
591 | + ), |
|
592 | 592 | |
593 | 593 | // DTS - audio - Dolby Theatre System |
594 | - 'dts' => array( |
|
595 | - 'pattern' => '^\x7F\xFE\x80\x01', |
|
596 | - 'group' => 'audio', |
|
597 | - 'module' => 'dts', |
|
598 | - 'mime_type' => 'audio/dts', |
|
599 | - ), |
|
594 | + 'dts' => array( |
|
595 | + 'pattern' => '^\x7F\xFE\x80\x01', |
|
596 | + 'group' => 'audio', |
|
597 | + 'module' => 'dts', |
|
598 | + 'mime_type' => 'audio/dts', |
|
599 | + ), |
|
600 | 600 | |
601 | 601 | // FLAC - audio - Free Lossless Audio Codec |
602 | 602 | 'flac' => array ( |
@@ -604,7 +604,7 @@ discard block |
||
604 | 604 | 'group' => 'audio', |
605 | 605 | 'module' => 'xiph', |
606 | 606 | 'mime_type' => 'audio/x-flac', |
607 | - ), |
|
607 | + ), |
|
608 | 608 | |
609 | 609 | // LA - audio - Lossless Audio (LA) |
610 | 610 | 'la' => array ( |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | 'group' => 'audio', |
613 | 613 | 'module' => 'la', |
614 | 614 | 'mime_type' => 'application/octet-stream', |
615 | - ), |
|
615 | + ), |
|
616 | 616 | |
617 | 617 | // LPAC - audio - Lossless Predictive Audio Compression (LPAC) |
618 | 618 | 'lpac' => array ( |
@@ -620,7 +620,7 @@ discard block |
||
620 | 620 | 'group' => 'audio', |
621 | 621 | 'module' => 'lpac', |
622 | 622 | 'mime_type' => 'application/octet-stream', |
623 | - ), |
|
623 | + ), |
|
624 | 624 | |
625 | 625 | // MIDI - audio - MIDI (Musical Instrument Digital Interface) |
626 | 626 | 'midi' => array ( |
@@ -628,7 +628,7 @@ discard block |
||
628 | 628 | 'group' => 'audio', |
629 | 629 | 'module' => 'midi', |
630 | 630 | 'mime_type' => 'audio/midi', |
631 | - ), |
|
631 | + ), |
|
632 | 632 | |
633 | 633 | // MAC - audio - Monkey's Audio Compressor |
634 | 634 | 'mac' => array ( |
@@ -636,31 +636,31 @@ discard block |
||
636 | 636 | 'group' => 'audio', |
637 | 637 | 'module' => 'monkey', |
638 | 638 | 'mime_type' => 'application/octet-stream', |
639 | - ), |
|
639 | + ), |
|
640 | 640 | |
641 | 641 | // MOD - audio - MODule (assorted sub-formats) |
642 | 642 | 'mod' => array ( |
643 | 643 | 'pattern' => '^.{1080}(M.K.|[5-9]CHN|[1-3][0-9]CH)', |
644 | 644 | 'mime_type' => 'audio/mod', |
645 | - ), |
|
645 | + ), |
|
646 | 646 | |
647 | 647 | // MOD - audio - MODule (Impulse Tracker) |
648 | 648 | 'it' => array ( |
649 | 649 | 'pattern' => '^IMPM', |
650 | 650 | 'mime_type' => 'audio/it', |
651 | - ), |
|
651 | + ), |
|
652 | 652 | |
653 | 653 | // MOD - audio - MODule (eXtended Module, various sub-formats) |
654 | 654 | 'xm' => array ( |
655 | 655 | 'pattern' => '^Extended Module', |
656 | 656 | 'mime_type' => 'audio/xm', |
657 | - ), |
|
657 | + ), |
|
658 | 658 | |
659 | 659 | // MOD - audio - MODule (ScreamTracker) |
660 | 660 | 's3m' => array ( |
661 | 661 | 'pattern' => '^.{44}SCRM', |
662 | 662 | 'mime_type' => 'audio/s3m', |
663 | - ), |
|
663 | + ), |
|
664 | 664 | |
665 | 665 | // MPC - audio - Musepack / MPEGplus SV7+ |
666 | 666 | 'mpc' => array ( |
@@ -668,7 +668,7 @@ discard block |
||
668 | 668 | 'group' => 'audio', |
669 | 669 | 'module' => 'mpc', |
670 | 670 | 'mime_type' => 'audio/x-musepack', |
671 | - ), |
|
671 | + ), |
|
672 | 672 | |
673 | 673 | // MPC - audio - Musepack / MPEGplus SV4-6 |
674 | 674 | 'mpc_old' => array ( |
@@ -676,7 +676,7 @@ discard block |
||
676 | 676 | 'group' => 'audio', |
677 | 677 | 'module' => 'mpc_old', |
678 | 678 | 'mime_type' => 'application/octet-stream', |
679 | - ), |
|
679 | + ), |
|
680 | 680 | |
681 | 681 | |
682 | 682 | // MP3 - audio - MPEG-audio Layer 3 (very similar to AAC-ADTS) |
@@ -685,7 +685,7 @@ discard block |
||
685 | 685 | 'group' => 'audio', |
686 | 686 | 'module' => 'mp3', |
687 | 687 | 'mime_type' => 'audio/mpeg', |
688 | - ), |
|
688 | + ), |
|
689 | 689 | |
690 | 690 | // OFR - audio - OptimFROG |
691 | 691 | 'ofr' => array ( |
@@ -693,7 +693,7 @@ discard block |
||
693 | 693 | 'group' => 'audio', |
694 | 694 | 'module' => 'optimfrog', |
695 | 695 | 'mime_type' => 'application/octet-stream', |
696 | - ), |
|
696 | + ), |
|
697 | 697 | |
698 | 698 | // RKAU - audio - RKive AUdio compressor |
699 | 699 | 'rkau' => array ( |
@@ -701,7 +701,7 @@ discard block |
||
701 | 701 | 'group' => 'audio', |
702 | 702 | 'module' => 'rkau', |
703 | 703 | 'mime_type' => 'application/octet-stream', |
704 | - ), |
|
704 | + ), |
|
705 | 705 | |
706 | 706 | // SHN - audio - Shorten |
707 | 707 | 'shn' => array ( |
@@ -711,7 +711,7 @@ discard block |
||
711 | 711 | 'mime_type' => 'audio/xmms-shn', |
712 | 712 | 'fail_id3' => 'ERROR', |
713 | 713 | 'fail_ape' => 'ERROR', |
714 | - ), |
|
714 | + ), |
|
715 | 715 | |
716 | 716 | // TTA - audio - TTA Lossless Audio Compressor (http://tta.corecodec.org) |
717 | 717 | 'tta' => array ( |
@@ -719,7 +719,7 @@ discard block |
||
719 | 719 | 'group' => 'audio', |
720 | 720 | 'module' => 'tta', |
721 | 721 | 'mime_type' => 'application/octet-stream', |
722 | - ), |
|
722 | + ), |
|
723 | 723 | |
724 | 724 | // VOC - audio - Creative Voice (VOC) |
725 | 725 | 'voc' => array ( |
@@ -727,7 +727,7 @@ discard block |
||
727 | 727 | 'group' => 'audio', |
728 | 728 | 'module' => 'voc', |
729 | 729 | 'mime_type' => 'audio/voc', |
730 | - ), |
|
730 | + ), |
|
731 | 731 | |
732 | 732 | // VQF - audio - transform-domain weighted interleave Vector Quantization Format (VQF) |
733 | 733 | 'vqf' => array ( |
@@ -735,7 +735,7 @@ discard block |
||
735 | 735 | 'group' => 'audio', |
736 | 736 | 'module' => 'vqf', |
737 | 737 | 'mime_type' => 'application/octet-stream', |
738 | - ), |
|
738 | + ), |
|
739 | 739 | |
740 | 740 | // WV - audio - WavPack (v4.0+) |
741 | 741 | 'vw' => array( |
@@ -743,7 +743,7 @@ discard block |
||
743 | 743 | 'group' => 'audio', |
744 | 744 | 'module' => 'wavpack', |
745 | 745 | 'mime_type' => 'application/octet-stream', |
746 | - ), |
|
746 | + ), |
|
747 | 747 | |
748 | 748 | |
749 | 749 | // Audio-Video formats |
@@ -754,13 +754,13 @@ discard block |
||
754 | 754 | 'group' => 'audio-video', |
755 | 755 | 'module' => 'asf', |
756 | 756 | 'mime_type' => 'video/x-ms-asf', |
757 | - ), |
|
757 | + ), |
|
758 | 758 | |
759 | 759 | // BINK - audio/video - Bink / Smacker |
760 | 760 | 'bink' => array( |
761 | 761 | 'pattern' => '^(BIK|SMK)', |
762 | 762 | 'mime_type' => 'application/octet-stream', |
763 | - ), |
|
763 | + ), |
|
764 | 764 | |
765 | 765 | // FLV - audio/video - FLash Video |
766 | 766 | 'flv' => array( |
@@ -768,13 +768,13 @@ discard block |
||
768 | 768 | 'group' => 'audio-video', |
769 | 769 | 'module' => 'flv', |
770 | 770 | 'mime_type' => 'video/x-flv', |
771 | - ), |
|
771 | + ), |
|
772 | 772 | |
773 | 773 | // MKAV - audio/video - Mastroka |
774 | 774 | 'matroska' => array ( |
775 | 775 | 'pattern' => '^\x1A\x45\xDF\xA3', |
776 | 776 | 'mime_type' => 'application/octet-stream', |
777 | - ), |
|
777 | + ), |
|
778 | 778 | |
779 | 779 | // MPEG - audio/video - MPEG (Moving Pictures Experts Group) |
780 | 780 | 'mpeg' => array ( |
@@ -782,7 +782,7 @@ discard block |
||
782 | 782 | 'group' => 'audio-video', |
783 | 783 | 'module' => 'mpeg', |
784 | 784 | 'mime_type' => 'video/mpeg', |
785 | - ), |
|
785 | + ), |
|
786 | 786 | |
787 | 787 | // NSV - audio/video - Nullsoft Streaming Video (NSV) |
788 | 788 | 'nsv' => array ( |
@@ -790,7 +790,7 @@ discard block |
||
790 | 790 | 'group' => 'audio-video', |
791 | 791 | 'module' => 'nsv', |
792 | 792 | 'mime_type' => 'application/octet-stream', |
793 | - ), |
|
793 | + ), |
|
794 | 794 | |
795 | 795 | // Ogg - audio/video - Ogg (Ogg Vorbis, OggFLAC, Speex, Ogg Theora(*), Ogg Tarkin(*)) |
796 | 796 | 'ogg' => array ( |
@@ -800,7 +800,7 @@ discard block |
||
800 | 800 | 'mime_type' => 'application/ogg', |
801 | 801 | 'fail_id3' => 'WARNING', |
802 | 802 | 'fail_ape' => 'WARNING', |
803 | - ), |
|
803 | + ), |
|
804 | 804 | |
805 | 805 | // QT - audio/video - Quicktime |
806 | 806 | 'quicktime' => array ( |
@@ -808,7 +808,7 @@ discard block |
||
808 | 808 | 'group' => 'audio-video', |
809 | 809 | 'module' => 'quicktime', |
810 | 810 | 'mime_type' => 'video/quicktime', |
811 | - ), |
|
811 | + ), |
|
812 | 812 | |
813 | 813 | // RIFF - audio/video - Resource Interchange File Format (RIFF) / WAV / AVI / CD-audio / SDSS = renamed variant used by SmartSound QuickTracks (www.smartsound.com) / FORM = Audio Interchange File Format (AIFF) |
814 | 814 | 'riff' => array ( |
@@ -817,7 +817,7 @@ discard block |
||
817 | 817 | 'module' => 'riff', |
818 | 818 | 'mime_type' => 'audio/x-wave', |
819 | 819 | 'fail_ape' => 'WARNING', |
820 | - ), |
|
820 | + ), |
|
821 | 821 | |
822 | 822 | // Real - audio/video - RealAudio, RealVideo |
823 | 823 | 'real' => array ( |
@@ -825,7 +825,7 @@ discard block |
||
825 | 825 | 'group' => 'audio-video', |
826 | 826 | 'module' => 'real', |
827 | 827 | 'mime_type' => 'audio/x-realaudio', |
828 | - ), |
|
828 | + ), |
|
829 | 829 | |
830 | 830 | // SWF - audio/video - ShockWave Flash |
831 | 831 | 'swf' => array ( |
@@ -833,7 +833,7 @@ discard block |
||
833 | 833 | 'group' => 'audio-video', |
834 | 834 | 'module' => 'swf', |
835 | 835 | 'mime_type' => 'application/x-shockwave-flash', |
836 | - ), |
|
836 | + ), |
|
837 | 837 | |
838 | 838 | |
839 | 839 | // Still-Image formats |
@@ -846,7 +846,7 @@ discard block |
||
846 | 846 | 'mime_type' => 'image/bmp', |
847 | 847 | 'fail_id3' => 'ERROR', |
848 | 848 | 'fail_ape' => 'ERROR', |
849 | - ), |
|
849 | + ), |
|
850 | 850 | |
851 | 851 | // GIF - still image - Graphics Interchange Format |
852 | 852 | 'gif' => array ( |
@@ -856,7 +856,7 @@ discard block |
||
856 | 856 | 'mime_type' => 'image/gif', |
857 | 857 | 'fail_id3' => 'ERROR', |
858 | 858 | 'fail_ape' => 'ERROR', |
859 | - ), |
|
859 | + ), |
|
860 | 860 | |
861 | 861 | // JPEG - still image - Joint Photographic Experts Group (JPEG) |
862 | 862 | 'jpeg' => array ( |
@@ -866,7 +866,7 @@ discard block |
||
866 | 866 | 'mime_type' => 'image/jpeg', |
867 | 867 | 'fail_id3' => 'ERROR', |
868 | 868 | 'fail_ape' => 'ERROR', |
869 | - ), |
|
869 | + ), |
|
870 | 870 | |
871 | 871 | // PCD - still image - Kodak Photo CD |
872 | 872 | 'pcd' => array ( |
@@ -876,7 +876,7 @@ discard block |
||
876 | 876 | 'mime_type' => 'image/x-photo-cd', |
877 | 877 | 'fail_id3' => 'ERROR', |
878 | 878 | 'fail_ape' => 'ERROR', |
879 | - ), |
|
879 | + ), |
|
880 | 880 | |
881 | 881 | |
882 | 882 | // PNG - still image - Portable Network Graphics (PNG) |
@@ -887,16 +887,16 @@ discard block |
||
887 | 887 | 'mime_type' => 'image/png', |
888 | 888 | 'fail_id3' => 'ERROR', |
889 | 889 | 'fail_ape' => 'ERROR', |
890 | - ), |
|
890 | + ), |
|
891 | 891 | |
892 | 892 | |
893 | 893 | // SVG - still image - Scalable Vector Graphics (SVG) |
894 | - 'svg' => array( |
|
895 | - 'pattern' => '<!DOCTYPE svg PUBLIC ', |
|
896 | - 'mime_type' => 'image/svg+xml', |
|
897 | - 'fail_id3' => 'ERROR', |
|
898 | - 'fail_ape' => 'ERROR', |
|
899 | - ), |
|
894 | + 'svg' => array( |
|
895 | + 'pattern' => '<!DOCTYPE svg PUBLIC ', |
|
896 | + 'mime_type' => 'image/svg+xml', |
|
897 | + 'fail_id3' => 'ERROR', |
|
898 | + 'fail_ape' => 'ERROR', |
|
899 | + ), |
|
900 | 900 | |
901 | 901 | |
902 | 902 | // TIFF - still image - Tagged Information File Format (TIFF) |
@@ -907,7 +907,7 @@ discard block |
||
907 | 907 | 'mime_type' => 'image/tiff', |
908 | 908 | 'fail_id3' => 'ERROR', |
909 | 909 | 'fail_ape' => 'ERROR', |
910 | - ), |
|
910 | + ), |
|
911 | 911 | |
912 | 912 | |
913 | 913 | // Data formats |
@@ -917,7 +917,7 @@ discard block |
||
917 | 917 | 'mime_type' => 'application/octet-stream', |
918 | 918 | 'fail_id3' => 'ERROR', |
919 | 919 | 'fail_ape' => 'ERROR', |
920 | - ), |
|
920 | + ), |
|
921 | 921 | |
922 | 922 | // ISO - data - International Standards Organization (ISO) CD-ROM Image |
923 | 923 | 'iso' => array ( |
@@ -927,7 +927,7 @@ discard block |
||
927 | 927 | 'mime_type' => 'application/octet-stream', |
928 | 928 | 'fail_id3' => 'ERROR', |
929 | 929 | 'fail_ape' => 'ERROR', |
930 | - ), |
|
930 | + ), |
|
931 | 931 | |
932 | 932 | // RAR - data - RAR compressed data |
933 | 933 | 'rar' => array( |
@@ -935,7 +935,7 @@ discard block |
||
935 | 935 | 'mime_type' => 'application/octet-stream', |
936 | 936 | 'fail_id3' => 'ERROR', |
937 | 937 | 'fail_ape' => 'ERROR', |
938 | - ), |
|
938 | + ), |
|
939 | 939 | |
940 | 940 | // SZIP - audio - SZIP compressed data |
941 | 941 | 'szip' => array ( |
@@ -945,7 +945,7 @@ discard block |
||
945 | 945 | 'mime_type' => 'application/octet-stream', |
946 | 946 | 'fail_id3' => 'ERROR', |
947 | 947 | 'fail_ape' => 'ERROR', |
948 | - ), |
|
948 | + ), |
|
949 | 949 | |
950 | 950 | // TAR - data - TAR compressed data |
951 | 951 | 'tar' => array( |
@@ -955,7 +955,7 @@ discard block |
||
955 | 955 | 'mime_type' => 'application/x-tar', |
956 | 956 | 'fail_id3' => 'ERROR', |
957 | 957 | 'fail_ape' => 'ERROR', |
958 | - ), |
|
958 | + ), |
|
959 | 959 | |
960 | 960 | // GZIP - data - GZIP compressed data |
961 | 961 | 'gz' => array( |
@@ -965,7 +965,7 @@ discard block |
||
965 | 965 | 'mime_type' => 'application/x-gzip', |
966 | 966 | 'fail_id3' => 'ERROR', |
967 | 967 | 'fail_ape' => 'ERROR', |
968 | - ), |
|
968 | + ), |
|
969 | 969 | |
970 | 970 | |
971 | 971 | // ZIP - data - ZIP compressed data |
@@ -976,33 +976,33 @@ discard block |
||
976 | 976 | 'mime_type' => 'application/zip', |
977 | 977 | 'fail_id3' => 'ERROR', |
978 | 978 | 'fail_ape' => 'ERROR', |
979 | - ), |
|
979 | + ), |
|
980 | 980 | |
981 | 981 | |
982 | 982 | // PAR2 - data - Parity Volume Set Specification 2.0 |
983 | 983 | 'par2' => array ( |
984 | - 'pattern' => '^PAR2\x00PKT', |
|
985 | - 'mime_type' => 'application/octet-stream', |
|
986 | - 'fail_id3' => 'ERROR', |
|
987 | - 'fail_ape' => 'ERROR', |
|
988 | - ), |
|
984 | + 'pattern' => '^PAR2\x00PKT', |
|
985 | + 'mime_type' => 'application/octet-stream', |
|
986 | + 'fail_id3' => 'ERROR', |
|
987 | + 'fail_ape' => 'ERROR', |
|
988 | + ), |
|
989 | 989 | |
990 | 990 | |
991 | - // PDF - data - Portable Document Format |
|
992 | - 'pdf' => array( |
|
991 | + // PDF - data - Portable Document Format |
|
992 | + 'pdf' => array( |
|
993 | 993 | 'pattern' => '^\x25PDF', |
994 | 994 | 'mime_type' => 'application/pdf', |
995 | 995 | 'fail_id3' => 'ERROR', |
996 | 996 | 'fail_ape' => 'ERROR', |
997 | - ), |
|
997 | + ), |
|
998 | 998 | |
999 | - // DOC - data - Microsoft Word |
|
1000 | - 'msoffice' => array( |
|
999 | + // DOC - data - Microsoft Word |
|
1000 | + 'msoffice' => array( |
|
1001 | 1001 | 'pattern' => '^\xD0\xCF\x11\xE0', // D0CF11E == DOCFILE == Microsoft Office Document |
1002 | 1002 | 'mime_type' => 'application/octet-stream', |
1003 | 1003 | 'fail_id3' => 'ERROR', |
1004 | 1004 | 'fail_ape' => 'ERROR', |
1005 | - ), |
|
1005 | + ), |
|
1006 | 1006 | ); |
1007 | 1007 | |
1008 | 1008 | return $format_info; |
@@ -1393,99 +1393,99 @@ discard block |
||
1393 | 1393 | |
1394 | 1394 | public static function BigEndian2Float($byte_word) { |
1395 | 1395 | |
1396 | - // ANSI/IEEE Standard 754-1985, Standard for Binary Floating Point Arithmetic |
|
1397 | - // http://www.psc.edu/general/software/packages/ieee/ieee.html |
|
1398 | - // http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/ieee.html |
|
1396 | + // ANSI/IEEE Standard 754-1985, Standard for Binary Floating Point Arithmetic |
|
1397 | + // http://www.psc.edu/general/software/packages/ieee/ieee.html |
|
1398 | + // http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/ieee.html |
|
1399 | 1399 | |
1400 | - $bit_word = getid3_lib::BigEndian2Bin($byte_word); |
|
1401 | - if (!$bit_word) { |
|
1400 | + $bit_word = getid3_lib::BigEndian2Bin($byte_word); |
|
1401 | + if (!$bit_word) { |
|
1402 | 1402 | return 0; |
1403 | 1403 | } |
1404 | - $sign_bit = $bit_word{0}; |
|
1405 | - |
|
1406 | - switch (strlen($byte_word) * 8) { |
|
1407 | - case 32: |
|
1408 | - $exponent_bits = 8; |
|
1409 | - $fraction_bits = 23; |
|
1410 | - break; |
|
1411 | - |
|
1412 | - case 64: |
|
1413 | - $exponent_bits = 11; |
|
1414 | - $fraction_bits = 52; |
|
1415 | - break; |
|
1416 | - |
|
1417 | - case 80: |
|
1418 | - // 80-bit Apple SANE format |
|
1419 | - // http://www.mactech.com/articles/mactech/Vol.06/06.01/SANENormalized/ |
|
1420 | - $exponent_string = substr($bit_word, 1, 15); |
|
1421 | - $is_normalized = intval($bit_word{16}); |
|
1422 | - $fraction_string = substr($bit_word, 17, 63); |
|
1423 | - $exponent = pow(2, getid3_lib::Bin2Dec($exponent_string) - 16383); |
|
1424 | - $fraction = $is_normalized + getid3_lib::DecimalBinary2Float($fraction_string); |
|
1425 | - $float_value = $exponent * $fraction; |
|
1426 | - if ($sign_bit == '1') { |
|
1427 | - $float_value *= -1; |
|
1428 | - } |
|
1429 | - return $float_value; |
|
1430 | - break; |
|
1431 | - |
|
1432 | - default: |
|
1433 | - return false; |
|
1434 | - break; |
|
1435 | - } |
|
1436 | - $exponent_string = substr($bit_word, 1, $exponent_bits); |
|
1437 | - $fraction_string = substr($bit_word, $exponent_bits + 1, $fraction_bits); |
|
1438 | - $exponent = bindec($exponent_string); |
|
1439 | - $fraction = bindec($fraction_string); |
|
1440 | - |
|
1441 | - if (($exponent == (pow(2, $exponent_bits) - 1)) && ($fraction != 0)) { |
|
1442 | - // Not a Number |
|
1443 | - $float_value = false; |
|
1444 | - } elseif (($exponent == (pow(2, $exponent_bits) - 1)) && ($fraction == 0)) { |
|
1445 | - if ($sign_bit == '1') { |
|
1446 | - $float_value = '-infinity'; |
|
1447 | - } else { |
|
1448 | - $float_value = '+infinity'; |
|
1449 | - } |
|
1450 | - } elseif (($exponent == 0) && ($fraction == 0)) { |
|
1451 | - if ($sign_bit == '1') { |
|
1452 | - $float_value = -0; |
|
1453 | - } else { |
|
1454 | - $float_value = 0; |
|
1455 | - } |
|
1456 | - $float_value = ($sign_bit ? 0 : -0); |
|
1457 | - } elseif (($exponent == 0) && ($fraction != 0)) { |
|
1458 | - // These are 'unnormalized' values |
|
1459 | - $float_value = pow(2, (-1 * (pow(2, $exponent_bits - 1) - 2))) * getid3_lib::DecimalBinary2Float($fraction_string); |
|
1460 | - if ($sign_bit == '1') { |
|
1461 | - $float_value *= -1; |
|
1462 | - } |
|
1463 | - } elseif ($exponent != 0) { |
|
1464 | - $float_value = pow(2, ($exponent - (pow(2, $exponent_bits - 1) - 1))) * (1 + getid3_lib::DecimalBinary2Float($fraction_string)); |
|
1465 | - if ($sign_bit == '1') { |
|
1466 | - $float_value *= -1; |
|
1467 | - } |
|
1468 | - } |
|
1469 | - return (float) $float_value; |
|
1470 | - } |
|
1471 | - |
|
1472 | - |
|
1473 | - |
|
1474 | - public static function LittleEndian2Float($byte_word) { |
|
1475 | - |
|
1476 | - return getid3_lib::BigEndian2Float(strrev($byte_word)); |
|
1477 | - } |
|
1478 | - |
|
1479 | - |
|
1480 | - |
|
1481 | - public static function DecimalBinary2Float($binary_numerator) { |
|
1482 | - $numerator = bindec($binary_numerator); |
|
1483 | - $denominator = bindec('1'.str_repeat('0', strlen($binary_numerator))); |
|
1484 | - return ($numerator / $denominator); |
|
1485 | - } |
|
1486 | - |
|
1487 | - |
|
1488 | - public static function PrintHexBytes($string, $hex=true, $spaces=true, $html_safe=true) { |
|
1404 | + $sign_bit = $bit_word{0}; |
|
1405 | + |
|
1406 | + switch (strlen($byte_word) * 8) { |
|
1407 | + case 32: |
|
1408 | + $exponent_bits = 8; |
|
1409 | + $fraction_bits = 23; |
|
1410 | + break; |
|
1411 | + |
|
1412 | + case 64: |
|
1413 | + $exponent_bits = 11; |
|
1414 | + $fraction_bits = 52; |
|
1415 | + break; |
|
1416 | + |
|
1417 | + case 80: |
|
1418 | + // 80-bit Apple SANE format |
|
1419 | + // http://www.mactech.com/articles/mactech/Vol.06/06.01/SANENormalized/ |
|
1420 | + $exponent_string = substr($bit_word, 1, 15); |
|
1421 | + $is_normalized = intval($bit_word{16}); |
|
1422 | + $fraction_string = substr($bit_word, 17, 63); |
|
1423 | + $exponent = pow(2, getid3_lib::Bin2Dec($exponent_string) - 16383); |
|
1424 | + $fraction = $is_normalized + getid3_lib::DecimalBinary2Float($fraction_string); |
|
1425 | + $float_value = $exponent * $fraction; |
|
1426 | + if ($sign_bit == '1') { |
|
1427 | + $float_value *= -1; |
|
1428 | + } |
|
1429 | + return $float_value; |
|
1430 | + break; |
|
1431 | + |
|
1432 | + default: |
|
1433 | + return false; |
|
1434 | + break; |
|
1435 | + } |
|
1436 | + $exponent_string = substr($bit_word, 1, $exponent_bits); |
|
1437 | + $fraction_string = substr($bit_word, $exponent_bits + 1, $fraction_bits); |
|
1438 | + $exponent = bindec($exponent_string); |
|
1439 | + $fraction = bindec($fraction_string); |
|
1440 | + |
|
1441 | + if (($exponent == (pow(2, $exponent_bits) - 1)) && ($fraction != 0)) { |
|
1442 | + // Not a Number |
|
1443 | + $float_value = false; |
|
1444 | + } elseif (($exponent == (pow(2, $exponent_bits) - 1)) && ($fraction == 0)) { |
|
1445 | + if ($sign_bit == '1') { |
|
1446 | + $float_value = '-infinity'; |
|
1447 | + } else { |
|
1448 | + $float_value = '+infinity'; |
|
1449 | + } |
|
1450 | + } elseif (($exponent == 0) && ($fraction == 0)) { |
|
1451 | + if ($sign_bit == '1') { |
|
1452 | + $float_value = -0; |
|
1453 | + } else { |
|
1454 | + $float_value = 0; |
|
1455 | + } |
|
1456 | + $float_value = ($sign_bit ? 0 : -0); |
|
1457 | + } elseif (($exponent == 0) && ($fraction != 0)) { |
|
1458 | + // These are 'unnormalized' values |
|
1459 | + $float_value = pow(2, (-1 * (pow(2, $exponent_bits - 1) - 2))) * getid3_lib::DecimalBinary2Float($fraction_string); |
|
1460 | + if ($sign_bit == '1') { |
|
1461 | + $float_value *= -1; |
|
1462 | + } |
|
1463 | + } elseif ($exponent != 0) { |
|
1464 | + $float_value = pow(2, ($exponent - (pow(2, $exponent_bits - 1) - 1))) * (1 + getid3_lib::DecimalBinary2Float($fraction_string)); |
|
1465 | + if ($sign_bit == '1') { |
|
1466 | + $float_value *= -1; |
|
1467 | + } |
|
1468 | + } |
|
1469 | + return (float) $float_value; |
|
1470 | + } |
|
1471 | + |
|
1472 | + |
|
1473 | + |
|
1474 | + public static function LittleEndian2Float($byte_word) { |
|
1475 | + |
|
1476 | + return getid3_lib::BigEndian2Float(strrev($byte_word)); |
|
1477 | + } |
|
1478 | + |
|
1479 | + |
|
1480 | + |
|
1481 | + public static function DecimalBinary2Float($binary_numerator) { |
|
1482 | + $numerator = bindec($binary_numerator); |
|
1483 | + $denominator = bindec('1'.str_repeat('0', strlen($binary_numerator))); |
|
1484 | + return ($numerator / $denominator); |
|
1485 | + } |
|
1486 | + |
|
1487 | + |
|
1488 | + public static function PrintHexBytes($string, $hex=true, $spaces=true, $html_safe=true) { |
|
1489 | 1489 | |
1490 | 1490 | $return_string = ''; |
1491 | 1491 | for ($i = 0; $i < strlen($string); $i++) { |
@@ -6022,7 +6022,7 @@ |
||
6022 | 6022 | ]); |
6023 | 6023 | } |
6024 | 6024 | |
6025 | - /** |
|
6025 | + /** |
|
6026 | 6026 | * Get the count of user courses in session |
6027 | 6027 | * @param int $sessionId The session id |
6028 | 6028 | * @return array |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | if ($height >= $max_size_for_picture) { |
48 | 48 | // scale width |
49 | 49 | $new_width = round($width * ($max_size_for_picture / $height)); |
50 | - $this->image_wrapper->resize($new_width, $max_size_for_picture, 0); |
|
50 | + $this->image_wrapper->resize($new_width, $max_size_for_picture, 0); |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | |
150 | 150 | public function __construct($path) |
151 | 151 | { |
152 | - parent::__construct($path); |
|
152 | + parent::__construct($path); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | public function set_image_wrapper() |
@@ -184,19 +184,19 @@ discard block |
||
184 | 184 | } |
185 | 185 | } |
186 | 186 | |
187 | - public function get_image_size() |
|
187 | + public function get_image_size() |
|
188 | 188 | { |
189 | - $imagesize = array('width'=>0,'height'=>0); |
|
190 | - if ($this->image_validated) { |
|
189 | + $imagesize = array('width'=>0,'height'=>0); |
|
190 | + if ($this->image_validated) { |
|
191 | 191 | $imagesize = $this->image->getImageGeometry(); |
192 | - } |
|
193 | - return $imagesize; |
|
194 | - } |
|
192 | + } |
|
193 | + return $imagesize; |
|
194 | + } |
|
195 | 195 | |
196 | - //@todo implement border logic case for Imagick |
|
197 | - public function resize($thumbw, $thumbh, $border, $specific_size = false) |
|
196 | + //@todo implement border logic case for Imagick |
|
197 | + public function resize($thumbw, $thumbh, $border, $specific_size = false) |
|
198 | 198 | { |
199 | - if (!$this->image_validated) return false; |
|
199 | + if (!$this->image_validated) return false; |
|
200 | 200 | |
201 | 201 | if ($specific_size) { |
202 | 202 | $width = $thumbw; |
@@ -206,10 +206,10 @@ discard block |
||
206 | 206 | $width = (int)($this->width * $scale); |
207 | 207 | $height = (int)($this->height * $scale); |
208 | 208 | } |
209 | - $result = $this->image->resizeImage($width, $height, $this->filter, 1); |
|
210 | - $this->width = $thumbw; |
|
211 | - $this->height = $thumbh; |
|
212 | - } |
|
209 | + $result = $this->image->resizeImage($width, $height, $this->filter, 1); |
|
210 | + $this->width = $thumbw; |
|
211 | + $this->height = $thumbh; |
|
212 | + } |
|
213 | 213 | |
214 | 214 | /** |
215 | 215 | * @author José Loguercio <[email protected]> |
@@ -224,8 +224,8 @@ discard block |
||
224 | 224 | public function crop($x, $y, $width, $height, $src_width, $src_height) { |
225 | 225 | if (!$this->image_validated) return false; |
226 | 226 | $this->image->cropimage($width, $height, $x, $y); |
227 | - $this->width = $width; |
|
228 | - $this->height = $height; |
|
227 | + $this->width = $width; |
|
228 | + $this->height = $height; |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | public function send_image($file = '', $compress = -1, $convert_file_to = null) |
@@ -235,35 +235,35 @@ discard block |
||
235 | 235 | if (!empty($convert_file_to) && in_array($convert_file_to, $this->allowed_extensions)) { |
236 | 236 | $type = $convert_file_to; |
237 | 237 | } |
238 | - switch ($type) { |
|
239 | - case 'jpeg': |
|
240 | - case 'jpg': |
|
241 | - if (!$file) header("Content-type: image/jpeg"); |
|
242 | - break; |
|
243 | - case 'png': |
|
244 | - if (!$file) header("Content-type: image/png"); |
|
245 | - break; |
|
246 | - case 'gif': |
|
247 | - if (!$file) header("Content-type: image/gif"); |
|
248 | - break; |
|
249 | - } |
|
250 | - $result = false; |
|
251 | - try { |
|
252 | - $result = $this->image->writeImage($file); |
|
253 | - } catch(ImagickException $e) { |
|
238 | + switch ($type) { |
|
239 | + case 'jpeg': |
|
240 | + case 'jpg': |
|
241 | + if (!$file) header("Content-type: image/jpeg"); |
|
242 | + break; |
|
243 | + case 'png': |
|
244 | + if (!$file) header("Content-type: image/png"); |
|
245 | + break; |
|
246 | + case 'gif': |
|
247 | + if (!$file) header("Content-type: image/gif"); |
|
248 | + break; |
|
249 | + } |
|
250 | + $result = false; |
|
251 | + try { |
|
252 | + $result = $this->image->writeImage($file); |
|
253 | + } catch(ImagickException $e) { |
|
254 | 254 | if ($this->debug) error_log($e->getMessage()); |
255 | 255 | } |
256 | 256 | |
257 | - if (!$file) { |
|
258 | - echo $this->image; |
|
259 | - $this->image->clear(); |
|
257 | + if (!$file) { |
|
258 | + echo $this->image; |
|
259 | + $this->image->clear(); |
|
260 | 260 | $this->image->destroy(); |
261 | - } else { |
|
262 | - $this->image->clear(); |
|
261 | + } else { |
|
262 | + $this->image->clear(); |
|
263 | 263 | $this->image->destroy(); |
264 | - return $result; |
|
265 | - } |
|
266 | - } |
|
264 | + return $result; |
|
265 | + } |
|
266 | + } |
|
267 | 267 | |
268 | 268 | } |
269 | 269 | |
@@ -285,21 +285,21 @@ discard block |
||
285 | 285 | $this->fill_image_info(); |
286 | 286 | |
287 | 287 | switch ($this->type) { |
288 | - case 0: |
|
289 | - $handler = false; |
|
290 | - break; |
|
291 | - case 1 : |
|
288 | + case 0: |
|
289 | + $handler = false; |
|
290 | + break; |
|
291 | + case 1 : |
|
292 | 292 | $handler = @imagecreatefromgif($this->path); |
293 | 293 | $this->type = 'gif'; |
294 | 294 | break; |
295 | - case 2 : |
|
295 | + case 2 : |
|
296 | 296 | $handler = @imagecreatefromjpeg($this->path); |
297 | 297 | $this->type = 'jpg'; |
298 | 298 | break; |
299 | - case 3 : |
|
300 | - $handler = @imagecreatefrompng($this->path); |
|
301 | - $this->type = 'png'; |
|
302 | - break; |
|
299 | + case 3 : |
|
300 | + $handler = @imagecreatefrompng($this->path); |
|
301 | + $this->type = 'png'; |
|
302 | + break; |
|
303 | 303 | } |
304 | 304 | if ($handler) { |
305 | 305 | $this->image_validated = true; |
@@ -313,29 +313,29 @@ discard block |
||
313 | 313 | { |
314 | 314 | $return_array = array('width'=>0,'height'=>0); |
315 | 315 | if ($this->image_validated) { |
316 | - $return_array = array('width'=>$this->width,'height'=>$this->height); |
|
316 | + $return_array = array('width'=>$this->width,'height'=>$this->height); |
|
317 | 317 | } |
318 | 318 | return $return_array; |
319 | - } |
|
319 | + } |
|
320 | 320 | |
321 | 321 | public function fill_image_info() |
322 | 322 | { |
323 | - if (file_exists($this->path)) { |
|
324 | - $image_info = getimagesize($this->path); |
|
325 | - $this->width = $image_info[0]; |
|
326 | - $this->height = $image_info[1]; |
|
327 | - $this->type = $image_info[2]; |
|
328 | - } else { |
|
329 | - $this->width = 0; |
|
330 | - $this->height = 0; |
|
331 | - $this->type = 0; |
|
332 | - } |
|
323 | + if (file_exists($this->path)) { |
|
324 | + $image_info = getimagesize($this->path); |
|
325 | + $this->width = $image_info[0]; |
|
326 | + $this->height = $image_info[1]; |
|
327 | + $this->type = $image_info[2]; |
|
328 | + } else { |
|
329 | + $this->width = 0; |
|
330 | + $this->height = 0; |
|
331 | + $this->type = 0; |
|
332 | + } |
|
333 | 333 | } |
334 | 334 | |
335 | 335 | public function resize($thumbw, $thumbh, $border, $specific_size = false) |
336 | 336 | { |
337 | 337 | if (!$this->image_validated) return false; |
338 | - if ($border == 1) { |
|
338 | + if ($border == 1) { |
|
339 | 339 | if ($specific_size) { |
340 | 340 | $width = $thumbw; |
341 | 341 | $height = $thumbh; |
@@ -344,17 +344,17 @@ discard block |
||
344 | 344 | $width = (int)($this->width * $scale); |
345 | 345 | $height = (int)($this->height * $scale); |
346 | 346 | } |
347 | - $deltaw = (int)(($thumbw - $width) / 2); |
|
348 | - $deltah = (int)(($thumbh - $height) / 2); |
|
349 | - $dst_img = @ImageCreateTrueColor($thumbw, $thumbh); |
|
350 | - @imagealphablending($dst_img, false); |
|
351 | - @imagesavealpha($dst_img, true); |
|
352 | - if (!empty($this->color)) { |
|
353 | - @imagefill($dst_img, 0, 0, $this->color); |
|
354 | - } |
|
355 | - $this->width = $thumbw; |
|
356 | - $this->height = $thumbh; |
|
357 | - } elseif ($border == 0) { |
|
347 | + $deltaw = (int)(($thumbw - $width) / 2); |
|
348 | + $deltah = (int)(($thumbh - $height) / 2); |
|
349 | + $dst_img = @ImageCreateTrueColor($thumbw, $thumbh); |
|
350 | + @imagealphablending($dst_img, false); |
|
351 | + @imagesavealpha($dst_img, true); |
|
352 | + if (!empty($this->color)) { |
|
353 | + @imagefill($dst_img, 0, 0, $this->color); |
|
354 | + } |
|
355 | + $this->width = $thumbw; |
|
356 | + $this->height = $thumbh; |
|
357 | + } elseif ($border == 0) { |
|
358 | 358 | if ($specific_size) { |
359 | 359 | $width = $thumbw; |
360 | 360 | $height = $thumbh; |
@@ -363,19 +363,19 @@ discard block |
||
363 | 363 | $width = (int)($this->width * $scale); |
364 | 364 | $height = (int)($this->height * $scale); |
365 | 365 | } |
366 | - $deltaw = 0; |
|
367 | - $deltah = 0; |
|
368 | - $dst_img = @ImageCreateTrueColor($width, $height); |
|
369 | - @imagealphablending($dst_img, false); |
|
370 | - @imagesavealpha($dst_img, true); |
|
371 | - $this->width = $width; |
|
372 | - $this->height = $height; |
|
373 | - } |
|
374 | - $src_img = $this->bg; |
|
375 | - @ImageCopyResampled($dst_img, $src_img, $deltaw, $deltah, 0, 0, $width, $height, ImageSX($src_img), ImageSY($src_img)); |
|
376 | - $this->bg = $dst_img; |
|
377 | - @imagedestroy($src_img); |
|
378 | - } |
|
366 | + $deltaw = 0; |
|
367 | + $deltah = 0; |
|
368 | + $dst_img = @ImageCreateTrueColor($width, $height); |
|
369 | + @imagealphablending($dst_img, false); |
|
370 | + @imagesavealpha($dst_img, true); |
|
371 | + $this->width = $width; |
|
372 | + $this->height = $height; |
|
373 | + } |
|
374 | + $src_img = $this->bg; |
|
375 | + @ImageCopyResampled($dst_img, $src_img, $deltaw, $deltah, 0, 0, $width, $height, ImageSX($src_img), ImageSY($src_img)); |
|
376 | + $this->bg = $dst_img; |
|
377 | + @imagedestroy($src_img); |
|
378 | + } |
|
379 | 379 | |
380 | 380 | /** |
381 | 381 | * @author José Loguercio <[email protected]> |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | public function crop($x, $y, $width, $height, $src_width, $src_height) { |
390 | 390 | if (!$this->image_validated) return false; |
391 | 391 | $this->width = $width; |
392 | - $this->height = $height; |
|
392 | + $this->height = $height; |
|
393 | 393 | $src = null; |
394 | 394 | $dest = @imagecreatetruecolor($width, $height); |
395 | 395 | $type = $this->type; |
@@ -400,56 +400,56 @@ discard block |
||
400 | 400 | @imagecopy($dest, $src, 0, 0, $x, $y, $src_width, $src_height); |
401 | 401 | @imagejpeg($dest, $this->path); |
402 | 402 | break; |
403 | - case 'png' : |
|
403 | + case 'png' : |
|
404 | 404 | $src = @imagecreatefrompng($this->path); |
405 | 405 | @imagecopy($dest, $src, 0, 0, $x, $y, $src_width, $src_height); |
406 | 406 | @imagepng($dest, $this->path); |
407 | 407 | break; |
408 | - case 'gif' : |
|
409 | - $src = @imagecreatefromgif($this->path); |
|
408 | + case 'gif' : |
|
409 | + $src = @imagecreatefromgif($this->path); |
|
410 | 410 | @imagecopy($dest, $src, 0, 0, $x, $y, $src_width, $src_height); |
411 | 411 | @imagegif($dest, $this->path); |
412 | - break; |
|
412 | + break; |
|
413 | 413 | default: return 0; |
414 | 414 | } |
415 | 415 | @imagedestroy($dest); |
416 | 416 | @imagedestroy($src); |
417 | 417 | } |
418 | 418 | |
419 | - public function send_image($file = '', $compress = -1, $convert_file_to = null) |
|
419 | + public function send_image($file = '', $compress = -1, $convert_file_to = null) |
|
420 | 420 | { |
421 | - if (!$this->image_validated) return false; |
|
421 | + if (!$this->image_validated) return false; |
|
422 | 422 | $compress = (int)$compress; |
423 | 423 | $type = $this->type; |
424 | 424 | if (!empty($convert_file_to) && in_array($convert_file_to, $this->allowed_extensions)) { |
425 | 425 | $type = $convert_file_to; |
426 | 426 | } |
427 | - switch ($type) { |
|
428 | - case 'jpeg': |
|
429 | - case 'jpg': |
|
430 | - if (!$file) header("Content-type: image/jpeg"); |
|
431 | - if ($compress == -1) $compress = 100; |
|
432 | - return imagejpeg($this->bg, $file, $compress); |
|
433 | - break; |
|
434 | - case 'png': |
|
435 | - if (!$file) header("Content-type: image/png"); |
|
436 | - if ($compress != -1) { |
|
437 | - @imagetruecolortopalette($this->bg, true, $compress); |
|
438 | - } |
|
439 | - return imagepng($this->bg, $file, $compress); |
|
440 | - break; |
|
441 | - case 'gif': |
|
442 | - if (!$file) header("Content-type: image/gif"); |
|
443 | - if ($compress != -1) { |
|
444 | - @imagetruecolortopalette($this->bg, true, $compress); |
|
445 | - } |
|
446 | - return imagegif($this->bg, $file, $compress); |
|
447 | - break; |
|
448 | - default: return 0; |
|
449 | - } |
|
450 | - // TODO: Occupied memory is not released, because the following fragment of code is actually dead. |
|
451 | - @imagedestroy($this->bg); |
|
452 | - } |
|
427 | + switch ($type) { |
|
428 | + case 'jpeg': |
|
429 | + case 'jpg': |
|
430 | + if (!$file) header("Content-type: image/jpeg"); |
|
431 | + if ($compress == -1) $compress = 100; |
|
432 | + return imagejpeg($this->bg, $file, $compress); |
|
433 | + break; |
|
434 | + case 'png': |
|
435 | + if (!$file) header("Content-type: image/png"); |
|
436 | + if ($compress != -1) { |
|
437 | + @imagetruecolortopalette($this->bg, true, $compress); |
|
438 | + } |
|
439 | + return imagepng($this->bg, $file, $compress); |
|
440 | + break; |
|
441 | + case 'gif': |
|
442 | + if (!$file) header("Content-type: image/gif"); |
|
443 | + if ($compress != -1) { |
|
444 | + @imagetruecolortopalette($this->bg, true, $compress); |
|
445 | + } |
|
446 | + return imagegif($this->bg, $file, $compress); |
|
447 | + break; |
|
448 | + default: return 0; |
|
449 | + } |
|
450 | + // TODO: Occupied memory is not released, because the following fragment of code is actually dead. |
|
451 | + @imagedestroy($this->bg); |
|
452 | + } |
|
453 | 453 | |
454 | 454 | /** |
455 | 455 | * Convert image to black & white |