$instance->logLn(self::getConverterDisplayName() . ' converter ignited');
489747
public function doConvert()
    {
        $beginTime = microtime(true);

        $this->activateWarningLogger();
        //set_error_handler(array($this, "errorHandler"));

        try {
            // Prepare options
            //$this->prepareOptions();

            $this->checkOptions();

            // Prepare destination folder
            $this->createWritableDestinationFolder();
            $this->removeExistingDestinationIfExists();

            if (!isset($this->options['_skip_input_check'])) {
                // Run basic input validations (if source exists and if file extension is valid)
                $this->checkInput();

                // Check that a file can be written to destination
                $this->checkFileSystem();
            }

            $this->checkOperationality();
            $this->checkConvertability();
            $this->runActualConvert();
        } catch (ConversionFailedException $e) {
            $this->deactivateWarningLogger();
            throw $e;
        } catch (\Exception $e) {
            $this->deactivateWarningLogger();
            throw new UnhandledException('Conversion failed due to uncaught exception', 0, $e);
        } catch (\Error $e) {
            $this->deactivateWarningLogger();
            // https://stackoverflow.com/questions/7116995/is-it-possible-in-php-to-prevent-fatal-error-call-to-undefined-function
            //throw new UnhandledException('Conversion failed due to uncaught error', 0, $e);
            throw $e;
        }
        $this->deactivateWarningLogger();

        $source = $this->source;
        $destination = $this->destination;

        if (!@file_exists($destination)) {
            throw new ConversionFailedException('Destination file is not there: ' . $destination);
        } elseif (@filesize($destination) === 0) {
            unlink($destination);
            throw new ConversionFailedException('Destination file was completely empty');
        } else {
            if (!isset($this->options['_suppress_success_message'])) {
                $this->ln();
                $msg = 'Converted image in ' .
                    round((microtime(true) - $beginTime) * 1000) . ' ms';

                $sourceSize = @filesize($source);
                if ($sourceSize !== false) {
                    $msg .= ', reducing file size with ' .
                        round((filesize($source) - filesize($destination))/filesize($source) * 100) . '% ';

                    if ($sourceSize < 10000) {
                        $msg .= '(went from ' . round(filesize($source)) . ' bytes to ';
                        $msg .= round(filesize($destination)) . ' bytes)';
                    } else {
                        $msg .= '(went from ' . round(filesize($source)/1024) . ' kb to ';
                        $msg .= round(filesize($destination)/1024) . ' kb)';
                    }
                }
                $this->logLn($msg);
            }
        }
    }
1133879
function readConversionRuleSettingsFromINI( $iniFile = false )
    {
        if ( !$iniFile )
            $iniFile = 'image.ini';
        $ini = eZINI::instance( $iniFile );
        if ( !$ini )
            return false;
        if ( $ini->hasVariable( 'MIMETypeSettings', 'ConversionRules' ) )
        {
            $conversionRules = array();
            $rules = $ini->variable( 'MIMETypeSettings', 'ConversionRules' );
            foreach ( $rules as $ruleString )
            {
                $ruleItems = explode( ';', $ruleString );
                if ( count( $ruleItems ) >= 2 )
                {
                    $conversionRule = array( 'from' => $ruleItems[0],
                                             'to' => $ruleItems[1] );
                    $this->appendConversionRule( $conversionRule );
                }
            }
        }
    }
420181
public function get(string $input_format, string $output_format): ConverterInterface
    {
        $definition = $this->definition_factory->get($input_format, $output_format);

        foreach ($this->converters as $class => $formats) {
            if ([$input_format, $output_format] === $formats) {
                $assets = new Metadata\Assets();
                $assets->setLogger($this->logger);

                $toc = new Metadata\TableOfContents();
                $glossary = new Metadata\Glossary();

                /** @var ConverterInterface $converter */
                $converter = new $class($definition, $assets, $toc, $glossary);
                $converter->setLogger($this->logger);

                return $converter;
            }
        }

        throw new ConverterNotFoundException(
            'No converter could be found to convert from ' . $input_format . ' to ' . $output_format
        );
    }
264709
public function activateOptions() {
		if (!isset($this->pattern)) {
			throw new \n2n\log4php\LoggerException("Mandatory parameter 'conversionPattern' is not set.");
		}
		
		$parser = new \n2n\log4php\pattern\PatternParser($this->pattern, $this->converterMap);
		$this->head = $parser->parse();
	}
476558
@Override
  public <S, T> Convert<S, T> converter(Class<S> source, Class<T> target)
  {
    ConvertFrom<S> convertType = getOrCreate(source);
    
    return convertType.converter(target);
  }
1130688
function () {
            var args = Array.prototype.slice.call(arguments, 0);
            if (args.length < 1) {
                throw new Error("Must specify at least one argument to AnyConverter");
            }
            
            var values = {};
            for (var i = 0, len = args.length; i < len; i += 1) {
                var arg = args[i];
                values[arg.toLowerCase()] = arg;
            }
            
            return spawn(AnyConverter.prototype, {
                _values: values,
                regex: "(?:" + args.map(regexpEscape).join("|") + ")",
                weight: 200
            });
        }
