Reply to Re: Can't display local file

Re: Can't display local file new!
by Kim, 14 years, 8 months ago
When I look at the code in Firefox here is the message I get when I try to view the pic:

The image “view-source:https://thedomain.com/~lifespa/demo/getfile.php?t=svc&id=6” cannot be displayed, because it contains errors.

If I call the picture directly it shows as it should.

While trying to troubleshoot I turned off the header output of the image mime type and was able to see the code from the picture print. But, as soon as I add header('Content-type: ' . $img->file_src_mime); I get the error message above.

To get the output from the object after local image upload I did this:
$img = new upload($imgurl);
print_r($img);

The output is below:
upload Object
(
    [version] => 0.29
    [file_src_name] => 11_svclogo_226116.jpg
    [file_src_name_body] => 11_svclogo_226116
    [file_src_name_ext] => jpg
    [file_src_mime] => image/jpeg
    [file_src_size] => 4909
    [file_src_error] => 0
    [file_src_pathname] => /home/lifespa/uploads/pics/11_svclogo_226116.jpg
    [file_src_temp] => 
    [file_dst_path] => 
    [file_dst_name] => 
    [file_dst_name_body] => 
    [file_dst_name_ext] => 
    [file_dst_pathname] => 
    [image_src_x] => 150
    [image_src_y] => 137
    [image_src_bits] => 8
    [image_src_pixels] => 20550
    [image_src_type] => jpg
    [image_dst_x] => 150
    [image_dst_y] => 137
    [image_supported] => Array
        (
            [image/gif] => gif
            [image/jpg] => jpg
            [image/jpeg] => jpg
            [image/pjpeg] => jpg
            [image/png] => png
            [image/x-png] => png
            [image/bmp] => bmp
            [image/x-ms-bmp] => bmp
            [image/x-windows-bmp] => bmp
        )
    [file_is_image] => 1
    [uploaded] => 1
    [no_upload_check] => 1
    [processed] => 1
    [error] => 
[log] => system information
- class version : 0.29
- operating system : FreeBSD
- PHP version : 4.4.9
- GD version : 2.0.28
- supported image types : png jpg gif bmp
- open_basedir : no restriction
- language : en_GB
source is a local file /home/lifespa/uploads/pics/11_svclogo_226116.jpg
- local file name OK
determining MIME type
- Checking MIME type with Fileinfo PECL extension
Fileinfo PECL extension not available
- Checking MIME type with UNIX file() command
MIME type detected as image/jpeg by UNIX file() command
- MIME validated as image/jpeg
source variables
- You can use all these before calling process()
file_src_name : 11_svclogo_226116.jpg
file_src_name_body : 11_svclogo_226116
file_src_name_ext : jpg
file_src_pathname : /home/lifespa/uploads/pics/11_svclogo_226116.jpg
file_src_mime : image/jpeg
file_src_size : 4909 (max= 52428800)
file_src_error : 0
- source file is an image
image_src_x : 150
image_src_y : 137
image_src_pixels : 20550
image_src_type : jpg
image_src_bits : 8
    [file_new_name_body] => 
    [file_name_body_add] => 
    [file_name_body_pre] => 
    [file_new_name_ext] => 
    [file_safe_name] => 1
    [mime_check] => 1
    [mime_fileinfo] => 1
    [mime_file] => 1
    [mime_magic] => 1
    [mime_getimagesize] => 1
    [no_script] => 1
    [file_auto_rename] => 1
    [dir_auto_create] => 1
    [dir_auto_chmod] => 1
    [dir_chmod] => 511
    [file_overwrite] => 
    [file_max_size] => 52428800
    [image_resize] => 
    [image_convert] => 
    [image_x] => 150
    [image_y] => 150
    [image_ratio] => 
    [image_ratio_crop] => 
    [image_ratio_fill] => 
    [image_ratio_pixels] => 
    [image_ratio_no_zoom_in] => 
    [image_ratio_no_zoom_out] => 
    [image_ratio_x] => 
    [image_ratio_y] => 
    [image_max_width] => 
    [image_max_height] => 
    [image_max_pixels] => 
    [image_max_ratio] => 
    [image_min_width] => 
    [image_min_height] => 
    [image_min_pixels] => 
    [image_min_ratio] => 
    [jpeg_quality] => 85
    [jpeg_size] => 
    [preserve_transparency] => 
    [image_is_transparent] => 
    [image_transparent_color] => 
    [image_background_color] => 
    [image_default_color] => #ffffff
    [image_is_palette] => 
    [image_brightness] => 
    [image_contrast] => 
    [image_threshold] => 
    [image_tint_color] => 
    [image_overlay_color] => 
    [image_overlay_percent] => 
    [image_negative] => 
    [image_greyscale] => 
    [image_text] => 
    [image_text_direction] => 
    [image_text_color] => #FFFFFF
    [image_text_percent] => 100
    [image_text_background] => 
    [image_text_background_percent] => 100
    [image_text_font] => 5
    [image_text_position] => 
    [image_text_x] => 
    [image_text_y] => 
    [image_text_padding] => 0
    [image_text_padding_x] => 
    [image_text_padding_y] => 
    [image_text_alignment] => C
    [image_text_line_spacing] => 0
    [image_reflection_height] => 
    [image_reflection_space] => 2
    [image_reflection_color] => #ffffff
    [image_reflection_opacity] => 60
    [image_flip] => 
    [image_rotate] => 
    [image_crop] => 
    [image_precrop] => 
    [image_bevel] => 
    [image_bevel_color1] => #FFFFFF
    [image_bevel_color2] => #000000
    [image_border] => 
    [image_border_color] => #FFFFFF
    [image_frame] => 
    [image_frame_colors] => #FFFFFF #999999 #666666 #000000
    [image_watermark] => 
    [image_watermark_position] => 
    [image_watermark_x] => 
    [image_watermark_y] => 
    [allowed] => Array
        (
            default array )

    [forbidden] => Array
        (
        )

    [translation] => Array
        (
            default array        )

    [language] => 
    [lang] => en_GB
Reply

Your reply

Name *
Email 
Title *
Text *
CAPTCHA image
Enter the code displayed on the image:
Click on the image to generate another one if it is hard to read it. The case is important