Conditions | 3 |
Paths | 4 |
Total Lines | 241 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
270 | public function TIFFcommentName($id) { |
||
271 | // https://www.awaresystems.be/imaging/tiff/tifftags.html |
||
272 | static $TIFFcommentName = array(); |
||
273 | if (empty($TIFFcommentName)) { |
||
274 | $TIFFcommentName = array( |
||
275 | 254 => 'NewSubfileType', |
||
276 | 255 => 'SubfileType', |
||
277 | 256 => 'ImageWidth', |
||
278 | 257 => 'ImageLength', |
||
279 | 258 => 'BitsPerSample', |
||
280 | 259 => 'Compression', |
||
281 | 262 => 'PhotometricInterpretation', |
||
282 | 263 => 'Threshholding', |
||
283 | 264 => 'CellWidth', |
||
284 | 265 => 'CellLength', |
||
285 | 266 => 'FillOrder', |
||
286 | 269 => 'DocumentName', |
||
287 | 270 => 'ImageDescription', |
||
288 | 271 => 'Make', |
||
289 | 272 => 'Model', |
||
290 | 273 => 'StripOffsets', |
||
291 | 274 => 'Orientation', |
||
292 | 277 => 'SamplesPerPixel', |
||
293 | 278 => 'RowsPerStrip', |
||
294 | 279 => 'StripByteCounts', |
||
295 | 280 => 'MinSampleValue', |
||
296 | 281 => 'MaxSampleValue', |
||
297 | 282 => 'XResolution', |
||
298 | 283 => 'YResolution', |
||
299 | 284 => 'PlanarConfiguration', |
||
300 | 285 => 'PageName', |
||
301 | 286 => 'XPosition', |
||
302 | 287 => 'YPosition', |
||
303 | 288 => 'FreeOffsets', |
||
304 | 289 => 'FreeByteCounts', |
||
305 | 290 => 'GrayResponseUnit', |
||
306 | 291 => 'GrayResponseCurve', |
||
307 | 292 => 'T4Options', |
||
308 | 293 => 'T6Options', |
||
309 | 296 => 'ResolutionUnit', |
||
310 | 297 => 'PageNumber', |
||
311 | 301 => 'TransferFunction', |
||
312 | 305 => 'Software', |
||
313 | 306 => 'DateTime', |
||
314 | 315 => 'Artist', |
||
315 | 316 => 'HostComputer', |
||
316 | 317 => 'Predictor', |
||
317 | 318 => 'WhitePoint', |
||
318 | 319 => 'PrimaryChromaticities', |
||
319 | 320 => 'ColorMap', |
||
320 | 321 => 'HalftoneHints', |
||
321 | 322 => 'TileWidth', |
||
322 | 323 => 'TileLength', |
||
323 | 324 => 'TileOffsets', |
||
324 | 325 => 'TileByteCounts', |
||
325 | 326 => 'BadFaxLines', |
||
326 | 327 => 'CleanFaxData', |
||
327 | 328 => 'ConsecutiveBadFaxLines', |
||
328 | 330 => 'SubIFDs', |
||
329 | 332 => 'InkSet', |
||
330 | 333 => 'InkNames', |
||
331 | 334 => 'NumberOfInks', |
||
332 | 336 => 'DotRange', |
||
333 | 337 => 'TargetPrinter', |
||
334 | 338 => 'ExtraSamples', |
||
335 | 339 => 'SampleFormat', |
||
336 | 340 => 'SMinSampleValue', |
||
337 | 341 => 'SMaxSampleValue', |
||
338 | 342 => 'TransferRange', |
||
339 | 343 => 'ClipPath', |
||
340 | 344 => 'XClipPathUnits', |
||
341 | 345 => 'YClipPathUnits', |
||
342 | 346 => 'Indexed', |
||
343 | 347 => 'JPEGTables', |
||
344 | 351 => 'OPIProxy', |
||
345 | 400 => 'GlobalParametersIFD', |
||
346 | 401 => 'ProfileType', |
||
347 | 402 => 'FaxProfile', |
||
348 | 403 => 'CodingMethods', |
||
349 | 404 => 'VersionYear', |
||
350 | 405 => 'ModeNumber', |
||
351 | 433 => 'Decode', |
||
352 | 434 => 'DefaultImageColor', |
||
353 | 512 => 'JPEGProc', |
||
354 | 513 => 'JPEGInterchangeFormat', |
||
355 | 514 => 'JPEGInterchangeFormatLngth', |
||
356 | 515 => 'JPEGRestartInterval', |
||
357 | 517 => 'JPEGLosslessPredictors', |
||
358 | 518 => 'JPEGPointTransforms', |
||
359 | 519 => 'JPEGQTables', |
||
360 | 520 => 'JPEGDCTables', |
||
361 | 521 => 'JPEGACTables', |
||
362 | 529 => 'YCbCrCoefficients', |
||
363 | 530 => 'YCbCrSubSampling', |
||
364 | 531 => 'YCbCrPositioning', |
||
365 | 532 => 'ReferenceBlackWhite', |
||
366 | 559 => 'StripRowCounts', |
||
367 | 700 => 'XMP', |
||
368 | |||
369 | 32781 => 'ImageID', |
||
370 | 33432 => 'Copyright', |
||
371 | 34732 => 'ImageLayer', |
||
372 | |||
373 | // Private Tags - https://www.awaresystems.be/imaging/tiff/tifftags/private.html |
||
374 | 32932 => 'Wang Annotation', // Annotation data, as used in 'Imaging for Windows'. |
||
375 | 33445 => 'MD FileTag', // Specifies the pixel data format encoding in the Molecular Dynamics GEL file format. |
||
376 | 33446 => 'MD ScalePixel', // Specifies a scale factor in the Molecular Dynamics GEL file format. |
||
377 | 33447 => 'MD ColorTable', // Used to specify the conversion from 16bit to 8bit in the Molecular Dynamics GEL file format. |
||
378 | 33448 => 'MD LabName', // Name of the lab that scanned this file, as used in the Molecular Dynamics GEL file format. |
||
379 | 33449 => 'MD SampleInfo', // Information about the sample, as used in the Molecular Dynamics GEL file format. |
||
380 | 33450 => 'MD PrepDate', // Date the sample was prepared, as used in the Molecular Dynamics GEL file format. |
||
381 | 33451 => 'MD PrepTime', // Time the sample was prepared, as used in the Molecular Dynamics GEL file format. |
||
382 | 33452 => 'MD FileUnits', // Units for data in this file, as used in the Molecular Dynamics GEL file format. |
||
383 | 33550 => 'ModelPixelScaleTag', // Used in interchangeable GeoTIFF files. |
||
384 | 33723 => 'IPTC', // IPTC (International Press Telecommunications Council) metadata. |
||
385 | 33918 => 'INGR Packet Data Tag', // Intergraph Application specific storage. |
||
386 | 33919 => 'INGR Flag Registers', // Intergraph Application specific flags. |
||
387 | 33920 => 'IrasB Transformation Matrix', // Originally part of Intergraph's GeoTIFF tags, but likely understood by IrasB only. |
||
388 | 33922 => 'ModelTiepointTag', // Originally part of Intergraph's GeoTIFF tags, but now used in interchangeable GeoTIFF files. |
||
389 | 34264 => 'ModelTransformationTag', // Used in interchangeable GeoTIFF files. |
||
390 | 34377 => 'Photoshop', // Collection of Photoshop 'Image Resource Blocks'. |
||
391 | 34665 => 'Exif IFD', // A pointer to the Exif IFD. |
||
392 | 34675 => 'ICC Profile', // ICC profile data. |
||
393 | 34735 => 'GeoKeyDirectoryTag', // Used in interchangeable GeoTIFF files. |
||
394 | 34736 => 'GeoDoubleParamsTag', // Used in interchangeable GeoTIFF files. |
||
395 | 34737 => 'GeoAsciiParamsTag', // Used in interchangeable GeoTIFF files. |
||
396 | 34853 => 'GPS IFD', // A pointer to the Exif-related GPS Info IFD. |
||
397 | 34908 => 'HylaFAX FaxRecvParams', // Used by HylaFAX. |
||
398 | 34909 => 'HylaFAX FaxSubAddress', // Used by HylaFAX. |
||
399 | 34910 => 'HylaFAX FaxRecvTime', // Used by HylaFAX. |
||
400 | 37724 => 'ImageSourceData', // Used by Adobe Photoshop. |
||
401 | 40965 => 'Interoperability IFD', // A pointer to the Exif-related Interoperability IFD. |
||
402 | 42112 => 'GDAL_METADATA', // Used by the GDAL library, holds an XML list of name=value 'metadata' values about the image as a whole, and about specific samples. |
||
403 | 42113 => 'GDAL_NODATA', // Used by the GDAL library, contains an ASCII encoded nodata or background pixel value. |
||
404 | 50215 => 'Oce Scanjob Description', // Used in the Oce scanning process. |
||
405 | 50216 => 'Oce Application Selector', // Used in the Oce scanning process. |
||
406 | 50217 => 'Oce Identification Number', // Used in the Oce scanning process. |
||
407 | 50218 => 'Oce ImageLogic Characteristics', // Used in the Oce scanning process. |
||
408 | 50706 => 'DNGVersion', // Used in IFD 0 of DNG files. |
||
409 | 50707 => 'DNGBackwardVersion', // Used in IFD 0 of DNG files. |
||
410 | 50708 => 'UniqueCameraModel', // Used in IFD 0 of DNG files. |
||
411 | 50709 => 'LocalizedCameraModel', // Used in IFD 0 of DNG files. |
||
412 | 50710 => 'CFAPlaneColor', // Used in Raw IFD of DNG files. |
||
413 | 50711 => 'CFALayout', // Used in Raw IFD of DNG files. |
||
414 | 50712 => 'LinearizationTable', // Used in Raw IFD of DNG files. |
||
415 | 50713 => 'BlackLevelRepeatDim', // Used in Raw IFD of DNG files. |
||
416 | 50714 => 'BlackLevel', // Used in Raw IFD of DNG files. |
||
417 | 50715 => 'BlackLevelDeltaH', // Used in Raw IFD of DNG files. |
||
418 | 50716 => 'BlackLevelDeltaV', // Used in Raw IFD of DNG files. |
||
419 | 50717 => 'WhiteLevel', // Used in Raw IFD of DNG files. |
||
420 | 50718 => 'DefaultScale', // Used in Raw IFD of DNG files. |
||
421 | 50719 => 'DefaultCropOrigin', // Used in Raw IFD of DNG files. |
||
422 | 50720 => 'DefaultCropSize', // Used in Raw IFD of DNG files. |
||
423 | 50721 => 'ColorMatrix1', // Used in IFD 0 of DNG files. |
||
424 | 50722 => 'ColorMatrix2', // Used in IFD 0 of DNG files. |
||
425 | 50723 => 'CameraCalibration1', // Used in IFD 0 of DNG files. |
||
426 | 50724 => 'CameraCalibration2', // Used in IFD 0 of DNG files. |
||
427 | 50725 => 'ReductionMatrix1', // Used in IFD 0 of DNG files. |
||
428 | 50726 => 'ReductionMatrix2', // Used in IFD 0 of DNG files. |
||
429 | 50727 => 'AnalogBalance', // Used in IFD 0 of DNG files. |
||
430 | 50728 => 'AsShotNeutral', // Used in IFD 0 of DNG files. |
||
431 | 50729 => 'AsShotWhiteXY', // Used in IFD 0 of DNG files. |
||
432 | 50730 => 'BaselineExposure', // Used in IFD 0 of DNG files. |
||
433 | 50731 => 'BaselineNoise', // Used in IFD 0 of DNG files. |
||
434 | 50732 => 'BaselineSharpness', // Used in IFD 0 of DNG files. |
||
435 | 50733 => 'BayerGreenSplit', // Used in Raw IFD of DNG files. |
||
436 | 50734 => 'LinearResponseLimit', // Used in IFD 0 of DNG files. |
||
437 | 50735 => 'CameraSerialNumber', // Used in IFD 0 of DNG files. |
||
438 | 50736 => 'LensInfo', // Used in IFD 0 of DNG files. |
||
439 | 50737 => 'ChromaBlurRadius', // Used in Raw IFD of DNG files. |
||
440 | 50738 => 'AntiAliasStrength', // Used in Raw IFD of DNG files. |
||
441 | 50740 => 'DNGPrivateData', // Used in IFD 0 of DNG files. |
||
442 | 50741 => 'MakerNoteSafety', // Used in IFD 0 of DNG files. |
||
443 | 50778 => 'CalibrationIlluminant1', // Used in IFD 0 of DNG files. |
||
444 | 50779 => 'CalibrationIlluminant2', // Used in IFD 0 of DNG files. |
||
445 | 50780 => 'BestQualityScale', // Used in Raw IFD of DNG files. |
||
446 | 50784 => 'Alias Layer Metadata', // Alias Sketchbook Pro layer usage description. |
||
447 | 50908 => 'TIFF_RSID', // This private tag is used in a GEOTIFF standard by DGIWG. |
||
448 | 50909 => 'GEO_METADATA', // This private tag is used in a GEOTIFF standard by DGIWG. |
||
449 | |||
450 | // EXIF tags - https://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif.html |
||
451 | 33434 => 'ExposureTime', // Exposure time, given in seconds. |
||
452 | 33437 => 'FNumber', // The F number. |
||
453 | 34850 => 'ExposureProgram', // The class of the program used by the camera to set exposure when the picture is taken. |
||
454 | 34852 => 'SpectralSensitivity', // Indicates the spectral sensitivity of each channel of the camera used. |
||
455 | 34855 => 'ISOSpeedRatings', // Indicates the ISO Speed and ISO Latitude of the camera or input device as specified in ISO 12232. |
||
456 | 34856 => 'OECF', // Indicates the Opto-Electric Conversion Function (OECF) specified in ISO 14524. |
||
457 | 36864 => 'ExifVersion', // The version of the supported Exif standard. |
||
458 | 36867 => 'DateTimeOriginal', // The date and time when the original image data was generated. |
||
459 | 36868 => 'DateTimeDigitized', // The date and time when the image was stored as digital data. |
||
460 | 37121 => 'ComponentsConfiguration', // Specific to compressed data; specifies the channels and complements PhotometricInterpretation |
||
461 | 37122 => 'CompressedBitsPerPixel', // Specific to compressed data; states the compressed bits per pixel. |
||
462 | 37377 => 'ShutterSpeedValue', // Shutter speed. |
||
463 | 37378 => 'ApertureValue', // The lens aperture. |
||
464 | 37379 => 'BrightnessValue', // The value of brightness. |
||
465 | 37380 => 'ExposureBiasValue', // The exposure bias. |
||
466 | 37381 => 'MaxApertureValue', // The smallest F number of the lens. |
||
467 | 37382 => 'SubjectDistance', // The distance to the subject, given in meters. |
||
468 | 37383 => 'MeteringMode', // The metering mode. |
||
469 | 37384 => 'LightSource', // The kind of light source. |
||
470 | 37385 => 'Flash', // Indicates the status of flash when the image was shot. |
||
471 | 37386 => 'FocalLength', // The actual focal length of the lens, in mm. |
||
472 | 37396 => 'SubjectArea', // Indicates the location and area of the main subject in the overall scene. |
||
473 | 37500 => 'MakerNote', // Manufacturer specific information. |
||
474 | 37510 => 'UserComment', // Keywords or comments on the image; complements ImageDescription. |
||
475 | 37520 => 'SubsecTime', // A tag used to record fractions of seconds for the DateTime tag. |
||
476 | 37521 => 'SubsecTimeOriginal', // A tag used to record fractions of seconds for the DateTimeOriginal tag. |
||
477 | 37522 => 'SubsecTimeDigitized', // A tag used to record fractions of seconds for the DateTimeDigitized tag. |
||
478 | 40960 => 'FlashpixVersion', // The Flashpix format version supported by a FPXR file. |
||
479 | 40961 => 'ColorSpace', // The color space information tag is always recorded as the color space specifier. |
||
480 | 40962 => 'PixelXDimension', // Specific to compressed data; the valid width of the meaningful image. |
||
481 | 40963 => 'PixelYDimension', // Specific to compressed data; the valid height of the meaningful image. |
||
482 | 40964 => 'RelatedSoundFile', // Used to record the name of an audio file related to the image data. |
||
483 | 41483 => 'FlashEnergy', // Indicates the strobe energy at the time the image is captured, as measured in Beam Candle Power Seconds |
||
484 | 41484 => 'SpatialFrequencyResponse', // Records the camera or input device spatial frequency table and SFR values in the direction of image width, image height, and diagonal direction, as specified in ISO 12233. |
||
485 | 41486 => 'FocalPlaneXResolution', // Indicates the number of pixels in the image width (X) direction per FocalPlaneResolutionUnit on the camera focal plane. |
||
486 | 41487 => 'FocalPlaneYResolution', // Indicates the number of pixels in the image height (Y) direction per FocalPlaneResolutionUnit on the camera focal plane. |
||
487 | 41488 => 'FocalPlaneResolutionUnit', // Indicates the unit for measuring FocalPlaneXResolution and FocalPlaneYResolution. |
||
488 | 41492 => 'SubjectLocation', // Indicates the location of the main subject in the scene. |
||
489 | 41493 => 'ExposureIndex', // Indicates the exposure index selected on the camera or input device at the time the image is captured. |
||
490 | 41495 => 'SensingMethod', // Indicates the image sensor type on the camera or input device. |
||
491 | 41728 => 'FileSource', // Indicates the image source. |
||
492 | 41729 => 'SceneType', // Indicates the type of scene. |
||
493 | 41730 => 'CFAPattern', // Indicates the color filter array (CFA) geometric pattern of the image sensor when a one-chip color area sensor is used. |
||
494 | 41985 => 'CustomRendered', // Indicates the use of special processing on image data, such as rendering geared to output. |
||
495 | 41986 => 'ExposureMode', // Indicates the exposure mode set when the image was shot. |
||
496 | 41987 => 'WhiteBalance', // Indicates the white balance mode set when the image was shot. |
||
497 | 41988 => 'DigitalZoomRatio', // Indicates the digital zoom ratio when the image was shot. |
||
498 | 41989 => 'FocalLengthIn35mmFilm', // Indicates the equivalent focal length assuming a 35mm film camera, in mm. |
||
499 | 41990 => 'SceneCaptureType', // Indicates the type of scene that was shot. |
||
500 | 41991 => 'GainControl', // Indicates the degree of overall image gain adjustment. |
||
501 | 41992 => 'Contrast', // Indicates the direction of contrast processing applied by the camera when the image was shot. |
||
502 | 41993 => 'Saturation', // Indicates the direction of saturation processing applied by the camera when the image was shot. |
||
503 | 41994 => 'Sharpness', // Indicates the direction of sharpness processing applied by the camera when the image was shot. |
||
504 | 41995 => 'DeviceSettingDescription', // This tag indicates information on the picture-taking conditions of a particular camera model. |
||
505 | 41996 => 'SubjectDistanceRange', // Indicates the distance to the subject. |
||
506 | 42016 => 'ImageUniqueID', // Indicates an identifier assigned uniquely to each image. |
||
507 | ); |
||
508 | } |
||
509 | return (isset($TIFFcommentName[$id]) ? $TIFFcommentName[$id] : 'unknown/invalid ('.$id.')'); |
||
510 | } |
||
511 | |||
514 |