<commit_before><?php

class opTimelineImage
{

  /**
   * サイズ未指定 縮小をしていない
   */
  const SIZE_UNDESIGNATED = 0;

  public static function getNotImageUrl()
  {
    return op_image_path('no_image.gif', true);
  }

  public static function findUploadDirPath($fileName, $size = self::SIZE_UNDESIGNATED)
  {
    $extension = pathinfo($fileName, PATHINFO_EXTENSION);

    $uploadBasePath = '/cache/img/'.$extension;
    $uploadSubPath = self::findUploadSubPath($size);
    $uploadDirPath = sfConfig::get('sf_web_dir').$uploadBasePath.'/'.$uploadSubPath;

    return $uploadDirPath;
  }

  public static function addExtensionToBasenameForFileTable($basename)
  {
    $match = array();
    preg_match('/.*_(png|jpeg|gif)$/', $basename, $match);

    if (!isset($match[1]))
    {
      return false;
    }

    return $basename.'.'.$match[1];
  }

  public static function findUploadSubPath($size = self::SIZE_UNDESIGNATED)
  {
    if ($size === self::SIZE_UNDESIGNATED)
    {
      $uploadSubPath = 'w_h';
    }
    else
    {
      $uploadSubPath = 'w'.$size.'_h'.$size;
    }

    return $uploadSubPath;
  }

  public static function copyByResourcePathAndTargetPath($resourcePath, $targetPath)
  {<commit_msg>(refs #126) 一部の画像だけno_imageが表示されるものがあるを修正した<commit_after><?php

class opTimelineImage
{

  /**
   * サイズ未指定 縮小をしていない
   */
  const SIZE_UNDESIGNATED = 0;

  public static function getNotImageUrl()
  {
    return op_image_path('no_image.gif', true);
  }

  public static function findUploadDirPath($fileName, $size = self::SIZE_UNDESIGNATED)
  {
    $extension = pathinfo($fileName, PATHINFO_EXTENSION);

    $uploadBasePath = '/cache/img/'.$extension;
    $uploadSubPath = self::findUploadSubPath($size);
    $uploadDirPath = sfConfig::get('sf_web_dir').$uploadBasePath.'/'.$uploadSubPath;

    return $uploadDirPath;
  }

  public static function addExtensionToBasenameForFileTable($basename)
  {
    $match = array();
    preg_match('/.*_(png|jpeg|jpg|gif)$/', $basename, $match);

    if (!isset($match[1]))
    {
      return false;
    }

    return $basename.'.'.$match[1];
  }

  public static function findUploadSubPath($size = self::SIZE_UNDESIGNATED)
  {
    if ($size === self::SIZE_UNDESIGNATED)
    {
      $uploadSubPath = 'w_h';
    }
    else
    {
      $uploadSubPath = 'w'.$size.'_h'.$size;
    }

    return $uploadSubPath;
  }

  public static function copyByResourcePathAndTargetPath($resourcePath, $targetPath)
  {
{'fraction_non_alphanumeric': 0.1435602953240361, 'fraction_numerical': 0.0036915504511894994, 'mean_word_length': 3.6634799235181643, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5430630', 'n_tokens_mistral': 884, 'n_tokens_neox': 861, 'n_words': 136}