Advertisement:

Author Topic: [SOLVED] png Logo  (Read 1631 times)

Adyyda

  • Sr. Member
  • ****
  • Posts: 435
[SOLVED] png Logo
« on: July 03, 2015, 06:47:55 pm »
Hello. Why the png logo is converted into jpg? How can we stop converting?

themes/modern/images/logo.jpg
« Last Edit: July 06, 2015, 12:52:43 pm by Adyyda »

whoopwhoopler

  • Full Member
  • ***
  • Posts: 132
  • Everything Has A Solution
Re: png Logo
« Reply #1 on: July 06, 2015, 10:23:36 am »
Go into your admin panel and select the settings tab - and then select media.

On the settings page about the 5th setting down on the page is the Force jpg extension. If it is checked - uncheck it - then save your changes.

Whoop Whoop!

Adyyda

  • Sr. Member
  • ****
  • Posts: 435
Re: png Logo
« Reply #2 on: July 06, 2015, 10:58:41 am »
Go into your admin panel and select the settings tab - and then select media.

On the settings page about the 5th setting down on the page is the Force jpg extension. If it is checked - uncheck it - then save your changes.

Whoop Whoop!

Thanks for the reply. That option is unchecked. Always was because i uploaded png images at listings as well. There they are ok but for logo they are converted.

calinbehtuk

  • Sr. Member
  • ****
  • Posts: 450
Re: png Logo
« Reply #3 on: July 06, 2015, 11:34:36 am »
You have to change the code, because the conversion is made directly from the code.

In file function.php find this line
  case('upload_logo'):
                $package = Params::getFiles('logo');
                if( $package['error'] == UPLOAD_ERR_OK ) {
                    if( move_uploaded_file($package['tmp_name'], WebThemes::newInstance()->getCurrentThemePath() . "images/logo.jpg" ) ) {
                        osc_add_flash_ok_message(__('The logo image has been uploaded correctly', 'modern'), 'admin');
                    } else {
                        osc_add_flash_error_message(__("An error has occurred, please try again", 'modern'), 'admin');
                    }
                } else {
                    osc_add_flash_error_message(__("An error has occurred, please try again", 'modern'), 'admin');
                }
                header('Location: ' . osc_admin_render_theme_url('oc-content/themes/modern/admin/header.php')); exit;
            break;
            case('remove'):
                if(file_exists( WebThemes::newInstance()->getCurrentThemePath() . "images/logo.jpg" ) ) {
                    @unlink( WebThemes::newInstance()->getCurrentThemePath() . "images/logo.jpg" );
                    osc_add_flash_ok_message(__('The logo image has been removed', 'modern'), 'admin');
                } else {
                    osc_add_flash_error_message(__("Image not found", 'modern'), 'admin');
                }
                header('Location: ' . osc_admin_render_theme_url('oc-content/themes/modern/admin/header.php')); exit;
            break;

And in this code which show the logo
 if( !function_exists('logo_header') ) {
        function logo_header() {
            $html = '<img border="0" alt="' . osc_page_title() . '" src="' . osc_current_web_theme_url('images/logo.jpg') . '" />';
            if( file_exists( WebThemes::newInstance()->getCurrentThemePath() . "images/logo.jpg" ) ) {
                return $html;
            } else if( osc_get_preference('default_logo', 'modern') && (file_exists( WebThemes::newInstance()->getCurrentThemePath() . "images/default-logo.jpg")) ) {
                return '<img border="0" alt="' . osc_page_title() . '" src="' . osc_current_web_theme_url('images/default-logo.jpg') . '" />';
            } else {
                return osc_page_title();
            }
        }
    }

Replace jpg with png
« Last Edit: July 06, 2015, 11:47:28 am by calinbehtuk »

Adyyda

  • Sr. Member
  • ****
  • Posts: 435
Re: png Logo
« Reply #4 on: July 06, 2015, 12:52:21 pm »
Multumesc Calin. Am inlocuit in tot fisierul logo.jpg cu logo.png si acum e ok