GRAYBYTE WORDPRESS FILE MANAGER8001

Server IP : 162.213.255.40 / Your IP : 216.73.216.114
System : Linux server146.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
PHP Version : 8.0.30
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF

HOME

/home/hellrfbn/public_html/wp-content/updraft/plugins-old/foogallery/includes/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/hellrfbn/public_html/wp-content/updraft/plugins-old/foogallery/includes//class-retina.php
<?php
/*
 * FooGallery Retina Support class
 */

if ( !class_exists( 'FooGallery_Retina' ) ) {

    class FooGallery_Retina {

        function __construct() {
            add_filter('foogallery_attachment_html_image_attributes', array($this, 'add_retina_attributes'), 10, 3);
        }

        /**
         * @param array $attr
         * @param array $args
         * @param FooGalleryAttachment $attachment
         * @return mixed
         */
        function add_retina_attributes($attr, $args, $attachment) {
            global $current_foogallery;

            if ( $current_foogallery && $current_foogallery->gallery_template ) {

                //first check if the gallery has saved Retina settings
                if ( isset($current_foogallery->retina) && is_array( $current_foogallery->retina ) ) {
                    $srcset = array();

					//get the original thumb dimensions
					$original_thumb_width = array_key_exists( 'width', $args ) ? intval( $args['width'] ) : 0;
					$original_thumb_height = array_key_exists( 'height', $args ) ? intval( $args['height'] ) : 0;

					//get the original full size image dimensions
					$original_width = $attachment->width;
					$original_height = $attachment->height;

					//if we do not have a width, we need to calculate one
					if ( 0 === $original_thumb_width ) {
						//find closest ratio multiple to image size
						if( $original_width > $original_height ) {
							//landscape
							$ratio = $original_width / $original_height;
							$original_thumb_width = intval( $original_thumb_height * $ratio );
						}else{
							//portrait
							$ratio = $original_height / $original_width;
							$original_thumb_width = intval( $original_thumb_height / $ratio );
						}
					}

                    foreach ( foogallery_retina_options() as $pixel_density ) {
                        $pixel_density_supported = array_key_exists( $pixel_density, $current_foogallery->retina ) ? ('true' === $current_foogallery->retina[$pixel_density]) : false;

                        if ( $pixel_density_supported ) {
                            $pixel_density_int = intval( str_replace( 'x', '', $pixel_density ) );

                            //apply scaling to the width and height attributes
                            $retina_width  = $original_thumb_width * $pixel_density_int;
                            $retina_height = $original_thumb_height * $pixel_density_int;

                            //if the new dimensions are smaller than the full size image dimensions then allow the retina thumb
                            if ( $retina_width < $original_width &&
                                $retina_height < $original_height ) {
                                $args['width'] = $retina_width;
                                $args['height'] = $retina_height;

                                //build up the retina attributes
                                $srcset[] = $attachment->html_img_src( $args ) . ' ' . $pixel_density_int . 'x';
                            }
                        }
                    }

                    if ( count( $srcset ) ) {
                        $attr['srcset'] = implode( ',', $srcset );
                    }
                }
            }

            return $attr;
        }
    }
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
admin
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
compatibility
--
July 23 2025 15:04:09
hellrfbn / hellrfbn
0755
extensions
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
foopluginbase
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
public
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
thumbs
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
.htaccess
0.41 KB
July 23 2025 07:38:28
hellrfbn / hellrfbn
0644
class-attachment-filters.php
1.846 KB
June 28 2024 16:09:58
hellrfbn / hellrfbn
0644
class-foogallery-animated-gif-support.php
1.089 KB
June 28 2024 16:09:58
hellrfbn / hellrfbn
0644
class-foogallery-attachment-custom-class.php
1.674 KB
June 28 2024 16:09:58
hellrfbn / hellrfbn
0644
class-foogallery-attachment-type.php
3.171 KB
June 28 2024 16:09:58
hellrfbn / hellrfbn
0644
class-foogallery-attachment.php
7.417 KB
June 28 2024 16:09:58
hellrfbn / hellrfbn
0644
class-foogallery-cache.php
7.718 KB
June 28 2024 16:09:58
hellrfbn / hellrfbn
0644
class-foogallery-common-fields.php
32.662 KB
June 28 2024 16:09:58
hellrfbn / hellrfbn
0644
class-foogallery-crop-position.php
9.286 KB
June 28 2024 16:09:58
hellrfbn / hellrfbn
0644
class-foogallery-datasource-media_library.php
15.408 KB
June 28 2024 16:09:58
hellrfbn / hellrfbn
0644
class-foogallery-debug.php
4.195 KB
June 28 2024 16:09:58
hellrfbn / hellrfbn
0644
class-foogallery-extensions-compatibility.php
1.346 KB
June 28 2024 16:09:58
hellrfbn / hellrfbn
0644
class-foogallery-force-https.php
2.392 KB
June 28 2024 16:09:58
hellrfbn / hellrfbn
0644
class-foogallery-lazyload.php
8.644 KB
June 28 2024 16:09:58
hellrfbn / hellrfbn
0644
class-foogallery-lightbox.php
55.908 KB
June 28 2024 16:09:58
hellrfbn / hellrfbn
0644
class-foogallery-paging.php
17.126 KB
June 28 2024 16:09:58
hellrfbn / hellrfbn
0644
class-foogallery-sitemaps.php
2.69 KB
June 28 2024 16:09:58
hellrfbn / hellrfbn
0644
class-foogallery-widget.php
3.94 KB
June 28 2024 16:09:58
hellrfbn / hellrfbn
0644
class-foogallery.php
15.58 KB
June 28 2024 16:09:58
hellrfbn / hellrfbn
0644
class-gallery-advanced-settings.php
7.686 KB
June 28 2024 16:09:58
hellrfbn / hellrfbn
0644
class-il8n.php
2.344 KB
June 28 2024 16:09:58
hellrfbn / hellrfbn
0644
class-override-thumbnail.php
7.067 KB
June 28 2024 16:09:58
hellrfbn / hellrfbn
0644
class-posttypes.php
4.988 KB
June 28 2024 16:09:58
hellrfbn / hellrfbn
0644
class-retina.php
3.299 KB
June 28 2024 16:09:58
hellrfbn / hellrfbn
0644
class-thumbnail-dimensions.php
9.425 KB
June 28 2024 16:09:58
hellrfbn / hellrfbn
0644
class-thumbnails.php
8.606 KB
June 28 2024 16:09:58
hellrfbn / hellrfbn
0644
class-version-check.php
1.416 KB
June 28 2024 16:09:58
hellrfbn / hellrfbn
0644
constants.php
2.605 KB
June 28 2024 16:09:58
hellrfbn / hellrfbn
0644
functions.php
72.672 KB
June 28 2024 16:09:58
hellrfbn / hellrfbn
0644
includes.php
4.986 KB
June 28 2024 16:09:58
hellrfbn / hellrfbn
0644
index.php
0.025 KB
June 28 2024 16:09:58
hellrfbn / hellrfbn
0644
render-functions.php
19.077 KB
June 28 2024 16:09:58
hellrfbn / hellrfbn
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF