Alien-FreeImage

 view release on metacpan or  search on metacpan

src/Source/LibOpenJPEG/j2k.c  view on Meta::CPAN

                        return OPJ_FALSE;
                }
                opj_read_bytes(p_header_data,&l_comp_no,2);
                p_header_data+=2;
                p_header_size-=2;
        }

#ifdef USE_JPWL
        if (p_j2k->m_cp.correct) {

                static OPJ_UINT32 backup_compno = 0;

                /* compno is negative or larger than the number of components!!! */
                if (/*(l_comp_no < 0) ||*/ (l_comp_no >= l_num_comp)) {
                        opj_event_msg(p_manager, EVT_ERROR,
                                "JPWL: bad component number in QCC (%d out of a maximum of %d)\n",
                                l_comp_no, l_num_comp);
                        if (!JPWL_ASSUME) {
                                opj_event_msg(p_manager, EVT_ERROR, "JPWL: giving up\n");
                                return OPJ_FALSE;
                        }
                        /* we try to correct */
                        l_comp_no = backup_compno % l_num_comp;
                        opj_event_msg(p_manager, EVT_WARNING, "- trying to adjust this\n"
                                "- setting component number to %d\n",
                                l_comp_no);
                }

                /* keep your private count of tiles */
                backup_compno++;
        };
#endif /* USE_JPWL */

        if (l_comp_no >= p_j2k->m_private_image->numcomps) {
                opj_event_msg(p_manager, EVT_ERROR,
                              "Invalid component number: %d, regarding the number of components %d\n",
                              l_comp_no, p_j2k->m_private_image->numcomps);
                return OPJ_FALSE;
        }

src/Source/LibOpenJPEG/j2k.c  view on Meta::CPAN

        }

        l_tcp = &l_cp->tcps[p_j2k->m_current_tile_number];
        l_tile_x = p_j2k->m_current_tile_number % l_cp->tw;
        l_tile_y = p_j2k->m_current_tile_number / l_cp->tw;

#ifdef USE_JPWL
        if (l_cp->correct) {

                OPJ_UINT32 tileno = p_j2k->m_current_tile_number;
                static OPJ_UINT32 backup_tileno = 0;

                /* tileno is negative or larger than the number of tiles!!! */
                if (tileno > (l_cp->tw * l_cp->th)) {
                        opj_event_msg(p_manager, EVT_ERROR,
                                        "JPWL: bad tile number (%d out of a maximum of %d)\n",
                                        tileno, (l_cp->tw * l_cp->th));
                        if (!JPWL_ASSUME) {
                                opj_event_msg(p_manager, EVT_ERROR, "JPWL: giving up\n");
                                return OPJ_FALSE;
                        }
                        /* we try to correct */
                        tileno = backup_tileno;
                        opj_event_msg(p_manager, EVT_WARNING, "- trying to adjust this\n"
                                        "- setting tile number to %d\n",
                                        tileno);
                }

                /* keep your private count of tiles */
                backup_tileno++;
        };
#endif /* USE_JPWL */

        /* look for the tile in the list of already processed tile (in parts). */
        /* Optimization possible here with a more complex data structure and with the removing of tiles */
        /* since the time taken by this function can only grow at the time */

        opj_read_bytes(p_header_data,&l_tot_len,4);             /* Psot */
        p_header_data+=4;

src/Source/LibTIFF4/tif_read.c  view on Meta::CPAN

                if( ((tif->tif_rawdata + tif->tif_rawdataloaded) - tif->tif_rawcp) < read_ahead 
                    && (uint64) tif->tif_rawdataoff+tif->tif_rawdataloaded < td->td_stripbytecount[strip] )
                {
                        if( !TIFFFillStripPartial(tif,strip,read_ahead,0) )
                                return 0;
                }
        }

        if (row < tif->tif_row) {
		/*
		 * Moving backwards within the same strip: backup
		 * to the start and then decode forward (below).
		 *
		 * NB: If you're planning on lots of random access within a
		 * strip, it's better to just read and decode the entire
		 * strip, and then access the decoded data in a random fashion.
		 */

                if( tif->tif_rawdataoff != 0 )
                {
                        if( !TIFFFillStripPartial(tif,strip,read_ahead,1) )

src/Source/LibTIFF4/tif_write.c  view on Meta::CPAN

	}
	/*
	 * Ensure the write is either sequential or at the
	 * beginning of a strip (or that we can randomly
	 * access the data -- i.e. no encoding).
	 */
	if (row != tif->tif_row) {
		if (row < tif->tif_row) {
			/*
			 * Moving backwards within the same strip:
			 * backup to the start and then decode
			 * forward (below).
			 */
			tif->tif_row = (strip % td->td_stripsperimage) *
			    td->td_rowsperstrip;
			tif->tif_rawcp = tif->tif_rawdata;
		}
		/*
		 * Seek forward to the desired row.
		 */
		if (!(*tif->tif_seek)(tif, row - tif->tif_row))



( run in 1.530 second using v1.01-cache-2.11-cpan-49f99fa48dc )