~ubuntu-branches/ubuntu/trusty/digikam/trusty

« back to all changes in this revision

Viewing changes to extra/libkdcraw/libraw/internal/dcraw_fileio.cpp

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2012-09-27 21:41:30 UTC
  • mfrom: (1.2.43)
  • mto: This revision was merged to the branch mainline in revision 86.
  • Revision ID: package-import@ubuntu.com-20120927214130-i8v3ufr21nesp29i
Tags: 4:3.0.0~beta1a-1
* New upstream release

* Fix "wrongly conflicts phonon-backend-vlc" dropped (Closes: #688142)
* debian/watch include download.kde.org

* digikam 3.0.0 uses features from unreleased kdegraphics >=4.10 & ships 
a private version of the kdegraphics libs - this is not the Debian way :-(
* Unsatisfactory Conflicts: libkipi8, libkexiv2-10, libkdcraw20, libksane0
* Suspend digikam-dbg >130Mb

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#include "libraw/libraw.h"
29
29
#include "internal/defines.h"
30
30
#include "internal/var_defines.h"
31
 
 
32
31
/*
33
32
   Seach from the current directory up to the root looking for
34
33
   a ".badpixels" file, and fix those pixels now.
35
34
 */
36
35
void CLASS bad_pixels (const char *cfname)
37
36
{
38
 
  FILE *fp=0;
 
37
  FILE *fp=NULL;
39
38
#ifndef LIBRAW_LIBRARY_BUILD
40
39
  char *fname, *cp, line[128];
41
40
  int len, time, row, col, r, c, rad, tot, n, fixed=0;
53
52
#endif
54
53
  if (cfname)
55
54
    fp = fopen (cfname, "r");
56
 
  if (!fp) 
 
55
  if (!fp)
57
56
      {
58
57
#ifdef LIBRAW_LIBRARY_BUILD
59
58
          imgdata.process_warnings |= LIBRAW_WARN_NO_BADPIXELMAP;
70
69
      for (r = row-rad; r <= row+rad; r++)
71
70
        for (c = col-rad; c <= col+rad; c++)
72
71
          if ((unsigned) r < height && (unsigned) c < width &&
73
 
                (r != row || c != col) && fc(r,c) == fc(row,col)) {
 
72
                (r != row || c != col) && fcol(r,c) == fcol(row,col)) {
74
73
            tot += BAYER2(r,c);
75
74
            n++;
76
75
          }
124
123
    }
125
124
  }
126
125
  if (error || nd < 3) {
 
126
#ifdef DCRAW_VERBOSE
127
127
    fprintf (stderr,_("%s is not a valid PGM file!\n"), fname);
 
128
#endif
128
129
    fclose (fp);  return;
129
130
  } else if (dim[0] != width || dim[1] != height || dim[2] != 65535) {
130
131
#ifdef DCRAW_VERBOSE
150
151
  RUN_CALLBACK(LIBRAW_PROGRESS_DARK_FRAME,1,2);
151
152
#endif
152
153
}
153
 
 
154
154
#ifndef NO_LCMS
155
155
void CLASS apply_profile (const char *input, const char *output)
156
156
{
177
177
    hInProfile = cmsOpenProfileFromMem (imgdata.color.profile, profile_length);
178
178
#endif
179
179
  } else
180
 
      {
 
180
    {
181
181
#ifdef LIBRAW_LIBRARY_BUILD
182
182
          imgdata.process_warnings |= LIBRAW_WARN_NO_EMBEDDED_PROFILE;
183
183
#endif
184
184
#ifdef DCRAW_VERBOSE
185
185
          fprintf (stderr,_("%s has no embedded profile.\n"), ifname);
186
186
#endif
187
 
      }
 
187
    }
188
188
  if (!hInProfile)
189
189
      {
190
190
#ifdef LIBRAW_LIBRARY_BUILD
205
205
      free (oprof);
206
206
      oprof = 0;
207
207
    }
 
208
  }
208
209
#ifdef DCRAW_VERBOSE
209
 
  } else
 
210
 else
210
211
    fprintf (stderr,_("Cannot open file %s!\n"), output);
211
 
#else
212
 
}
213
212
#endif
214
213
  if (!hOutProfile)
215
214
      {