typedef unsigned char uchar;
-#ifndef TRUE
-# define TRUE 1
-# define FALSE 0
-#endif
-
#ifndef max
# define max(a,b) ((a)>(b) ? (a) : (b))
#endif
/* {{{ exif_file_section_free
Discard all file_sections in ImageInfo
*/
-static int exif_file_sections_free(image_info_type *ImageInfo)
+static bool exif_file_sections_free(image_info_type *ImageInfo)
{
int i;
}
EFREE_IF(ImageInfo->file.list);
ImageInfo->file.count = 0;
- return TRUE;
+ return true;
}
/* }}} */
/* }}} */
/* forward declarations */
-static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start, const exif_offset_info *info, size_t displacement, int section_index, int tag);
-static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, const exif_offset_info *info, size_t displacement, int section_index, int ReadNextIFD, tag_table_type tag_table);
+static bool exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start, const exif_offset_info *info, size_t displacement, int section_index, int tag);
+static bool exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, const exif_offset_info *info, size_t displacement, int section_index, int ReadNextIFD, tag_table_type tag_table);
/* {{{ exif_get_markername
Get name of marker */
/* {{{ exif_process_IFD_in_MAKERNOTE
* Process nested IFDs directories in Maker Note. */
-static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * value_ptr, int value_len, const exif_offset_info *info, size_t displacement)
+static bool exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * value_ptr, int value_len, const exif_offset_info *info, size_t displacement)
{
size_t i;
int de, section_index = SECTION_MAKERNOTE;
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "No maker note data found. Detected maker: %s (length = %d)", ImageInfo->make, strlen(ImageInfo->make));
#endif
/* unknown manufacturer, not an error, use it as a string */
- return TRUE;
+ return true;
}
maker_note = maker_note_array+i;
if (value_len < 2 || maker_note->offset >= value_len - 1) {
/* Do not go past the value end */
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "IFD data too short: 0x%04X offset 0x%04X", value_len, maker_note->offset);
- return TRUE;
+ return true;
}
dir_start = value_ptr + maker_note->offset;
if ((2+NumDirEntries*12) > value_len) {
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD size: 2 + 0x%04X*12 = 0x%04X > 0x%04X", NumDirEntries, 2+NumDirEntries*12, value_len);
- return FALSE;
+ return false;
}
if ((dir_start - value_ptr) > value_len - (2+NumDirEntries*12)) {
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD size: 0x%04X > 0x%04X", (dir_start - value_ptr) + (2+NumDirEntries*12), value_len);
- return FALSE;
+ return false;
}
for (de=0;de<NumDirEntries;de++) {
size_t offset = 2 + 12 * de;
if (!exif_process_IFD_TAG(ImageInfo, dir_start + offset,
info, displacement, section_index, 0, maker_note->tag_table)) {
- return FALSE;
+ return false;
}
}
ImageInfo->motorola_intel = old_motorola_intel;
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Subsection %s done", exif_get_sectionname(SECTION_MAKERNOTE));
#endif
- return TRUE;
+ return true;
}
/* }}} */
#define REQUIRE_NON_EMPTY() do { \
if (byte_count == 0) { \
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Cannot be empty", tag, exif_get_tagname_debug(tag, tag_table)); \
- return FALSE; \
+ return false; \
} \
} while (0)
/* {{{ exif_process_IFD_TAG
* Process one of the nested IFDs directories. */
-static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, const exif_offset_info *info, size_t displacement, int section_index, int ReadNextIFD, tag_table_type tag_table)
+static bool exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, const exif_offset_info *info, size_t displacement, int section_index, int ReadNextIFD, tag_table_type tag_table)
{
size_t length;
unsigned int tag, format, components;
/* Protect against corrupt headers */
if (ImageInfo->ifd_nesting_level > MAX_IFD_NESTING_LEVEL) {
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "corrupt EXIF header: maximum directory nesting level reached");
- return FALSE;
+ return false;
}
ImageInfo->ifd_nesting_level++;
if (byte_count_signed < 0 || (byte_count_signed > INT32_MAX)) {
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal byte_count", tag, exif_get_tagname_debug(tag, tag_table));
- return FALSE;
+ return false;
}
byte_count = (size_t)byte_count_signed;
// TODO: Shouldn't we also be taking "displacement" into account here?
if (byte_count > ImageInfo->FileSize || offset_val>ImageInfo->FileSize-byte_count || (ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_II && ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_MM && ImageInfo->FileType!=IMAGE_FILETYPE_JPEG)) {
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal pointer offset(x%04X + x%04X = x%04X > x%04X)", tag, exif_get_tagname_debug(tag, tag_table), offset_val, byte_count, offset_val+byte_count, ImageInfo->FileSize);
- return FALSE;
+ return false;
}
if (byte_count>sizeof(cbuf)) {
/* mark as outside range and get buffer */
if (fgot!=displacement+offset_val) {
EFREE_IF(outside);
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Wrong file pointer: 0x%08X != 0x%08X", fgot, displacement+offset_val);
- return FALSE;
+ return false;
}
fgot = php_stream_read(ImageInfo->infile, value_ptr, byte_count);
php_stream_seek(ImageInfo->infile, fpos, SEEK_SET);
if (fgot != byte_count) {
EFREE_IF(outside);
EXIF_ERRLOG_FILEEOF(ImageInfo)
- return FALSE;
+ return false;
}
}
} else {
case TAG_MAKER_NOTE:
if (!exif_process_IFD_in_MAKERNOTE(ImageInfo, value_ptr, byte_count, info, displacement)) {
EFREE_IF(outside);
- return FALSE;
+ return false;
}
break;
if (!Subdir_start) {
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD Pointer");
EFREE_IF(outside);
- return FALSE;
+ return false;
}
if (!exif_process_IFD_in_JPEG(ImageInfo, Subdir_start, info, displacement, sub_section_index, tag)) {
EFREE_IF(outside);
- return FALSE;
+ return false;
}
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Subsection %s done", exif_get_sectionname(sub_section_index));
}
exif_iif_add_tag(ImageInfo, section_index, exif_get_tagname_key(tag, tagname, sizeof(tagname), tag_table), tag, format, components, value_ptr, byte_count);
EFREE_IF(outside);
- return TRUE;
+ return true;
}
/* }}} */
/* {{{ exif_process_IFD_in_JPEG
* Process one of the nested IFDs directories. */
-static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start, const exif_offset_info *info, size_t displacement, int section_index, int tag)
+static bool exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start, const exif_offset_info *info, size_t displacement, int section_index, int tag)
{
int de;
int NumDirEntries;
if (!exif_offset_info_contains(info, dir_start, 2)) {
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD size");
- return FALSE;
+ return false;
}
NumDirEntries = php_ifd_get16u(dir_start, ImageInfo->motorola_intel);
if (!exif_offset_info_contains(info, dir_start+2, NumDirEntries*12)) {
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD size: x%04X + 2 + x%04X*12 = x%04X > x%04X", (int)((size_t)dir_start+2-(size_t)info->valid_start), NumDirEntries, (int)((size_t)dir_start+2+NumDirEntries*12-(size_t)info->valid_start), info->valid_end - info->valid_start);
- return FALSE;
+ return false;
}
for (de=0;de<NumDirEntries;de++) {
if (!exif_process_IFD_TAG(ImageInfo, dir_start + 2 + 12 * de,
info, displacement, section_index, 1, exif_get_tag_table(section_index))) {
- return FALSE;
+ return false;
}
}
/*
* Ignore IFD2 if it purportedly exists
*/
if (section_index == SECTION_THUMBNAIL) {
- return TRUE;
+ return true;
}
/*
* Hack to make it process IDF1 I hope
*/
if (!exif_offset_info_contains(info, dir_start+2+NumDirEntries*12, 4)) {
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD size");
- return FALSE;
+ return false;
}
if (tag != TAG_EXIF_IFD_POINTER && tag != TAG_GPS_IFD_POINTER) {
char *next_dir_start = exif_offset_info_try_get(info, NextDirOffset, 0);
if (!next_dir_start) {
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD offset");
- return FALSE;
+ return false;
}
/* That is the IFD for the first thumbnail */
#ifdef EXIF_DEBUG
) {
exif_thumbnail_extract(ImageInfo, info);
}
- return TRUE;
+ return true;
} else {
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
/* }}} */
/* {{{ exif_scan_JPEG_header
* Parse the marker stream until SOS or EOI is seen; */
-static int exif_scan_JPEG_header(image_info_type *ImageInfo)
+static bool exif_scan_JPEG_header(image_info_type *ImageInfo)
{
int section, sn;
int marker = 0, last_marker = M_PSEUDO, comment_correction=1;
do {
if ((marker = php_stream_getc(ImageInfo->infile)) == EOF) {
EXIF_ERRLOG_CORRUPT(ImageInfo)
- return FALSE;
+ return false;
}
if (last_marker==M_COM && comment_correction>0) {
if (marker!=0xFF) {
if (marker == 0xff) {
/* 0xff is legal padding, but if we get that many, something's wrong. */
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "To many padding bytes");
- return FALSE;
+ return false;
}
/* Read the length of the section. */
if ((lh = php_stream_getc(ImageInfo->infile)) == (unsigned int)EOF) {
EXIF_ERRLOG_CORRUPT(ImageInfo)
- return FALSE;
+ return false;
}
if ((ll = php_stream_getc(ImageInfo->infile)) == (unsigned int)EOF) {
EXIF_ERRLOG_CORRUPT(ImageInfo)
- return FALSE;
+ return false;
}
itemlen = (lh << 8) | ll;
#else
EXIF_ERRLOG_CORRUPT(ImageInfo)
#endif
- return FALSE;
+ return false;
}
sn = exif_file_sections_add(ImageInfo, marker, itemlen, NULL);
got = php_stream_read(ImageInfo->infile, (char*)(Data+2), itemlen-2); /* Read the whole section. */
if (got != itemlen-2) {
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Error reading from file: got=x%04X(=%d) != itemlen-2=x%04X(=%d)", got, got, itemlen-2, itemlen-2);
- return FALSE;
+ return false;
}
#ifdef EXIF_DEBUG
got = php_stream_read(ImageInfo->infile, (char*)Data, size);
if (got != size) {
EXIF_ERRLOG_FILEEOF(ImageInfo)
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
case M_EOI: /* in case it's a tables-only JPEG stream */
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "No image in jpeg!");
- return (ImageInfo->sections_found&(~FOUND_COMPUTED)) ? TRUE : FALSE;
+ return (ImageInfo->sections_found&(~FOUND_COMPUTED)) ? true : false;
case M_COM: /* Comment section */
exif_process_COM(ImageInfo, (char *)Data, itemlen);
case M_SOF14:
case M_SOF15:
if ((itemlen - 2) < 6) {
- return FALSE;
+ return false;
}
exif_process_SOFn(Data, marker, &sof_info);
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Done");
#endif
- return TRUE;
+ return true;
}
/* }}} */
/* {{{ exif_scan_thumbnail
* scan JPEG in thumbnail (memory) */
-static int exif_scan_thumbnail(image_info_type *ImageInfo)
+static bool exif_scan_thumbnail(image_info_type *ImageInfo)
{
uchar c, *data = (uchar*)ImageInfo->Thumbnail.data;
int n, marker;
jpeg_sof_info sof_info;
if (!data || ImageInfo->Thumbnail.size < 4) {
- return FALSE; /* nothing to do here */
+ return false; /* nothing to do here */
}
if (memcmp(data, "\xFF\xD8\xFF", 3)) {
if (!ImageInfo->Thumbnail.width && !ImageInfo->Thumbnail.height) {
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Thumbnail is not a JPEG image");
}
- return FALSE;
+ return false;
}
for (;;) {
pos += length;
if (pos>=ImageInfo->Thumbnail.size)
- return FALSE;
+ return false;
c = data[pos++];
if (pos>=ImageInfo->Thumbnail.size)
- return FALSE;
+ return false;
if (c != 0xFF) {
- return FALSE;
+ return false;
}
n = 8;
while ((c = data[pos++]) == 0xFF && n--) {
if (pos+3>=ImageInfo->Thumbnail.size)
- return FALSE;
+ return false;
/* +3 = pos++ of next check when reaching marker + 2 bytes for length */
}
if (c == 0xFF)
- return FALSE;
+ return false;
marker = c;
if (pos>=ImageInfo->Thumbnail.size)
- return FALSE;
+ return false;
length = php_jpg_get16(data+pos);
if (length > ImageInfo->Thumbnail.size || pos >= ImageInfo->Thumbnail.size - length) {
- return FALSE;
+ return false;
}
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail: process section(x%02X=%s) @ x%04X + x%04X", marker, exif_get_markername(marker), pos, length);
/* handle SOFn block */
if (length < 8 || ImageInfo->Thumbnail.size - 8 < pos) {
/* exif_process_SOFn needs 8 bytes */
- return FALSE;
+ return false;
}
exif_process_SOFn(data+pos, marker, &sof_info);
ImageInfo->Thumbnail.height = sof_info.height;
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail: size: %d * %d", sof_info.width, sof_info.height);
#endif
- return TRUE;
+ return true;
case M_SOS:
case M_EOI:
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Could not compute size of thumbnail");
- return FALSE;
+ return false;
break;
default:
}
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Could not compute size of thumbnail");
- return FALSE;
+ return false;
}
/* }}} */
/* {{{ exif_process_IFD_in_TIFF
* Parse the TIFF header; */
-static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offset, int section_index)
+static bool exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offset, int section_index)
{
int i, sn, num_entries, sub_section_index = 0;
unsigned char *dir_entry;
tag_table_type tag_table = exif_get_tag_table(section_index);
if (ImageInfo->ifd_nesting_level > MAX_IFD_NESTING_LEVEL) {
- return FALSE;
+ return false;
}
if (ImageInfo->FileSize >= 2 && ImageInfo->FileSize - 2 >= dir_offset) {
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read from TIFF: filesize(x%04X), IFD dir(x%04X + x%04X), IFD entries(%d)", ImageInfo->FileSize, dir_offset+2, dir_size-2, num_entries);
#endif
if (exif_file_sections_realloc(ImageInfo, sn, dir_size)) {
- return FALSE;
+ return false;
}
php_stream_read(ImageInfo->infile, (char*)(ImageInfo->file.list[sn].data+2), dir_size-2);
next_offset = php_ifd_get32u(ImageInfo->file.list[sn].data + dir_size - 4, ImageInfo->motorola_intel);
if (ifd_size > dir_size) {
if (ImageInfo->FileSize < ifd_size || dir_offset > ImageInfo->FileSize - ifd_size) {
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Error in TIFF: filesize(x%04X) less than size of IFD(x%04X + x%04X)", ImageInfo->FileSize, dir_offset, ifd_size);
- return FALSE;
+ return false;
}
if (exif_file_sections_realloc(ImageInfo, sn, ifd_size)) {
- return FALSE;
+ return false;
}
/* read values not stored in directory itself */
#ifdef EXIF_DEBUG
(char *) ImageInfo->file.list[sn].data, ifd_size);
if (!exif_process_IFD_TAG(ImageInfo, (char*)dir_entry, &info,
0, section_index, 0, tag_table)) {
- return FALSE;
+ return false;
}
}
}
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read next IFD (THUMBNAIL) done");
#endif
}
- return TRUE;
+ return true;
} else {
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Error in TIFF: filesize(x%04X) less than size of IFD(x%04X)", ImageInfo->FileSize, dir_offset+ImageInfo->file.list[sn].size);
- return FALSE;
+ return false;
}
} else {
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Error in TIFF: filesize(x%04X) less than size of IFD dir(x%04X)", ImageInfo->FileSize, dir_offset+dir_size);
- return FALSE;
+ return false;
}
} else {
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Error in TIFF: filesize(x%04X) less than start of IFD dir(x%04X)", ImageInfo->FileSize, dir_offset+2);
- return FALSE;
+ return false;
}
}
/* }}} */
/* {{{ exif_scan_FILE_header
* Parse the marker stream until SOS or EOI is seen; */
-static int exif_scan_FILE_header(image_info_type *ImageInfo)
+static bool exif_scan_FILE_header(image_info_type *ImageInfo)
{
unsigned char file_header[8];
- int ret = FALSE;
+ bool ret = false;
ImageInfo->FileType = IMAGE_FILETYPE_UNKNOWN;
if (ImageInfo->FileSize >= 2) {
php_stream_seek(ImageInfo->infile, 0, SEEK_SET);
if (php_stream_read(ImageInfo->infile, (char*)file_header, 2) != 2) {
- return FALSE;
+ return false;
}
if ((file_header[0]==0xff) && (file_header[1]==M_SOI)) {
ImageInfo->FileType = IMAGE_FILETYPE_JPEG;
if (exif_scan_JPEG_header(ImageInfo)) {
- ret = TRUE;
+ ret = true;
} else {
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Invalid JPEG file");
}
} else if (ImageInfo->FileSize >= 8) {
if (php_stream_read(ImageInfo->infile, (char*)(file_header+2), 6) != 6) {
- return FALSE;
+ return false;
}
if (!memcmp(file_header, "II\x2A\x00", 4)) {
ImageInfo->FileType = IMAGE_FILETYPE_TIFF_II;
if (exif_process_IFD_in_TIFF(ImageInfo,
php_ifd_get32u(file_header + 4, ImageInfo->motorola_intel),
SECTION_IFD0)) {
- ret = TRUE;
+ ret = true;
} else {
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Invalid TIFF file");
}
if (exif_process_IFD_in_TIFF(ImageInfo,
php_ifd_get32u(file_header + 4, ImageInfo->motorola_intel),
SECTION_IFD0)) {
- ret = TRUE;
+ ret = true;
} else {
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Invalid TIFF file");
}
} else {
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "File not supported");
- return FALSE;
+ return false;
}
}
} else {
/* {{{ exif_discard_imageinfo
Discard data scanned by exif_read_file.
*/
-static int exif_discard_imageinfo(image_info_type *ImageInfo)
+static bool exif_discard_imageinfo(image_info_type *ImageInfo)
{
int i;
}
exif_file_sections_free(ImageInfo);
memset(ImageInfo, 0, sizeof(*ImageInfo));
- return TRUE;
+ return true;
}
/* }}} */
/* {{{ exif_read_from_impl
*/
-static int exif_read_from_impl(image_info_type *ImageInfo, php_stream *stream, int read_thumbnail, int read_all)
+static bool exif_read_from_impl(image_info_type *ImageInfo, php_stream *stream, int read_thumbnail, int read_all)
{
- int ret;
+ bool ret;
zend_stat_t st;
/* Start with an empty image information structure. */
if ((st.st_mode & S_IFMT) != S_IFREG) {
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Not a file");
ImageInfo->infile = NULL;
- return FALSE;
+ return false;
}
/* Store file name */
/* {{{ exif_read_from_stream
*/
-static int exif_read_from_stream(image_info_type *ImageInfo, php_stream *stream, int read_thumbnail, int read_all)
+static bool exif_read_from_stream(image_info_type *ImageInfo, php_stream *stream, int read_thumbnail, int read_all)
{
- int ret;
+ bool ret;
off_t old_pos = php_stream_tell(stream);
if (old_pos) {
/* {{{ exif_read_from_file
*/
-static int exif_read_from_file(image_info_type *ImageInfo, char *FileName, int read_thumbnail, int read_all)
+static bool exif_read_from_file(image_info_type *ImageInfo, char *FileName, int read_thumbnail, int read_all)
{
- int ret;
+ bool ret;
php_stream *stream;
stream = php_stream_open_wrapper(FileName, "rb", STREAM_MUST_SEEK | IGNORE_PATH, NULL);
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Unable to open file");
- return FALSE;
+ return false;
}
ret = exif_read_from_stream(ImageInfo, stream, read_thumbnail, read_all);
zend_string *z_sections_needed = NULL;
zend_bool sub_arrays = 0, read_thumbnail = 0, read_all = 0;
zval *stream;
- int i, ret, sections_needed = 0;
+ bool ret;
+ int i, sections_needed = 0;
image_info_type ImageInfo;
char tmp[64], *sections_str, *s;
ImageInfo.sections_found |= FOUND_COMPUTED|FOUND_FILE;/* do not inform about in debug*/
- if (ret == FALSE || (sections_needed && !(sections_needed&ImageInfo.sections_found))) {
+ if (ret == false || (sections_needed && !(sections_needed&ImageInfo.sections_found))) {
/* array_init must be checked at last! otherwise the array must be freed if a later test fails. */
exif_discard_imageinfo(&ImageInfo);
EFREE_IF(sections_str);
Reads the embedded thumbnail */
PHP_FUNCTION(exif_thumbnail)
{
- int ret, arg_c = ZEND_NUM_ARGS();
+ bool ret;
+ int arg_c = ZEND_NUM_ARGS();
image_info_type ImageInfo;
zval *stream;
zval *z_width = NULL, *z_height = NULL, *z_imagetype = NULL;
ret = exif_read_from_file(&ImageInfo, Z_STRVAL_P(stream), 1, 0);
}
- if (ret == FALSE) {
+ if (ret == false) {
exif_discard_imageinfo(&ImageInfo);
RETURN_FALSE;
}