609335
public static <T> Function<Object, T> getConverter(final Class<T> clazz) {
      return object -> Convert.convert(object, clazz);
   }
35213
@Override
    public Converter getConverter(Class<?> from, Class<?> to) {
        Map<Class<?>, Converter> toMap = fromMap.get(from);
        if (toMap != null) {
            return toMap.get(to);
        } else {
            return null;
        }
    }
532694
public function getConverter(string $modelClass, string $originalClass = '')
    {
        if ('' === $originalClass) {
            $originalClass = $modelClass;
        }

        $converterClass = 'NerdsAndCompany\\Schematic\\Converters\\'.ucfirst(str_replace('craft\\', '', $modelClass));
        $event = new ConverterEvent([
            'modelClass' => $modelClass,
            'converterClass' => $converterClass,
        ]);

        $this->trigger(self::EVENT_RESOLVE_CONVERTER, $event);
        $converterClass = $event->converterClass;

        if (class_exists($converterClass)) {
            $converter = new $converterClass();
            if ($converter instanceof ConverterInterface) {
                return $converter;
            }
        }

        $parentClass = get_parent_class($modelClass);
        if (!$parentClass) {
            Schematic::error('No converter found for '.$originalClass);

            return null;
        }

        return $this->getConverter($parentClass, $originalClass);
    }
570730
@Override
    public Object getValue(Object instance, String propertyName) {
        PropertyAccessor accessor = PropertyProxyUtils.getPropertyAccessor(this.conversionService, this.useDirectFieldAccess, instance);
        Object value = accessor.getPropertyValue(propertyName);
        if(log.isDebugEnabled()) {
            getType(instance, propertyName);
            log.debug("Actual type of value for property '"+propertyName+"' on instance "+instance+" is "+(value != null ? value.getClass() : null));
        }
        
        TypeDescriptor targetType = accessor.getPropertyTypeDescriptor(propertyName);
        TypeDescriptor sourceType = value == null ? targetType : TypeDescriptor.valueOf(value.getClass());
        if (this.conversionService.canConvert(sourceType, targetType)) {
            value = this.conversionService.convert(value, sourceType, targetType);
        }
        return value;
    }
178590
public function getWasConverterUsed($alias = null)
    {
        if ($alias) {
            return isset($this->converterAliasUsed[$alias]) ? $this->converterAliasUsed[$alias] : false;
        } else {
            return $this->converterUsed;
        }
    }
701891
public final <S, T> void registerConverter(ConverterKey<S,T> key, Converter<S, T> converter) {	

        if (key.getInputClass() == null) {
            throw new IllegalArgumentException("Input Class must not be null");
        }
        if (key.getOutputClass() == null) {
            throw new IllegalArgumentException("Output Class must not be null");
        }
        if (converter == null) {
            throw new IllegalArgumentException("Converter must not be null");
        }

        if (key.getQualifierAnnotation() == null) {
            throw new IllegalArgumentException("Qualifier must not be null");
        }

        Converter<?,?> old = registeredConverters.putIfAbsent(key, converter);
        if (old != null && (!isSameConverter(old, converter))) {
        	throw new IllegalStateException("Converter already registered for key: " + key);
        }
    }
1275722
@Override
	public IResource runConverters(IResource resource) {
		final String sourceMethod = "convertResource";  //$NON-NLS-1$
		boolean isTraceLogging = log.isLoggable(Level.FINER);
		if (isTraceLogging) {
			log.entering(AbstractAggregatorImpl.class.getName(), sourceMethod, new Object[]{resource});
		}
		IResource result = resource;
		Iterable<IAggregatorExtension> extensions = getExtensions(IResourceConverterExtensionPoint.ID);
		if (extensions != null) {	// may be null when unit testing
			for (IAggregatorExtension extension : extensions) {
				result = ((IResourceConverter)extension.getInstance()).convert(result);
			}
		}
		if (isTraceLogging) {
			log.exiting(AbstractAggregatorImpl.class.getName(), sourceMethod, result);
		}
		return result;
	}
479765
@Override
    public Converter getConverter(Class<?> valueType) {
        ConverterProvider provider = findProvider(valueType);
        if (provider == null) {
            return null;
        }
        return provider.createConverter(valueType);
    }
1324594
def converter(type_name):
    """"""
    converter = TYPES.get(type_name)
    if converter is None:
        raise ConverterError('Unknown converter: %r' % type_name)
    return converter()
1225815
@Trivial
    public static <K> UserConverter<K> newInstance(Converter<K> converter) {
        return newInstance(getType(converter), converter);
    }
403863
@SuppressWarnings("unchecked")
    private static <T> Converter<Object, T> lookupConversionService(Class from, Class to) {
        for (ConversionProvider converter : convServices) {
            Converter c = converter.getConverter(from, to);
            if (c != null) {
                return c;
            }
        }
        return null;
    }