Code Duplication    Length = 20-20 lines in 2 locations

thumbs/phpthumb.gif.php 2 locations

@@ 82-101 (lines=20) @@
79
 * @param  int  $bgColor
80
 * @return bool
81
 */
82
function gif_outputAsBmp($gif, $lpszFileName, $bgColor = -1)
83
{
84
    if (!isset($gif) || (@get_class($gif) <> 'cgif') || !$gif->loaded() || ($lpszFileName == '')) {
85
        return false;
86
    }
87
88
    $fd = $gif->getBmp($bgColor);
89
    if (strlen($fd) <= 0) {
90
        return false;
91
    }
92
93
    if (!($fh = @fopen($lpszFileName, 'wb'))) {
94
        return false;
95
    }
96
    @fwrite($fh, $fd, strlen($fd));
97
    @fflush($fh);
98
    @fclose($fh);
99
100
    return true;
101
}
102
103
///////////////////////////////////////////////////////////////////////////////////////////////////
104
@@ 111-130 (lines=20) @@
108
 * @param  int  $bgColor
109
 * @return bool
110
 */
111
function gif_outputAsPng($gif, $lpszFileName, $bgColor = -1)
112
{
113
    if (!isset($gif) || (@get_class($gif) <> 'cgif') || !$gif->loaded() || ($lpszFileName == '')) {
114
        return false;
115
    }
116
117
    $fd = $gif->getPng($bgColor);
118
    if (strlen($fd) <= 0) {
119
        return false;
120
    }
121
122
    if (!($fh = @fopen($lpszFileName, 'wb'))) {
123
        return false;
124
    }
125
    @fwrite($fh, $fd, strlen($fd));
126
    @fflush($fh);
127
    @fclose($fh);
128
129
    return true;
130
}
131
132
///////////////////////////////////////////////////////////////////////////////////////////////////
133