<commit_before>/******************************************************************************
  images.c

  Change Control:                                                      DDMMYYYY
    <NAME>    File created                                      29072000

  Purpose:
    Image insertion is all handled by one fuction, which then goes off and
    calls the functions that know about particular image types...
******************************************************************************/

#include "constants.h"
#include "functions.h"
#include <tiffio.h>

// A redistribution point for image insertions based on type of image
void imagebox(pdf *output, page *target, int top, int left,
  int bottom, int right, char *filename, int type){

#if defined DEBUG
  printf("Started inserting an image.\n");
#endif

  // We simply call the right function for that image type
  switch(type){
  case gImageTiff:
    insertTiff(output, target, top, left, bottom, right, filename);
    break;
  }

#if defined DEBUG
  printf("Finished inserting an image.\n");
#endif
}

// This function will insert a TIFF image into a PDF
void insertTiff(pdf *output, page *target, int top, int left, 
  int bottom, int right, char *filename){
  TIFF          *image;
  object        *imageObj, *subdict, *xobjrefsubdict, *xobjrefsubsubdict;
  int           stripCount;
  tsize_t       stripSize;
  unsigned long imageOffset;
  char          *tempstream, xobjstr[255];
  uint16        tiffResponse16;<commit_msg>Mikal: Removed an unused variable defn<commit_after>/******************************************************************************
  images.c

  Change Control:                                                      DDMMYYYY
    <NAME>    File created                                      29072000

  Purpose:
    Image insertion is all handled by one fuction, which then goes off and
    calls the functions that know about particular image types...
******************************************************************************/

#include "constants.h"
#include "functions.h"
#include <tiffio.h>

// A redistribution point for image insertions based on type of image
void imagebox(pdf *output, page *target, int top, int left,
  int bottom, int right, char *filename, int type){

#if defined DEBUG
  printf("Started inserting an image.\n");
#endif

  // We simply call the right function for that image type
  switch(type){
  case gImageTiff:
    insertTiff(output, target, top, left, bottom, right, filename);
    break;
  }

#if defined DEBUG
  printf("Finished inserting an image.\n");
#endif
}

// This function will insert a TIFF image into a PDF
void insertTiff(pdf *output, page *target, int top, int left, 
  int bottom, int right, char *filename){
  TIFF          *image;
  object        *imageObj, *subdict, *xobjrefsubdict, *xobjrefsubsubdict;
  int           stripCount;
  tsize_t       stripSize;
  unsigned long imageOffset;
  char          *tempstream;
  uint16        tiffResponse16;
{'fraction_non_alphanumeric': 0.17731682837069254, 'fraction_numerical': 0.009033121445299431, 'mean_word_length': 2.9393939393939394, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3759426', 'n_tokens_mistral': 813, 'n_tokens_neox': 761, 'n_words': 297}