# HG changeset patch # User rlm # Date 1266843759 18000 # Node ID 3f6b44aa6b358a72abd6ade1c31050efb903aed5 # Parent 670229c4eb4b9a816350909d6a7a7d627b5aa7a8 [svn r4] added ability to buy stuff, from a Prints page, but it doesn't work well with the css, and it also has not been fitted into the perl make system. diff -r 670229c4eb4b -r 3f6b44aa6b35 Contact.html --- a/Contact.html Fri Feb 19 11:14:52 2010 -0500 +++ b/Contact.html Mon Feb 22 08:02:39 2010 -0500 @@ -17,14 +17,14 @@ @@ -40,14 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 Meet the Artist1.html --- a/Meet the Artist1.html Fri Feb 19 11:14:52 2010 -0500 +++ b/Meet the Artist1.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,14 +13,14 @@ @@ -61,14 +61,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 Meet the Artist2.html --- a/Meet the Artist2.html Fri Feb 19 11:14:52 2010 -0500 +++ b/Meet the Artist2.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,14 +13,14 @@ @@ -54,14 +54,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/18_dogs_on_a_30_inch_by_40_inch_canvas_1998.html --- a/artwork_descriptions/18_dogs_on_a_30_inch_by_40_inch_canvas_1998.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/18_dogs_on_a_30_inch_by_40_inch_canvas_1998.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/English_Setter_on_granite_1999.html --- a/artwork_descriptions/English_Setter_on_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/English_Setter_on_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/German_Shorthair_Hunting_Dog_on_light_brown_marble_2007.html --- a/artwork_descriptions/German_Shorthair_Hunting_Dog_on_light_brown_marble_2007.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/German_Shorthair_Hunting_Dog_on_light_brown_marble_2007.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -77,13 +78,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/african_lion_head_on_speckled_granite_1999.html --- a/artwork_descriptions/african_lion_head_on_speckled_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/african_lion_head_on_speckled_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/african_lion_head_profile_on_multicolored_granite_1999.html --- a/artwork_descriptions/african_lion_head_profile_on_multicolored_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/african_lion_head_profile_on_multicolored_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/bald_eagle_head_on_labrador_blue_pearl_granite_1999.html --- a/artwork_descriptions/bald_eagle_head_on_labrador_blue_pearl_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/bald_eagle_head_on_labrador_blue_pearl_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/bald_eagle_head_profile_on_black_grante_with_small_gold_specks_1998.html --- a/artwork_descriptions/bald_eagle_head_profile_on_black_grante_with_small_gold_specks_1998.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/bald_eagle_head_profile_on_black_grante_with_small_gold_specks_1998.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/bald_eagle_head_with_open_beak_on_triangular_purple_marble_1999.html --- a/artwork_descriptions/bald_eagle_head_with_open_beak_on_triangular_purple_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/bald_eagle_head_with_open_beak_on_triangular_purple_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/beautiful_black_lab_head_with_pheasant_in_mouth_on_pure_white_marble_1999.html --- a/artwork_descriptions/beautiful_black_lab_head_with_pheasant_in_mouth_on_pure_white_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/beautiful_black_lab_head_with_pheasant_in_mouth_on_pure_white_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/big_buck_on_speckled_beige_granite_1999.html --- a/artwork_descriptions/big_buck_on_speckled_beige_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/big_buck_on_speckled_beige_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/big_mouth_bass_hooked_on_black_lure_on_green-grey_granite_1999.html --- a/artwork_descriptions/big_mouth_bass_hooked_on_black_lure_on_green-grey_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/big_mouth_bass_hooked_on_black_lure_on_green-grey_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/big_mouth_bass_hooked_on_lure_on_green_pearlecent_granite_2007.html --- a/artwork_descriptions/big_mouth_bass_hooked_on_lure_on_green_pearlecent_granite_2007.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/big_mouth_bass_hooked_on_lure_on_green_pearlecent_granite_2007.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -79,13 +80,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/big_mouth_bass_struggling_with_hook_in_mouth_on_green_marble_1999.html --- a/artwork_descriptions/big_mouth_bass_struggling_with_hook_in_mouth_on_green_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/big_mouth_bass_struggling_with_hook_in_mouth_on_green_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/black_bear_three_quarter_view_on_beige_and_ochre_marble_1999.html --- a/artwork_descriptions/black_bear_three_quarter_view_on_beige_and_ochre_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/black_bear_three_quarter_view_on_beige_and_ochre_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/black_lab_flushing_single_quail_on_light_brown_marble_1999.html --- a/artwork_descriptions/black_lab_flushing_single_quail_on_light_brown_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/black_lab_flushing_single_quail_on_light_brown_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/black_lab_head_profile_with_pheasant_on_white_marble_1998.html --- a/artwork_descriptions/black_lab_head_profile_with_pheasant_on_white_marble_1998.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/black_lab_head_profile_with_pheasant_on_white_marble_1998.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/black_lab_head_study_with_grouse_in_mouth_on_white_marble_1999.html --- a/artwork_descriptions/black_lab_head_study_with_grouse_in_mouth_on_white_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/black_lab_head_study_with_grouse_in_mouth_on_white_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/black_lab_head_with_pintail_on_white_marble_1998.html --- a/artwork_descriptions/black_lab_head_with_pintail_on_white_marble_1998.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/black_lab_head_with_pintail_on_white_marble_1998.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/black_lab_profile_carrying_mallard_through_water_on_green-grey_granite_1999.html --- a/artwork_descriptions/black_lab_profile_carrying_mallard_through_water_on_green-grey_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/black_lab_profile_carrying_mallard_through_water_on_green-grey_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/black_lab_retrieving_mallard_on_greenish_grey_granite_1999.html --- a/artwork_descriptions/black_lab_retrieving_mallard_on_greenish_grey_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/black_lab_retrieving_mallard_on_greenish_grey_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/black_lab_retrieving_pheasant_on_light_brown_marble_1999.html --- a/artwork_descriptions/black_lab_retrieving_pheasant_on_light_brown_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/black_lab_retrieving_pheasant_on_light_brown_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/black_lab_sitting_with_canvasback_duck_in_mouth_on_grey_marble_with_rust_inclusions_2000.html --- a/artwork_descriptions/black_lab_sitting_with_canvasback_duck_in_mouth_on_grey_marble_with_rust_inclusions_2000.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/black_lab_sitting_with_canvasback_duck_in_mouth_on_grey_marble_with_rust_inclusions_2000.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/black_lab_sitting_with_pheasant_in_mouth_on_beige_and_ochre_byzantine_1999.html --- a/artwork_descriptions/black_lab_sitting_with_pheasant_in_mouth_on_beige_and_ochre_byzantine_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/black_lab_sitting_with_pheasant_in_mouth_on_beige_and_ochre_byzantine_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/black_lab_three_quarter_profile_on_beige_marble_1998.html --- a/artwork_descriptions/black_lab_three_quarter_profile_on_beige_marble_1998.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/black_lab_three_quarter_profile_on_beige_marble_1998.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/black_lab_walking_through_water_with_duck_in_mouth_on_grey_granite_1999.html --- a/artwork_descriptions/black_lab_walking_through_water_with_duck_in_mouth_on_grey_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/black_lab_walking_through_water_with_duck_in_mouth_on_grey_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/black_lab_with_head_cocked_and_flying_mallards_in_background_on_grey_byzantine_1999.html --- a/artwork_descriptions/black_lab_with_head_cocked_and_flying_mallards_in_background_on_grey_byzantine_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/black_lab_with_head_cocked_and_flying_mallards_in_background_on_grey_byzantine_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/black_lab_with_mallard_in_mouth_sitting_in_reeds_on_ochre_marble_1999.html --- a/artwork_descriptions/black_lab_with_mallard_in_mouth_sitting_in_reeds_on_ochre_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/black_lab_with_mallard_in_mouth_sitting_in_reeds_on_ochre_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/black_lab_with_mallard_in_mouth_sitting_in_reeds_on_pink_marble_1999.html --- a/artwork_descriptions/black_lab_with_mallard_in_mouth_sitting_in_reeds_on_pink_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/black_lab_with_mallard_in_mouth_sitting_in_reeds_on_pink_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/black_poodle_naned_chanel_with_stuffed_animal_on_light_brown_marble_1999.html --- a/artwork_descriptions/black_poodle_naned_chanel_with_stuffed_animal_on_light_brown_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/black_poodle_naned_chanel_with_stuffed_animal_on_light_brown_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/blue_jay_on_twig_on_grey_white_and_ochre_marble_1999.html --- a/artwork_descriptions/blue_jay_on_twig_on_grey_white_and_ochre_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/blue_jay_on_twig_on_grey_white_and_ochre_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/bluebird_perched_on_white_and_grey_rectangular_marble_1999_.html --- a/artwork_descriptions/bluebird_perched_on_white_and_grey_rectangular_marble_1999_.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/bluebird_perched_on_white_and_grey_rectangular_marble_1999_.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/bluejay_perched_on_light_green_marble_1999.html --- a/artwork_descriptions/bluejay_perched_on_light_green_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/bluejay_perched_on_light_green_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/bobwhite_chirping_on_brown_and_snow_marble_1999.html --- a/artwork_descriptions/bobwhite_chirping_on_brown_and_snow_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/bobwhite_chirping_on_brown_and_snow_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/bobwhite_quail_covey_flying_on_ochre_and_beige_travertine_date_unavailable.html --- a/artwork_descriptions/bobwhite_quail_covey_flying_on_ochre_and_beige_travertine_date_unavailable.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/bobwhite_quail_covey_flying_on_ochre_and_beige_travertine_date_unavailable.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/bobwhite_quail_on_marble_with_rust_inclusions_1999.html --- a/artwork_descriptions/bobwhite_quail_on_marble_with_rust_inclusions_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/bobwhite_quail_on_marble_with_rust_inclusions_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/britney_spaniel_head_study_with_tongue_on_purple_and_green_marble_1999.html --- a/artwork_descriptions/britney_spaniel_head_study_with_tongue_on_purple_and_green_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/britney_spaniel_head_study_with_tongue_on_purple_and_green_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/britney_spaniel_with_grouse_on_beige_and_ochre_marble_1998.html --- a/artwork_descriptions/britney_spaniel_with_grouse_on_beige_and_ochre_marble_1998.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/britney_spaniel_with_grouse_on_beige_and_ochre_marble_1998.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/brown_trout_swimming_on_ochre_granite_with_multicolored_specks_2007.html --- a/artwork_descriptions/brown_trout_swimming_on_ochre_granite_with_multicolored_specks_2007.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/brown_trout_swimming_on_ochre_granite_with_multicolored_specks_2007.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -79,13 +80,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/brown_trout_with_fly_on_green_granite_1999.html --- a/artwork_descriptions/brown_trout_with_fly_on_green_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/brown_trout_with_fly_on_green_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/bugling_bull_elk_head_and_chest_on_white_marble_1999.html --- a/artwork_descriptions/bugling_bull_elk_head_and_chest_on_white_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/bugling_bull_elk_head_and_chest_on_white_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/bugling_bull_moose_head_on_beige_marble_1999.html --- a/artwork_descriptions/bugling_bull_moose_head_on_beige_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/bugling_bull_moose_head_on_beige_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/bugling_elk_fromt_pose_on_black_granite_1998.html --- a/artwork_descriptions/bugling_elk_fromt_pose_on_black_granite_1998.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/bugling_elk_fromt_pose_on_black_granite_1998.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/bugling_elk_full_profile_on_white_and_grey_marble_1999.html --- a/artwork_descriptions/bugling_elk_full_profile_on_white_and_grey_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/bugling_elk_full_profile_on_white_and_grey_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/bugling_elk_head_only_on_forest_green_marble_1999.html --- a/artwork_descriptions/bugling_elk_head_only_on_forest_green_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/bugling_elk_head_only_on_forest_green_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/bull_elk_laying_in_the_snow_on_white_and_grey_marble_1999.html --- a/artwork_descriptions/bull_elk_laying_in_the_snow_on_white_and_grey_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/bull_elk_laying_in_the_snow_on_white_and_grey_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/canadian_goose_flying_over_water_on_downstroke_on_wavelike_green_and_grey_granite_1999.html --- a/artwork_descriptions/canadian_goose_flying_over_water_on_downstroke_on_wavelike_green_and_grey_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/canadian_goose_flying_over_water_on_downstroke_on_wavelike_green_and_grey_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/canadian_goose_preparing_to_land_on_grey_granite_1999.html --- a/artwork_descriptions/canadian_goose_preparing_to_land_on_grey_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/canadian_goose_preparing_to_land_on_grey_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/cardinal_perched_on_branch_on_black_marble_with_white_veins_1999.html --- a/artwork_descriptions/cardinal_perched_on_branch_on_black_marble_with_white_veins_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/cardinal_perched_on_branch_on_black_marble_with_white_veins_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/charging_african_elephant_on_beige_travertine_marble_1999.html --- a/artwork_descriptions/charging_african_elephant_on_beige_travertine_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/charging_african_elephant_on_beige_travertine_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/chocolate_lab_head_and_chest_on_pink_granite_1999.html --- a/artwork_descriptions/chocolate_lab_head_and_chest_on_pink_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/chocolate_lab_head_and_chest_on_pink_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/chocolate_lab_three_quarter_profile_on_beige_marble_1998.html --- a/artwork_descriptions/chocolate_lab_three_quarter_profile_on_beige_marble_1998.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/chocolate_lab_three_quarter_profile_on_beige_marble_1998.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/coyote_standing_in_snow_on_white_and_beige_marble_1999.html --- a/artwork_descriptions/coyote_standing_in_snow_on_white_and_beige_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/coyote_standing_in_snow_on_white_and_beige_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -74,13 +75,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/dog_named_Ulysse_on_beige_travertine_2000.html --- a/artwork_descriptions/dog_named_Ulysse_on_beige_travertine_2000.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/dog_named_Ulysse_on_beige_travertine_2000.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/dolphin_peeking_out_of_ocean_on_green_marble_1999.html --- a/artwork_descriptions/dolphin_peeking_out_of_ocean_on_green_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/dolphin_peeking_out_of_ocean_on_green_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/eagle_head_on_black_granite_1999.html --- a/artwork_descriptions/eagle_head_on_black_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/eagle_head_on_black_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/eagle_hunting_for_prey_on_beige_white_marble_2000.html --- a/artwork_descriptions/eagle_hunting_for_prey_on_beige_white_marble_2000.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/eagle_hunting_for_prey_on_beige_white_marble_2000.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/female_cardinal_in_snow_on_black_grey_and_white_marble_1999.html --- a/artwork_descriptions/female_cardinal_in_snow_on_black_grey_and_white_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/female_cardinal_in_snow_on_black_grey_and_white_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/flying_mallard_on_blue_white_and_black_granite_1999.html --- a/artwork_descriptions/flying_mallard_on_blue_white_and_black_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/flying_mallard_on_blue_white_and_black_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/flying_mallard_on_highly_crystalized_black_and_grey_stone_1999_.html --- a/artwork_descriptions/flying_mallard_on_highly_crystalized_black_and_grey_stone_1999_.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/flying_mallard_on_highly_crystalized_black_and_grey_stone_1999_.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/flying_pheasant_on_downstroke_on_yellow_ochre_1999.html --- a/artwork_descriptions/flying_pheasant_on_downstroke_on_yellow_ochre_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/flying_pheasant_on_downstroke_on_yellow_ochre_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/flying_pheasant_on_travertine_1999.html --- a/artwork_descriptions/flying_pheasant_on_travertine_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/flying_pheasant_on_travertine_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/flying_pheasant_with_cattails_on_beige_marble_1998.html --- a/artwork_descriptions/flying_pheasant_with_cattails_on_beige_marble_1998.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/flying_pheasant_with_cattails_on_beige_marble_1998.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/flying_wild_turkey_on_downstroke_on_ochre_marble_1999.html --- a/artwork_descriptions/flying_wild_turkey_on_downstroke_on_ochre_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/flying_wild_turkey_on_downstroke_on_ochre_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/flying_wood_duck_on_purple_marble_1999.html --- a/artwork_descriptions/flying_wood_duck_on_purple_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/flying_wood_duck_on_purple_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/friendly_grizzly_bear_head_and_chest_on_black_and_gold_granite_1999.html --- a/artwork_descriptions/friendly_grizzly_bear_head_and_chest_on_black_and_gold_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/friendly_grizzly_bear_head_and_chest_on_black_and_gold_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/full_body_buffalo_grey_marble_1999.html --- a/artwork_descriptions/full_body_buffalo_grey_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/full_body_buffalo_grey_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/full_body_buffalo_profile_on_white_black_and_pink_granite_1999.html --- a/artwork_descriptions/full_body_buffalo_profile_on_white_black_and_pink_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/full_body_buffalo_profile_on_white_black_and_pink_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/full_body_white_tailed_deer_walking_through_water_on_green_marble_1999.html --- a/artwork_descriptions/full_body_white_tailed_deer_walking_through_water_on_green_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/full_body_white_tailed_deer_walking_through_water_on_green_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/full_flying_pheasant_on_ochre_and_black_granite_2002.html --- a/artwork_descriptions/full_flying_pheasant_on_ochre_and_black_granite_2002.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/full_flying_pheasant_on_ochre_and_black_granite_2002.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/full_mallard_swmming_straight_at_you_on_grey_granite_1999.html --- a/artwork_descriptions/full_mallard_swmming_straight_at_you_on_grey_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/full_mallard_swmming_straight_at_you_on_grey_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/full_pose_pointer_on_ochre_marble_1998.html --- a/artwork_descriptions/full_pose_pointer_on_ochre_marble_1998.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/full_pose_pointer_on_ochre_marble_1998.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/full_pose_pointer_on_ochre_marble_2_1998.html --- a/artwork_descriptions/full_pose_pointer_on_ochre_marble_2_1998.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/full_pose_pointer_on_ochre_marble_2_1998.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/full_standing_pheasant_profile_on_grey_and_white_marble_1998.html --- a/artwork_descriptions/full_standing_pheasant_profile_on_grey_and_white_marble_1998.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/full_standing_pheasant_profile_on_grey_and_white_marble_1998.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/full_standing_pheasant_profile_on_ochre_marble_1998.html --- a/artwork_descriptions/full_standing_pheasant_profile_on_ochre_marble_1998.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/full_standing_pheasant_profile_on_ochre_marble_1998.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/gallery_display--custom_order_for_one_person.html --- a/artwork_descriptions/gallery_display--custom_order_for_one_person.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/gallery_display--custom_order_for_one_person.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/gallery_display_2--custom_order_for_one_person.html --- a/artwork_descriptions/gallery_display_2--custom_order_for_one_person.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/gallery_display_2--custom_order_for_one_person.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/gallery_display_3--custom_order_for_one_person.html --- a/artwork_descriptions/gallery_display_3--custom_order_for_one_person.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/gallery_display_3--custom_order_for_one_person.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/gallery_display_4--custom_order_for_one_person.html --- a/artwork_descriptions/gallery_display_4--custom_order_for_one_person.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/gallery_display_4--custom_order_for_one_person.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/german_shepard_named_Geta_head_and_chest_on_white_granite_2002.html --- a/artwork_descriptions/german_shepard_named_Geta_head_and_chest_on_white_granite_2002.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/german_shepard_named_Geta_head_and_chest_on_white_granite_2002.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/german_shorthair_full_profile_with_quail_on_brown_and_white_marble_1999.html --- a/artwork_descriptions/german_shorthair_full_profile_with_quail_on_brown_and_white_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/german_shorthair_full_profile_with_quail_on_brown_and_white_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/gobbling_wild_turkey_on_rust_colored_marble_1999.html --- a/artwork_descriptions/gobbling_wild_turkey_on_rust_colored_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/gobbling_wild_turkey_on_rust_colored_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/golden_eagle_head_with_beak_open_blue_granite_1999.html --- a/artwork_descriptions/golden_eagle_head_with_beak_open_blue_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/golden_eagle_head_with_beak_open_blue_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/golden_retreiver_puppy_head_and_fromt_paws_laying_on_brown_marble_1996.html --- a/artwork_descriptions/golden_retreiver_puppy_head_and_fromt_paws_laying_on_brown_marble_1996.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/golden_retreiver_puppy_head_and_fromt_paws_laying_on_brown_marble_1996.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/golden_retriever_head_and_chest_with_mallard_in_mouth_on_paisley_granite_1998.html --- a/artwork_descriptions/golden_retriever_head_and_chest_with_mallard_in_mouth_on_paisley_granite_1998.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/golden_retriever_head_and_chest_with_mallard_in_mouth_on_paisley_granite_1998.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/golden_retriever_head_on_light_brown_travertine_1999.html --- a/artwork_descriptions/golden_retriever_head_on_light_brown_travertine_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/golden_retriever_head_on_light_brown_travertine_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/golden_retriever_head_with_pintail_on_triangular_speckled_granite_1999.html --- a/artwork_descriptions/golden_retriever_head_with_pintail_on_triangular_speckled_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/golden_retriever_head_with_pintail_on_triangular_speckled_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/golden_retriever_puppy_head_and_chest_on_grey_granite_1999.html --- a/artwork_descriptions/golden_retriever_puppy_head_and_chest_on_grey_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/golden_retriever_puppy_head_and_chest_on_grey_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/golden_retriever_resting_on_beige_byzantine_1999.html --- a/artwork_descriptions/golden_retriever_resting_on_beige_byzantine_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/golden_retriever_resting_on_beige_byzantine_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/grey_timberwolf_head_study_on_black_granite_with_gold_specks_1998.html --- a/artwork_descriptions/grey_timberwolf_head_study_on_black_granite_with_gold_specks_1998.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/grey_timberwolf_head_study_on_black_granite_with_gold_specks_1998.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/grizly_bear_head_snaging_salmon_out_of_water_on_green_marble_1999.html --- a/artwork_descriptions/grizly_bear_head_snaging_salmon_out_of_water_on_green_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/grizly_bear_head_snaging_salmon_out_of_water_on_green_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/grizzly_bear_baring_teeth_on_yellow_ochre_1999.html --- a/artwork_descriptions/grizzly_bear_baring_teeth_on_yellow_ochre_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/grizzly_bear_baring_teeth_on_yellow_ochre_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/growling_grizzly_bear_on_black_and_white_marble_with_rust_inclusions_2007.html --- a/artwork_descriptions/growling_grizzly_bear_on_black_and_white_marble_with_rust_inclusions_2007.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/growling_grizzly_bear_on_black_and_white_marble_with_rust_inclusions_2007.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -76,13 +77,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/half_body_mule_deer_buck_on_light_brown_marble_1999.html --- a/artwork_descriptions/half_body_mule_deer_buck_on_light_brown_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/half_body_mule_deer_buck_on_light_brown_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/happy_golden_retriever_head_study_on_black_granite_1999.html --- a/artwork_descriptions/happy_golden_retriever_head_study_on_black_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/happy_golden_retriever_head_study_on_black_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/hooked_big_mouth_bass_on_green_and_yellow_marble_1999.html --- a/artwork_descriptions/hooked_big_mouth_bass_on_green_and_yellow_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/hooked_big_mouth_bass_on_green_and_yellow_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/horn_toad_lizard_on_light_brown_and_white_marble_1999.html --- a/artwork_descriptions/horn_toad_lizard_on_light_brown_and_white_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/horn_toad_lizard_on_light_brown_and_white_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/horned_owl_head_and_chest_on_beige_and_ochre_travertine_1999.html --- a/artwork_descriptions/horned_owl_head_and_chest_on_beige_and_ochre_travertine_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/horned_owl_head_and_chest_on_beige_and_ochre_travertine_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/howling_timberwolf_on_grey_marble_1999.html --- a/artwork_descriptions/howling_timberwolf_on_grey_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/howling_timberwolf_on_grey_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/hummingbird_sipping_from_yellow_columbine_on_beige_marble_1999.html --- a/artwork_descriptions/hummingbird_sipping_from_yellow_columbine_on_beige_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/hummingbird_sipping_from_yellow_columbine_on_beige_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/hunting_1.html --- a/artwork_descriptions/hunting_1.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/hunting_1.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/hunting_10.html --- a/artwork_descriptions/hunting_10.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/hunting_10.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/hunting_11.html --- a/artwork_descriptions/hunting_11.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/hunting_11.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/hunting_12.html --- a/artwork_descriptions/hunting_12.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/hunting_12.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/hunting_2.html --- a/artwork_descriptions/hunting_2.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/hunting_2.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/hunting_3.html --- a/artwork_descriptions/hunting_3.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/hunting_3.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/hunting_4.html --- a/artwork_descriptions/hunting_4.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/hunting_4.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/hunting_5.html --- a/artwork_descriptions/hunting_5.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/hunting_5.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/hunting_6.html --- a/artwork_descriptions/hunting_6.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/hunting_6.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/hunting_7.html --- a/artwork_descriptions/hunting_7.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/hunting_7.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/hunting_8.html --- a/artwork_descriptions/hunting_8.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/hunting_8.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/hunting_9.html --- a/artwork_descriptions/hunting_9.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/hunting_9.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/irish_setter_laying_on_grass_on_brown_and_white_marble_1999.html --- a/artwork_descriptions/irish_setter_laying_on_grass_on_brown_and_white_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/irish_setter_laying_on_grass_on_brown_and_white_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/jumping_big_mouth_bass_with_yellow_lure_on_green_marble_1999.html --- a/artwork_descriptions/jumping_big_mouth_bass_with_yellow_lure_on_green_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/jumping_big_mouth_bass_with_yellow_lure_on_green_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/killer_whale_head_emerging_from_ocean_on_greenish_grey_granite_1999.html --- a/artwork_descriptions/killer_whale_head_emerging_from_ocean_on_greenish_grey_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/killer_whale_head_emerging_from_ocean_on_greenish_grey_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/king_charles_spaniel_named_sophie_on_beige_marble_2002.html --- a/artwork_descriptions/king_charles_spaniel_named_sophie_on_beige_marble_2002.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/king_charles_spaniel_named_sophie_on_beige_marble_2002.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/loon_on_water_on_green_marble_1999.html --- a/artwork_descriptions/loon_on_water_on_green_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/loon_on_water_on_green_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/majestic_caribou_head_and_chest_on_ochre_marble_1999.html --- a/artwork_descriptions/majestic_caribou_head_and_chest_on_ochre_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/majestic_caribou_head_and_chest_on_ochre_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/male_cardinal_perched_on_purple_and_green_marble_1999.html --- a/artwork_descriptions/male_cardinal_perched_on_purple_and_green_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/male_cardinal_perched_on_purple_and_green_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/mallard_coming_in_to_land_on_pink_and_grey_marble_1999.html --- a/artwork_descriptions/mallard_coming_in_to_land_on_pink_and_grey_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/mallard_coming_in_to_land_on_pink_and_grey_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/mallard_landing_on_water_on_bluish-grey_granite_1999.html --- a/artwork_descriptions/mallard_landing_on_water_on_bluish-grey_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/mallard_landing_on_water_on_bluish-grey_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/mallard_male_and_female_pair_swimming_on_blue_granite_1999.html --- a/artwork_descriptions/mallard_male_and_female_pair_swimming_on_blue_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/mallard_male_and_female_pair_swimming_on_blue_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/maltese_named_happy_3_ages_on_black_granite_unsigned_undated.html --- a/artwork_descriptions/maltese_named_happy_3_ages_on_black_granite_unsigned_undated.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/maltese_named_happy_3_ages_on_black_granite_unsigned_undated.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/mockingbird_perched_on_a_branch_on_dark_and_light_green_marble_1999.html --- a/artwork_descriptions/mockingbird_perched_on_a_branch_on_dark_and_light_green_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/mockingbird_perched_on_a_branch_on_dark_and_light_green_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/monster_whitetail_buck_and_doe_standing_in_water_on_azul_do_mar_1999.html --- a/artwork_descriptions/monster_whitetail_buck_and_doe_standing_in_water_on_azul_do_mar_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/monster_whitetail_buck_and_doe_standing_in_water_on_azul_do_mar_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/mountain_goat_full_body_on_white_marble_1999.html --- a/artwork_descriptions/mountain_goat_full_body_on_white_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/mountain_goat_full_body_on_white_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/mountain_goat_head_profile_on_white_marble_1999.html --- a/artwork_descriptions/mountain_goat_head_profile_on_white_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/mountain_goat_head_profile_on_white_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/mountain_lion_sitting_on_black_and_white_marble_1999.html --- a/artwork_descriptions/mountain_lion_sitting_on_black_and_white_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/mountain_lion_sitting_on_black_and_white_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/mourning_dove_dodging_bullet_on_grey_and_rust_marble_1999.html --- a/artwork_descriptions/mourning_dove_dodging_bullet_on_grey_and_rust_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/mourning_dove_dodging_bullet_on_grey_and_rust_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/mourning_dove_sitting_on_branch_on_purple_marble_1999.html --- a/artwork_descriptions/mourning_dove_sitting_on_branch_on_purple_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/mourning_dove_sitting_on_branch_on_purple_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/non-typical_mule_deer_buck_walking_on_light_brown_marble_2007.html --- a/artwork_descriptions/non-typical_mule_deer_buck_walking_on_light_brown_marble_2007.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/non-typical_mule_deer_buck_walking_on_light_brown_marble_2007.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -80,13 +81,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/non-typical_trophy_whitetail_buck_on_light_brown_marble_1999.html --- a/artwork_descriptions/non-typical_trophy_whitetail_buck_on_light_brown_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/non-typical_trophy_whitetail_buck_on_light_brown_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/orca_whale_jumping_out_of_water_on_blue_granite_1999.html --- a/artwork_descriptions/orca_whale_jumping_out_of_water_on_blue_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/orca_whale_jumping_out_of_water_on_blue_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/orca_whale_preforming_bellyflop_on_green_marble_1999.html --- a/artwork_descriptions/orca_whale_preforming_bellyflop_on_green_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/orca_whale_preforming_bellyflop_on_green_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/pair_of_flying_mallards_on_green_and_white_marble_1999.html --- a/artwork_descriptions/pair_of_flying_mallards_on_green_and_white_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/pair_of_flying_mallards_on_green_and_white_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/peregrine_falcon_head_and_chest_on_triangular_white_marble_1999.html --- a/artwork_descriptions/peregrine_falcon_head_and_chest_on_triangular_white_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/peregrine_falcon_head_and_chest_on_triangular_white_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/pheasant_flying_on_light_multicolored_marble_2003.html --- a/artwork_descriptions/pheasant_flying_on_light_multicolored_marble_2003.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/pheasant_flying_on_light_multicolored_marble_2003.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/pheasant_head_profile_on_black_granite_2007.html --- a/artwork_descriptions/pheasant_head_profile_on_black_granite_2007.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/pheasant_head_profile_on_black_granite_2007.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -76,13 +77,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/pheasant_head_profile_on_ochre_marble_1999.html --- a/artwork_descriptions/pheasant_head_profile_on_ochre_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/pheasant_head_profile_on_ochre_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/pink_rose_and_rosebud_on_black_granite_with_gold_specks_1999.html --- a/artwork_descriptions/pink_rose_and_rosebud_on_black_granite_with_gold_specks_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/pink_rose_and_rosebud_on_black_granite_with_gold_specks_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/pintail_duck_in_flight_on_azul_do_mar_granite_1999.html --- a/artwork_descriptions/pintail_duck_in_flight_on_azul_do_mar_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/pintail_duck_in_flight_on_azul_do_mar_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/pintail_pair--drake_and_hen_flying_on_pink-grey_paisley_1999.html --- a/artwork_descriptions/pintail_pair--drake_and_hen_flying_on_pink-grey_paisley_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/pintail_pair--drake_and_hen_flying_on_pink-grey_paisley_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/pintail_sitting_on_water_with_cat-tail_reeds_on_bluish-grey_granite_1999.html --- a/artwork_descriptions/pintail_sitting_on_water_with_cat-tail_reeds_on_bluish-grey_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/pintail_sitting_on_water_with_cat-tail_reeds_on_bluish-grey_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/pointer_head_with_quail_on_beige_travertine_marble_1998.html --- a/artwork_descriptions/pointer_head_with_quail_on_beige_travertine_marble_1998.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/pointer_head_with_quail_on_beige_travertine_marble_1998.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/poodle_named_Scarlett_on_black_granite_2002.html --- a/artwork_descriptions/poodle_named_Scarlett_on_black_granite_2002.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/poodle_named_Scarlett_on_black_granite_2002.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/prong-horn_male_antelope_head_study_on_pink_granite_1999.html --- a/artwork_descriptions/prong-horn_male_antelope_head_study_on_pink_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/prong-horn_male_antelope_head_study_on_pink_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/red_fox_on_travertine_marble_1999.html --- a/artwork_descriptions/red_fox_on_travertine_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/red_fox_on_travertine_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/red_fox_standing_in_snow_on_right_triangular_white_marble_with_grey_vein_1997.html --- a/artwork_descriptions/red_fox_standing_in_snow_on_right_triangular_white_marble_with_grey_vein_1997.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/red_fox_standing_in_snow_on_right_triangular_white_marble_with_grey_vein_1997.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/red_fox_walking_straight_at_you_on_snow_white_marble_1999.html --- a/artwork_descriptions/red_fox_walking_straight_at_you_on_snow_white_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/red_fox_walking_straight_at_you_on_snow_white_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/red_head_pair_drake_and_hen_flying_on_beige_and_grey_travertine_1999.html --- a/artwork_descriptions/red_head_pair_drake_and_hen_flying_on_beige_and_grey_travertine_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/red_head_pair_drake_and_hen_flying_on_beige_and_grey_travertine_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/red_texas_longhorn_head_on_triangular_speckled_green_and_beige_granite_undated.html --- a/artwork_descriptions/red_texas_longhorn_head_on_triangular_speckled_green_and_beige_granite_undated.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/red_texas_longhorn_head_on_triangular_speckled_green_and_beige_granite_undated.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/red_texas_longhorn_on_white_triangular_marble_1999.html --- a/artwork_descriptions/red_texas_longhorn_on_white_triangular_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/red_texas_longhorn_on_white_triangular_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/redbird_on_branch_on_green_and_white_marble_1999.html --- a/artwork_descriptions/redbird_on_branch_on_green_and_white_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/redbird_on_branch_on_green_and_white_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/redhead_drake_duck_head_study_on_greenish_grey_granite_1999.html --- a/artwork_descriptions/redhead_drake_duck_head_study_on_greenish_grey_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/redhead_drake_duck_head_study_on_greenish_grey_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/roadrunner_on_ochre_1999.html --- a/artwork_descriptions/roadrunner_on_ochre_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/roadrunner_on_ochre_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/roan_texas_longhorn_steer_on_triangular_green_and_white_marble_with_silver_specks_2007.html --- a/artwork_descriptions/roan_texas_longhorn_steer_on_triangular_green_and_white_marble_with_silver_specks_2007.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/roan_texas_longhorn_steer_on_triangular_green_and_white_marble_with_silver_specks_2007.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -78,13 +79,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/ruby_throated_sipping_from_cluster_of_pink_flowers_on_flesh_tone_marble_1999.html --- a/artwork_descriptions/ruby_throated_sipping_from_cluster_of_pink_flowers_on_flesh_tone_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/ruby_throated_sipping_from_cluster_of_pink_flowers_on_flesh_tone_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/rufus_hummingbird_sipping_nectar_from_red_flowers_on__brown_and_white_marble_1999.html --- a/artwork_descriptions/rufus_hummingbird_sipping_nectar_from_red_flowers_on__brown_and_white_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/rufus_hummingbird_sipping_nectar_from_red_flowers_on__brown_and_white_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo001.html --- a/artwork_descriptions/san_photo001.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo001.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo002.html --- a/artwork_descriptions/san_photo002.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo002.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo003.html --- a/artwork_descriptions/san_photo003.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo003.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo004.html --- a/artwork_descriptions/san_photo004.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo004.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo005.html --- a/artwork_descriptions/san_photo005.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo005.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo006.html --- a/artwork_descriptions/san_photo006.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo006.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo007.html --- a/artwork_descriptions/san_photo007.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo007.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo008.html --- a/artwork_descriptions/san_photo008.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo008.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo009.html --- a/artwork_descriptions/san_photo009.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo009.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo010.html --- a/artwork_descriptions/san_photo010.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo010.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo011.html --- a/artwork_descriptions/san_photo011.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo011.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo012.html --- a/artwork_descriptions/san_photo012.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo012.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo013.html --- a/artwork_descriptions/san_photo013.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo013.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo014.html --- a/artwork_descriptions/san_photo014.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo014.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo015.html --- a/artwork_descriptions/san_photo015.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo015.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo016.html --- a/artwork_descriptions/san_photo016.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo016.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo017.html --- a/artwork_descriptions/san_photo017.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo017.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo018.html --- a/artwork_descriptions/san_photo018.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo018.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo019.html --- a/artwork_descriptions/san_photo019.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo019.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo020.html --- a/artwork_descriptions/san_photo020.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo020.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo021.html --- a/artwork_descriptions/san_photo021.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo021.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo022.html --- a/artwork_descriptions/san_photo022.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo022.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo023.html --- a/artwork_descriptions/san_photo023.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo023.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo024.html --- a/artwork_descriptions/san_photo024.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo024.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo025.html --- a/artwork_descriptions/san_photo025.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo025.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo026.html --- a/artwork_descriptions/san_photo026.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo026.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo027.html --- a/artwork_descriptions/san_photo027.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo027.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo028.html --- a/artwork_descriptions/san_photo028.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo028.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo029.html --- a/artwork_descriptions/san_photo029.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo029.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo030.html --- a/artwork_descriptions/san_photo030.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo030.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo031.html --- a/artwork_descriptions/san_photo031.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo031.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo032.html --- a/artwork_descriptions/san_photo032.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo032.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo033.html --- a/artwork_descriptions/san_photo033.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo033.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo034.html --- a/artwork_descriptions/san_photo034.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo034.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo035.html --- a/artwork_descriptions/san_photo035.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo035.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo036.html --- a/artwork_descriptions/san_photo036.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo036.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo037.html --- a/artwork_descriptions/san_photo037.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo037.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo038.html --- a/artwork_descriptions/san_photo038.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo038.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo039.html --- a/artwork_descriptions/san_photo039.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo039.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo040.html --- a/artwork_descriptions/san_photo040.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo040.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo041.html --- a/artwork_descriptions/san_photo041.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo041.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo042.html --- a/artwork_descriptions/san_photo042.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo042.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo045.html --- a/artwork_descriptions/san_photo045.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo045.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo046.html --- a/artwork_descriptions/san_photo046.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo046.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo047.html --- a/artwork_descriptions/san_photo047.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo047.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo048.html --- a/artwork_descriptions/san_photo048.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo048.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo049.html --- a/artwork_descriptions/san_photo049.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo049.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo050.html --- a/artwork_descriptions/san_photo050.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo050.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo051.html --- a/artwork_descriptions/san_photo051.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo051.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo052.html --- a/artwork_descriptions/san_photo052.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo052.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo053.html --- a/artwork_descriptions/san_photo053.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo053.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo054.html --- a/artwork_descriptions/san_photo054.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo054.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo055.html --- a/artwork_descriptions/san_photo055.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo055.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo056.html --- a/artwork_descriptions/san_photo056.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo056.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo057.html --- a/artwork_descriptions/san_photo057.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo057.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo058.html --- a/artwork_descriptions/san_photo058.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo058.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo0x2.html --- a/artwork_descriptions/san_photo0x2.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo0x2.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/san_photo0xx.html --- a/artwork_descriptions/san_photo0xx.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/san_photo0xx.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/set_of_three_owls_1995.html --- a/artwork_descriptions/set_of_three_owls_1995.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/set_of_three_owls_1995.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/shitzu_head_study_named_Abbe_on_black_granite_2002_.html --- a/artwork_descriptions/shitzu_head_study_named_Abbe_on_black_granite_2002_.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/shitzu_head_study_named_Abbe_on_black_granite_2002_.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/siberian_tiger_head_and_chest_on_multicolored_ochre_granite_1999.html --- a/artwork_descriptions/siberian_tiger_head_and_chest_on_multicolored_ochre_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/siberian_tiger_head_and_chest_on_multicolored_ochre_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/sitting_black_lab_drake_mallard_in_mouth_with_reeds_on_white_marble_1999.html --- a/artwork_descriptions/sitting_black_lab_drake_mallard_in_mouth_with_reeds_on_white_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/sitting_black_lab_drake_mallard_in_mouth_with_reeds_on_white_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/smiling_bald_eagle_head_on_black_granite_1999_.html --- a/artwork_descriptions/smiling_bald_eagle_head_on_black_granite_1999_.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/smiling_bald_eagle_head_on_black_granite_1999_.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/soaring_bald_eagle_on_flesh_colored_marble_1999.html --- a/artwork_descriptions/soaring_bald_eagle_on_flesh_colored_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/soaring_bald_eagle_on_flesh_colored_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/soaring_bald_marble_on_beige_marble_1999.html --- a/artwork_descriptions/soaring_bald_marble_on_beige_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/soaring_bald_marble_on_beige_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/stamp001.html --- a/artwork_descriptions/stamp001.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/stamp001.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -45,13 +46,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/stamp003.html --- a/artwork_descriptions/stamp003.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/stamp003.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/stamp005.html --- a/artwork_descriptions/stamp005.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/stamp005.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/stamp007.html --- a/artwork_descriptions/stamp007.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/stamp007.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/stamp009.html --- a/artwork_descriptions/stamp009.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/stamp009.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -48,13 +49,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/stamp011.html --- a/artwork_descriptions/stamp011.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/stamp011.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -39,13 +40,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/strutting_wild_turkey_on_brown_and_white_marble_1999.html --- a/artwork_descriptions/strutting_wild_turkey_on_brown_and_white_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/strutting_wild_turkey_on_brown_and_white_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/strutting_wild_turkey_profile_on_brown_and_white_marble_1998.html --- a/artwork_descriptions/strutting_wild_turkey_profile_on_brown_and_white_marble_1998.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/strutting_wild_turkey_profile_on_brown_and_white_marble_1998.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/swimming_bottlenose_dolphin_on_green_and_white_marble_1999.html --- a/artwork_descriptions/swimming_bottlenose_dolphin_on_green_and_white_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/swimming_bottlenose_dolphin_on_green_and_white_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/texas_longhorn_steer_on_triangular_grey_marble_1998.html --- a/artwork_descriptions/texas_longhorn_steer_on_triangular_grey_marble_1998.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/texas_longhorn_steer_on_triangular_grey_marble_1998.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/three_strolling_african_elephants_on_beige_and_copper_marble_1999.html --- a/artwork_descriptions/three_strolling_african_elephants_on_beige_and_copper_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/three_strolling_african_elephants_on_beige_and_copper_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/timberwolf_full_profile_on_green_and_purple_marble_with_high_crystalization_1999.html --- a/artwork_descriptions/timberwolf_full_profile_on_green_and_purple_marble_with_high_crystalization_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/timberwolf_full_profile_on_green_and_purple_marble_with_high_crystalization_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/timberwolf_standing_on_ledge_on_purple_green_black_and_white_marble_(very_large)_1997.html --- a/artwork_descriptions/timberwolf_standing_on_ledge_on_purple_green_black_and_white_marble_(very_large)_1997.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/timberwolf_standing_on_ledge_on_purple_green_black_and_white_marble_(very_large)_1997.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/timberwolf_straight-on_head_on_triangular_grey_and_pink_marble_1999.html --- a/artwork_descriptions/timberwolf_straight-on_head_on_triangular_grey_and_pink_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/timberwolf_straight-on_head_on_triangular_grey_and_pink_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/tom_turkey_head_profile_on_green_marble_1998.html --- a/artwork_descriptions/tom_turkey_head_profile_on_green_marble_1998.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/tom_turkey_head_profile_on_green_marble_1998.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/trophy_bull_elk_rear_view_on_white_and_grey_marble_1999.html --- a/artwork_descriptions/trophy_bull_elk_rear_view_on_white_and_grey_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/trophy_bull_elk_rear_view_on_white_and_grey_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/unfriendly_grizzly_bear_head_and_chest_on_beige_marble_1998.html --- a/artwork_descriptions/unfriendly_grizzly_bear_head_and_chest_on_beige_marble_1998.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/unfriendly_grizzly_bear_head_and_chest_on_beige_marble_1998.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/upper_body_of_moose_with_foliage_on_azul_do_mar_1999.html --- a/artwork_descriptions/upper_body_of_moose_with_foliage_on_azul_do_mar_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/upper_body_of_moose_with_foliage_on_azul_do_mar_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/white_ram_head_on_triangular_grey_marble_1999.html --- a/artwork_descriptions/white_ram_head_on_triangular_grey_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/white_ram_head_on_triangular_grey_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/white_tail_buck_head_and_chest_on_yellow_travertine_1999.html --- a/artwork_descriptions/white_tail_buck_head_and_chest_on_yellow_travertine_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/white_tail_buck_head_and_chest_on_yellow_travertine_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/white_tail_buck_with_head_turned_three_quarter_pose_on_light_brown_marble_2007.html --- a/artwork_descriptions/white_tail_buck_with_head_turned_three_quarter_pose_on_light_brown_marble_2007.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/white_tail_buck_with_head_turned_three_quarter_pose_on_light_brown_marble_2007.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -79,13 +80,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/white_tail_deer_upper_body_on_light_brown_marble_1999.html --- a/artwork_descriptions/white_tail_deer_upper_body_on_light_brown_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/white_tail_deer_upper_body_on_light_brown_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/white_tail_trophy_deer_head_and_chest_on_beige_and_ochre_travertine_1999.html --- a/artwork_descriptions/white_tail_trophy_deer_head_and_chest_on_beige_and_ochre_travertine_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/white_tail_trophy_deer_head_and_chest_on_beige_and_ochre_travertine_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/whitetail_buck_head_and_chest_on_brown_and_rust_marble_1999_.html --- a/artwork_descriptions/whitetail_buck_head_and_chest_on_brown_and_rust_marble_1999_.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/whitetail_buck_head_and_chest_on_brown_and_rust_marble_1999_.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/whitetail_buck_head_and_chest_on_ochre_1998.html --- a/artwork_descriptions/whitetail_buck_head_and_chest_on_ochre_1998.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/whitetail_buck_head_and_chest_on_ochre_1998.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/whitetail_deer_standing_in_water_on_green_marble_1998.html --- a/artwork_descriptions/whitetail_deer_standing_in_water_on_green_marble_1998.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/whitetail_deer_standing_in_water_on_green_marble_1998.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/whitetail_deer_upper_body_on_beige_marble_1998.html --- a/artwork_descriptions/whitetail_deer_upper_body_on_beige_marble_1998.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/whitetail_deer_upper_body_on_beige_marble_1998.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/wild_turkey_three-quarter_pose_gobbing_on_ochre_and_dark_brown_granite_1998.html --- a/artwork_descriptions/wild_turkey_three-quarter_pose_gobbing_on_ochre_and_dark_brown_granite_1998.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/wild_turkey_three-quarter_pose_gobbing_on_ochre_and_dark_brown_granite_1998.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/wood_duck_drake_head_and_chest_on_water_on_greenish_grey_marble_1999.html --- a/artwork_descriptions/wood_duck_drake_head_and_chest_on_water_on_greenish_grey_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/wood_duck_drake_head_and_chest_on_water_on_greenish_grey_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/wood_duck_full_standing_on_white_circular_marble_1999.html --- a/artwork_descriptions/wood_duck_full_standing_on_white_circular_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/wood_duck_full_standing_on_white_circular_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/wood_duck_sitting_on_water_with_reflection_on_green_and_yellow_marble_1999.html --- a/artwork_descriptions/wood_duck_sitting_on_water_with_reflection_on_green_and_yellow_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/wood_duck_sitting_on_water_with_reflection_on_green_and_yellow_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/wood_duck_standing_in_snow_on_light_brown_marble_1999.html --- a/artwork_descriptions/wood_duck_standing_in_snow_on_light_brown_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/wood_duck_standing_in_snow_on_light_brown_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/wood_duck_standing_on_branch_in_water_on_green_and_white_marble_2007.html --- a/artwork_descriptions/wood_duck_standing_on_branch_in_water_on_green_and_white_marble_2007.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/wood_duck_standing_on_branch_in_water_on_green_and_white_marble_2007.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -81,13 +82,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/yello_lab_with_canvasback_in_mouth_on_beige_marble_1999.html --- a/artwork_descriptions/yello_lab_with_canvasback_in_mouth_on_beige_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/yello_lab_with_canvasback_in_mouth_on_beige_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/yellow_lab_head_and_chest_on_brown_pentagonal_marble_1999.html --- a/artwork_descriptions/yellow_lab_head_and_chest_on_brown_pentagonal_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/yellow_lab_head_and_chest_on_brown_pentagonal_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/yellow_lab_head_on_grey_and_pink_marble_1999.html --- a/artwork_descriptions/yellow_lab_head_on_grey_and_pink_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/yellow_lab_head_on_grey_and_pink_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/yellow_lab_head_with_bobwhite_quail_on_black_granite_1999.html --- a/artwork_descriptions/yellow_lab_head_with_bobwhite_quail_on_black_granite_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/yellow_lab_head_with_bobwhite_quail_on_black_granite_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/yellow_lab_resting_on_grass_on_black_granite_with_copper_sparkles_1999.html --- a/artwork_descriptions/yellow_lab_resting_on_grass_on_black_granite_with_copper_sparkles_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/yellow_lab_resting_on_grass_on_black_granite_with_copper_sparkles_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/yellow_lab_retrieving_mallard_on_greenish_grey_marble_1999.html --- a/artwork_descriptions/yellow_lab_retrieving_mallard_on_greenish_grey_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/yellow_lab_retrieving_mallard_on_greenish_grey_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/yellow_lab_sitting_in_reeds_with_mallard_on_brown_and_white_marble_1999.html --- a/artwork_descriptions/yellow_lab_sitting_in_reeds_with_mallard_on_brown_and_white_marble_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/yellow_lab_sitting_in_reeds_with_mallard_on_brown_and_white_marble_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/yellow_lab_with_quail_on_brown_marble_with_golden_lighting_1999.html --- a/artwork_descriptions/yellow_lab_with_quail_on_brown_marble_with_golden_lighting_1999.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/yellow_lab_with_quail_on_brown_marble_with_golden_lighting_1999.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 artwork_descriptions/young_chocolate_lab_head_with_mallard_on_flesh_colored_marble_1998.html --- a/artwork_descriptions/young_chocolate_lab_head_with_mallard_on_flesh_colored_marble_1998.html Fri Feb 19 11:14:52 2010 -0500 +++ b/artwork_descriptions/young_chocolate_lab_head_with_mallard_on_flesh_colored_marble_1998.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,13 +13,14 @@ @@ -72,13 +73,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/Installation.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/Installation.txt Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,1 @@ +################################################################## # EASY Installation Instructions ################################################################## 1. Unzip file (Pretty sure you did that already since you're reading this...moving on) 2. Open e2config.php and modify line 32: 'username' => 'password' Change username to the username you want, and same goes for the password. Save file 3. Upload 'e2gallerypro' folder to your server and visit: http://yoursiteurl/e2gallerypro/ to view temporary gallery 4. Visit http://yoursiteurl/e2gallerypro/e2upload/ and log in with your set username and password. (Note: the e2upload requires a server running PHP 5) 5. Finished with simple install. ################################################################## # Detailed Installation Instructions ################################################################## 1. Unzip file (Pretty sure you did that already since you're reading this...moving on) 2. Open e2config.php 3. Edit the XML path (if desired). Edit the PHP Version (if needed). Edit $galleryDesign (if you want or bought a new design or created your own) 4. If you plan to use the (E)2 Upload functionality, keep in mind that it requires your server to be running PHP 5. If you don't plan on using it, do not upload the e2upload folder. A. Edit GALLERY_LOCATION and XML_LOCATION if you don't want it to be at the default location (I recommend keeping it the same) B. VERY IMPORTANT: Edit the login information for the (E)2 Upload. Change the 'username' and 'password' to your desired settings: $LOGIN_INFORMATION = array( 'username' => 'password' ); If you want to have multiple login's then you'll seperate your username's and passwords with a comma, See Example: $LOGIN_INFORMATION = array( 'username1' => 'password1', 'username2' => 'password2', 'username3' => 'password3' ); C. USE_USERNAME defaults to TRUE keep this if you want a Username and Password for access to the (E)2 Upload false if you want Password only. D. LOGOUT_URL leave as index.php if you want them to be sent to the login screen on logout E. TIMEOUT_MINUTES Sets your log in time, if your idle for more then 30 min's it will ask for login info again. Set 0 to never be logged out F. TIMEOUT_CHECK_ACTIVITY checks for activity if you have a timeout setting. 5. Save e2config.php file 6. Open js/setupvars.js file and edit the desired settings A. If you plan to use Google Checkout, you'll need to input your Merchant Id from google checkout: http://checkout.google.com/support/sell/bin/answer.py?hl=en&answer=42963 B. If you plan to use Paypal to sell your prints you'll need to create a Add to Cart button using the paypal button creator under the Merchant Services Tab. Create an 'Add to Cart' button, it will output code for you to use, you'll need the 'hosted_button_id' and 'Menu option name' that you set using the button creator. See http://www.e2interactive.com/e2-gallery-pro/tutorials/ for more help. 7. Upload files to your server 8. Visit http://yoursite.com/e2gallerypro/e2upload/ and log in. Use the (E)2 Upload to upload your images, upload your XML file, and/or create your XML file (for image galleries only). 9. Upload images, create XML and Visit http://yoursite.com/e2gallerypro/ to see your gallery. Visit http://www.e2interactive.com/e2-gallery-pro/tutorials/ to see video walk through tutorails. \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/LICENSE.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/LICENSE.txt Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,25 @@ +// +------------------------------------------------------------------------+ +// | (E)2 Gallery Pro | +// +------------------------------------------------------------------------+ +// | Copyright (c) E2 Interactive 2009. All rights reserved. | +// | Version 1.2 | +// | Last modified 08/06/09 | +// | Email contact@e2interactive.com | +// | Web http://www.e2interactive.com | +// +------------------------------------------------------------------------+ +// | | +// | This software is provided 'as-is', without any expressed or implied | +// | warranty. In no way will E2 Interactive or the author(s) be held | +// | liable for any damages arising from the use of this software. | +// | | +// | Permission is granted to you (the purchaser) to use this software | +// | as a developer to build (E)2 Gallery Pro for client websites and your | +// | own personal websites you own. | +// | | +// | It is not to be redistributed, sold to anyone else or used by anyone | +// | but you (the purcheser as a developer) | +// | | +// | It didn't cost that much so please to give it away to others, have | +// | them buy a copy, I hope you enjoy using this script. | +// | | +// +------------------------------------------------------------------------+ \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/backthumbs.png Binary file e2gallerypro/design/e2gallerypro/backthumbs.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/bg.png Binary file e2gallerypro/design/e2gallerypro/bg.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/bubble.png Binary file e2gallerypro/design/e2gallerypro/bubble.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/buybutton.png Binary file e2gallerypro/design/e2gallerypro/buybutton.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/buynow_bottom.png Binary file e2gallerypro/design/e2gallerypro/buynow_bottom.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/buynow_middle.png Binary file e2gallerypro/design/e2gallerypro/buynow_middle.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/buynow_top.png Binary file e2gallerypro/design/e2gallerypro/buynow_top.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/closebtn.png Binary file e2gallerypro/design/e2gallerypro/closebtn.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/controls_bg.png Binary file e2gallerypro/design/e2gallerypro/controls_bg.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/design.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/design/e2gallerypro/design.css Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,412 @@ +body{ + background:#000; +} +#gallery #galleries #controls { + height: 17px; + padding: 3px; + margin:0 auto; + width:754px; + border-bottom:1px solid #333; + text-align:left; + background-image: url(controls_bg.png); + background-repeat: repeat-x; + color:#333; +} +#gallery #thumbnails { + height: 55px; + text-align: center; + width: 672px; + margin: 0 auto 0; + overflow: hidden; + position: relative; +} +#gallery { + font: 78% Arial, Helvetica, sans-serif; + width: 800px; + margin: 0 auto; + height: 600px; + position: relative; + overflow: hidden; + z-index: 1; +} +#gallery #galleries { + background: #333 url(images_bg.png) repeat-x; + position: absolute; + left:19px; + bottom: -575px; + height: 598px; + width: 760px; + text-align: center; + z-index: 50; + cursor: pointer; + border:1px solid #333; +} +#images { + height: 508px; + text-align: center; + position: relative; + width:760px; + overflow: hidden; + margin:0 auto 0; + background: #333 url(images_bg.png) repeat-x; + border-left: 1px solid #333; + border-right: 1px solid #333; + border-top: solid #333 1px; +} + +#imagewrap { + position:absolute; + margin:0 auto; + width: 0px; + height: 0px; + top: 200px; + left: 380px; +} +#imgsrc{ + cursor: pointer; +} +#thumbnailwrap { + left: 0px; + position: absolute; +} +.thumbnail { + background: #333; + margin: 7px 6px; + float: left; + height: 42px; + width: 42px; + border: solid #333 1px; + cursor: pointer; + overflow:hidden; +} +#gallery #thumbbox { + width: 760px; + margin:0 auto; + position:relative; + border:1px solid #333; + background: url(thumbwrap.png) no-repeat; + padding: 8px 0 0 0; + overflow: hidden; + height: 57px; +} +#loading { + height: 87px; + width: 150px; + position: absolute; + background-image: url(loading.png); + background-repeat: no-repeat; + background-position: center center; + z-index: 8888; + left: 311px; + top: 189px; +} +.gallery { + float: left; + height: 200px; + width: 250px; + background-image: url(gallery_bg.png); + background-repeat: no-repeat; + background-position: center center; + position: relative; +} +#gallery #next { + height: 510px; + width: 19px; + background-image: url(next.png); + background-repeat: no-repeat; + background-position: right center; + position: absolute; + right: 0px; + cursor: pointer; + z-index: 5; +} +#gallery #previous { + height: 510px; + width: 19px; + background-image: url(prev.png); + background-repeat: no-repeat; + background-position: left center; + position: absolute; + left: 0px; + cursor: pointer; + z-index: 5; +} +#loading #loadingbar { + position: relative; + width: 100%; + height: 87px; +} +#loading #loadingbar #bar { + position: absolute; + bottom: 19px; + left: 44px; + width: 50px; + height: 50px; +} +#largeimage { + height: 0px; + width: 0px; + position: absolute; + z-index: 99; + overflow: visible; +} +#backdrop { + background-color: #000; + height: 0px; + width: 0px; + position: absolute; + z-index: 98; + left: 50%; + top: 0px; + cursor:pointer; +} +#largeimage #closebtn { + background-image: url(closebtn.png); + background-repeat: no-repeat; + background-position: center center; + height: 28px; + width: 28px; + z-index: 100; + position: absolute; + left: -8px; + top: -8px; + cursor:pointer; +} +#galleryset .gallery h3 { + font-size: 1.5em; + font-weight: bold; + color: #666666; + margin: 10px 15px; + padding: 0px; +} +.tooltips{ + z-index: 9999999; +} +.tip { + font:Arial, Helvetica, sans-serif; + color: #CCC; + width: 220px; +} +.tip-top { + margin: 0; + color: #CCCCCC; + padding: 37px 30px 0px 30px; + background: url(tip-top.png) top left; +} +.tip-title{ + font-weight:bold; + font-size: 1.3em; + margin: 0; + color: #FFF; + padding: 0px 30px 3px 30px; + background: url(tip-middle.png) bottom right; +} +.tip-text { + font-size: 1em; + padding: 5px 30px 0px 30px; + background: url(tip-middle.png) bottom right; +} +.tip-bottom { + padding: 0px 25px 42px; + background: url(tip-bottom.png) bottom right; +} +.minitooltips{ + z-index: 9999999; +} +.minitooltips .tip { + color: #FFF; + width: 130px; +} +.minitooltips .tip-top { + margin: 0; + color: #CCCCCC; + padding: 9px 12px 0px 12px; + background: url(minitop.png) top left; +} +.minitooltips .tip-title{ + font:Georgia, "Times New Roman", Times, serif; + text-align:center; + font-weight:normal; + font-size: .8em; + margin: 0; + color: #FFF; + padding: 0px 12px 3px 12px; + background: url(minimiddle.png) bottom right; +} +.minitooltips .tip-text { + text-align:center; + font-size: .9em; + padding: 8px 12px 0px 12px; + background: url(minimiddle.png) bottom right; +} +.minitooltips .tip-bottom { + padding: 0px 12px 8px; + background: url(minibottom.png) bottom right; +} +.gallery .galleryimg { + position: absolute; + left: 23px; + top: 37px; +} +#gallery #thumbbox #thumbleft { + width: 40px; + height: 65px; + left: 0px; + position: absolute; + background: url(left_arrow.png) no-repeat center center; + visibility: hidden; + cursor: pointer; +} +#gallery #thumbbox #thumbright { + height: 65px; + width: 40px; + position: absolute; + background: url(right_arrow.png) no-repeat center center; + right: 0px; + visibility: hidden; + cursor: pointer; +} +#gallery #images #smallmessage { + background-image: url(message-popup.png); + background-repeat: no-repeat; + background-position: center top; + position: absolute; + bottom: -85px; + height: 76px; + width: 205px; + text-align: center; + padding: 8px 5px 0px; + color: #CCC; + font-size: 0.8em; +} +#gallery #images #imageinfo { + position: absolute; + bottom: -300px; + height: 250px; + width: 90%; + text-align: center; + padding: 5px 5px 0px; + color: #333; + font-size: 0.8em; + +} +#largeimage #lrgloader { + overflow: hidden; + + +} +#largeimage #lrgwrap { + overflow: hidden; + border: 1px solid #333; + background:#000; +} +#imageinfo #infoloader { + font-size: 1.2em; + color: #E1E1E1; + text-align: left; + margin: 0px; + position: releative; +} +#infoloader h2 { + font-size: 1.4em; + font-weight: bold; + color: #333; + margin: 0px; + padding: 0px; + text-shadow:#000; +} +#infoloader .copyright { + font-size: .8em; +} +#infoloader .author { + font-size: .8em; +} +.right { + float: right; +} +#fsbox { + width: 379px; + margin: 0 auto; + overflow:hidden; + height:300px; + z-index: 51; + position: absolute; + bottom: -350px; + left: 200px; + color: #FFF; +} +#fsbox #fsbutton { + color: #000; + background: url(buybutton.png) no-repeat center bottom; + height: 15px; + text-align: center; + padding: 2px 0 0 0; + margin:2px 0 6px; + font-size: 0.8em; + position: relative; + cursor:pointer; +} +#fsbox #fstop { + background: url(buynow_top.png) no-repeat center top; + height: 19px; + text-align: center; + padding: 0; + margin:0; +} +#fsbox #forsale { + background-image: url(buynow_middle.png); + background-repeat: repeat-y; + margin: 0px; + padding: 0 15px 20px; + position:relative; +} +#fsbox #forsale img{ + padding: 0 10px 10px; + +} +#fsbox hr { + clear:both; + visibility:hidden; +} +#fsbox #fsclose{ + background-image: url(closebtn.png); + background-repeat: no-repeat; + background-position: center center; + height: 28px; + width: 28px; + z-index: 220000; + cursor:pointer; + position: absolute; + left: 0px; + top: 15px; +} +#purchasebtn{ + font-weight:bold; + text-align:center; + margin:10px; + padding:11px 0 0 5px; + position:absolute; + right:15px; + top:0px; +} +#gallery #galleries #galleryset { + text-align: left; + width: 760px; + margin: 0 auto; +} +#thumbnailPopUp{ + z-index:1; + visibility:hidden; + background:url(pop_arrow.png) no-repeat center bottom; + padding-bottom:8px; + position:absolute; + top:0; + left:-10000px; +} +#thumbnailPopUp img{ + margin:0; + padding:0; + background:#333; + border:#FFF solid 3px; +} +.clear{clear:both;} diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/flash.png Binary file e2gallerypro/design/e2gallerypro/flash.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/gallery_bg.png Binary file e2gallerypro/design/e2gallerypro/gallery_bg.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/gallery_view.png Binary file e2gallerypro/design/e2gallerypro/gallery_view.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/images_bg.png Binary file e2gallerypro/design/e2gallerypro/images_bg.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/infobox.png Binary file e2gallerypro/design/e2gallerypro/infobox.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/left_arrow.png Binary file e2gallerypro/design/e2gallerypro/left_arrow.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/loading.png Binary file e2gallerypro/design/e2gallerypro/loading.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/loading_bar.gif Binary file e2gallerypro/design/e2gallerypro/loading_bar.gif has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/loading_hill.gif Binary file e2gallerypro/design/e2gallerypro/loading_hill.gif has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/message-popup.png Binary file e2gallerypro/design/e2gallerypro/message-popup.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/minibottom.png Binary file e2gallerypro/design/e2gallerypro/minibottom.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/minimiddle.png Binary file e2gallerypro/design/e2gallerypro/minimiddle.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/minitop.png Binary file e2gallerypro/design/e2gallerypro/minitop.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/morethumbs.png Binary file e2gallerypro/design/e2gallerypro/morethumbs.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/next_prev_bg.png Binary file e2gallerypro/design/e2gallerypro/next_prev_bg.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/pause.png Binary file e2gallerypro/design/e2gallerypro/pause.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/play.png Binary file e2gallerypro/design/e2gallerypro/play.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/pop_arrow.png Binary file e2gallerypro/design/e2gallerypro/pop_arrow.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/previous.png Binary file e2gallerypro/design/e2gallerypro/previous.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/purchase_btn.png Binary file e2gallerypro/design/e2gallerypro/purchase_btn.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/quicktime.png Binary file e2gallerypro/design/e2gallerypro/quicktime.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/right_arrow.png Binary file e2gallerypro/design/e2gallerypro/right_arrow.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/thumbbox.png Binary file e2gallerypro/design/e2gallerypro/thumbbox.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/thumbsbg.png Binary file e2gallerypro/design/e2gallerypro/thumbsbg.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/thumbwrap.gif Binary file e2gallerypro/design/e2gallerypro/thumbwrap.gif has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/thumbwrap.png Binary file e2gallerypro/design/e2gallerypro/thumbwrap.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/tip-bottom.png Binary file e2gallerypro/design/e2gallerypro/tip-bottom.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/tip-middle.png Binary file e2gallerypro/design/e2gallerypro/tip-middle.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/tip-top.png Binary file e2gallerypro/design/e2gallerypro/tip-top.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/tip_bottom.png Binary file e2gallerypro/design/e2gallerypro/tip_bottom.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/tip_middle.png Binary file e2gallerypro/design/e2gallerypro/tip_middle.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2gallerypro/tip_top.png Binary file e2gallerypro/design/e2gallerypro/tip_top.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/backthumbs.png Binary file e2gallerypro/design/e2simple/backthumbs.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/bubble.png Binary file e2gallerypro/design/e2simple/bubble.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/buybutton.png Binary file e2gallerypro/design/e2simple/buybutton.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/buynow_bottom.png Binary file e2gallerypro/design/e2simple/buynow_bottom.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/buynow_middle.png Binary file e2gallerypro/design/e2simple/buynow_middle.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/buynow_top.png Binary file e2gallerypro/design/e2simple/buynow_top.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/closebtn.png Binary file e2gallerypro/design/e2simple/closebtn.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/design.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/design/e2simple/design.css Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,411 @@ +body{ +} +#gallery #galleries #controls { + height: 17px; + padding: 3px; + margin:0 auto; + width:754px; + border-bottom:1px solid #333; + text-align:left; + background-image: url(controls_bg.png); + background-repeat: repeat-x; + color:#333; +} +#gallery #thumbnails { + height: 57px; + text-align: center; + width: 672px; + margin: 0 auto 0; + overflow: hidden; + position: relative; +} +#gallery { + font: 78% Arial, Helvetica, sans-serif; + width: 800px; + margin: 0 auto; + height: 600px; + position: relative; + overflow: hidden; + z-index: 1; +} +#gallery #galleries { + background: #FFF url(images_bg.png) repeat-x; + position: absolute; + left:19px; + bottom: -575px; + height: 598px; + width: 760px; + text-align: center; + z-index: 50; + cursor: pointer; + border:1px solid #333; +} +#images { + height: 508px; + text-align: center; + position: relative; + width:760px; + overflow: hidden; + margin:0 auto 0; + background: url(images_bg.png) repeat-x; + border-left: 1px solid #333; + border-right: 1px solid #333; + border-top: solid #333 1px; +} + +#imagewrap { + background: #E1E1E1; + position:absolute; + margin:0 auto; + width: 0px; + height: 0px; + top: 200px; + left: 380px; +} +#imgsrc{ + cursor: pointer; +} +#thumbnailwrap { + left: 0px; + position: absolute; +} +.thumbnail { + margin: 7px 6px; + float: left; + height: 42px; + width: 42px; + border: solid #333 1px; + cursor: pointer; + overflow:hidden; +} +#gallery #thumbbox { + width: 760px; + margin:0 auto; + position:relative; + border:1px solid #333; + background: url(thumbwrap.png) no-repeat; + padding: 8px 0 0 0; + overflow: hidden; + height: 57px; +} +#loading { + height: 87px; + width: 150px; + position: absolute; + background-image: url(loading.png); + background-repeat: no-repeat; + background-position: center center; + z-index: 8888; + left: 311px; + top: 189px; +} +.gallery { + float: left; + height: 200px; + width: 250px; + background-image: url(gallery_bg.png); + background-repeat: no-repeat; + background-position: center center; + position: relative; +} +#gallery #next { + height: 510px; + width: 19px; + background-image: url(next.png); + background-repeat: no-repeat; + background-position: right center; + position: absolute; + right: 0px; + cursor: pointer; + z-index: 5; +} +#gallery #previous { + height: 510px; + width: 19px; + background-image: url(prev.png); + background-repeat: no-repeat; + background-position: left center; + position: absolute; + left: 0px; + cursor: pointer; + z-index: 5; +} +#loading #loadingbar { + position: relative; + width: 100%; + height: 87px; +} +#loading #loadingbar #bar { + position: absolute; + bottom: 19px; + left: 44px; + width: 50px; + height: 50px; +} +#largeimage { + height: 0px; + width: 0px; + position: absolute; + z-index: 99; + overflow: visible; +} +#backdrop { + background-color: #000; + height: 0px; + width: 0px; + position: absolute; + z-index: 98; + left: 50%; + top: 0px; + cursor:pointer; +} +#largeimage #closebtn { + background-image: url(closebtn.png); + background-repeat: no-repeat; + background-position: center center; + height: 28px; + width: 28px; + z-index: 100; + position: absolute; + left: -8px; + top: -8px; + cursor:pointer; +} +#galleryset .gallery h3 { + font-size: 1.5em; + font-weight: bold; + color: #666666; + margin: 10px 15px; + padding: 0px; +} +.tooltips{ + z-index: 9999999; +} +.tip { + font:Arial, Helvetica, sans-serif; + color: #CCC; + width: 220px; +} +.tip-top { + margin: 0; + color: #CCCCCC; + padding: 37px 30px 0px 30px; + background: url(tip-top.png) top left; +} +.tip-title{ + font-weight:bold; + font-size: 1.3em; + margin: 0; + color: #FFF; + padding: 0px 30px 3px 30px; + background: url(tip-middle.png) bottom right; +} +.tip-text { + font-size: 1em; + padding: 5px 30px 0px 30px; + background: url(tip-middle.png) bottom right; +} +.tip-bottom { + padding: 0px 25px 42px; + background: url(tip-bottom.png) bottom right; +} +.minitooltips{ + z-index: 9999999; +} +.minitooltips .tip { + color: #FFF; + width: 130px; +} +.minitooltips .tip-top { + margin: 0; + color: #CCCCCC; + padding: 9px 12px 0px 12px; + background: url(minitop.png) top left; +} +.minitooltips .tip-title{ + font:Georgia, "Times New Roman", Times, serif; + text-align:center; + font-weight:normal; + font-size: .8em; + margin: 0; + color: #FFF; + padding: 0px 12px 3px 12px; + background: url(minimiddle.png) bottom right; +} +.minitooltips .tip-text { + text-align:center; + font-size: .9em; + padding: 8px 12px 0px 12px; + background: url(minimiddle.png) bottom right; +} +.minitooltips .tip-bottom { + padding: 0px 12px 8px; + background: url(minibottom.png) bottom right; +} +.gallery .galleryimg { + position: absolute; + left: 23px; + top: 37px; +} +#gallery #thumbbox #thumbleft { + width: 40px; + height: 65px; + left: 0px; + position: absolute; + background: url(left_arrow.png) no-repeat center center; + visibility: hidden; + cursor: pointer; +} +#gallery #thumbbox #thumbright { + height: 65px; + width: 40px; + position: absolute; + background: url(right_arrow.png) no-repeat center center; + right: 0px; + visibility: hidden; + cursor: pointer; +} +#gallery #images #smallmessage { + background-image: url(message-popup.png); + background-repeat: no-repeat; + background-position: center top; + position: absolute; + bottom: -85px; + height: 76px; + width: 205px; + text-align: center; + padding: 8px 5px 0px; + color: #CCC; + font-size: 0.8em; +} +#gallery #images #imageinfo { + position: absolute; + bottom: -300px; + height: 250px; + width: 90%; + text-align: center; + padding: 5px 5px 0px; + color: #333; + font-size: 0.8em; + left: 0px; +} +#largeimage #lrgloader { + overflow: hidden; + + +} +#largeimage #lrgwrap { + overflow: hidden; + border: 1px solid #333; + background: #FFF url(images_bg.png) repeat-x; +} +#imageinfo #infoloader { + font-size: 1.2em; + color: #E1E1E1; + text-align: left; + margin: 0px; + position: releative; +} +#infoloader h2 { + font-size: 1.4em; + font-weight: bold; + color: #333; + margin: 0px; + padding: 0px; + text-shadow:#000; +} +#infoloader .copyright { + font-size: .8em; +} +#infoloader .author { + font-size: .8em; +} +.right { + float: right; +} +#fsbox { + width: 379px; + margin: 0 auto; + overflow:hidden; + height:300px; + z-index: 51; + position: absolute; + bottom: -350px; + left: 200px; + color: #FFF; +} +#fsbox #fsbutton { + color: #000; + background: url(buybutton.png) no-repeat center bottom; + height: 15px; + text-align: center; + padding: 2px 0 0 0; + margin:2px 0 6px; + font-size: 0.8em; + position: relative; + cursor:pointer; +} +#fsbox #fstop { + background: url(buynow_top.png) no-repeat center top; + height: 19px; + text-align: center; + padding: 0; + margin:0; +} +#fsbox #forsale { + background-image: url(buynow_middle.png); + background-repeat: repeat-y; + margin: 0px; + padding: 0 15px 20px; + position:relative; +} +#fsbox #forsale img{ + padding: 0 10px 10px; + +} +#fsbox hr { + clear:both; + visibility:hidden; +} +#fsbox #fsclose{ + background-image: url(closebtn.png); + background-repeat: no-repeat; + background-position: center center; + height: 28px; + width: 28px; + z-index: 220000; + cursor:pointer; + position: absolute; + left: 0px; + top: 15px; +} +#purchasebtn{ + font-weight:bold; + text-align:center; + margin:10px; + padding:11px 0 0 5px; + position:absolute; + right:15px; + top:0px; +} +#gallery #galleries #galleryset { + text-align: left; + width: 760px; + margin: 0 auto; +} +#thumbnailPopUp{ + z-index:1; + visibility:hidden; + background:url(pop_arrow.png) no-repeat center bottom; + padding-bottom:8px; + position:absolute; + top:0; + left:-10000px; +} +#thumbnailPopUp img{ + margin:0; + padding:0; + background:#333; + border:#FFF solid 3px; +} +.clear{clear:both;} diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/flash.png Binary file e2gallerypro/design/e2simple/flash.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/gallery_bg.png Binary file e2gallerypro/design/e2simple/gallery_bg.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/gallery_view.png Binary file e2gallerypro/design/e2simple/gallery_view.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/images_bg.png Binary file e2gallerypro/design/e2simple/images_bg.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/infobox.png Binary file e2gallerypro/design/e2simple/infobox.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/loading.png Binary file e2gallerypro/design/e2simple/loading.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/loading_hill.gif Binary file e2gallerypro/design/e2simple/loading_hill.gif has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/message-popup.png Binary file e2gallerypro/design/e2simple/message-popup.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/minibottom.png Binary file e2gallerypro/design/e2simple/minibottom.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/minimiddle.png Binary file e2gallerypro/design/e2simple/minimiddle.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/minitop.png Binary file e2gallerypro/design/e2simple/minitop.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/morethumbs.png Binary file e2gallerypro/design/e2simple/morethumbs.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/next.png Binary file e2gallerypro/design/e2simple/next.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/pause.png Binary file e2gallerypro/design/e2simple/pause.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/play.png Binary file e2gallerypro/design/e2simple/play.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/prev.png Binary file e2gallerypro/design/e2simple/prev.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/previous.png Binary file e2gallerypro/design/e2simple/previous.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/purchase_btn.png Binary file e2gallerypro/design/e2simple/purchase_btn.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/quicktime.png Binary file e2gallerypro/design/e2simple/quicktime.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/thumbbox.png Binary file e2gallerypro/design/e2simple/thumbbox.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/thumbwrap.png Binary file e2gallerypro/design/e2simple/thumbwrap.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/tip-bottom.png Binary file e2gallerypro/design/e2simple/tip-bottom.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/tip-middle.png Binary file e2gallerypro/design/e2simple/tip-middle.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/tip-top.png Binary file e2gallerypro/design/e2simple/tip-top.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/tip_bottom.png Binary file e2gallerypro/design/e2simple/tip_bottom.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/tip_middle.png Binary file e2gallerypro/design/e2simple/tip_middle.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/design/e2simple/tip_top.png Binary file e2gallerypro/design/e2simple/tip_top.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2config.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2config.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,71 @@ + 'username1', + 'username2' => 'username2pass' +);*/ +//Change this to the username and password you prefer: +$LOGIN_INFORMATION = array( + 'rlm' => '1005025' +); + +// request login? true - show login and password boxes, false - password box only +define('USE_USERNAME', true); + +// User will be redirected to this page after logout +//Set this to any page on your site with a full URL +define('LOGOUT_URL', 'index.php'); + +// time out after NN minutes of inactivity. Set to 0 to not timeout +//This is the timeout of the login cookie +define('TIMEOUT_MINUTES', 30); + +// This parameter is only useful when TIMEOUT_MINUTES is not zero +// true - timeout time from last activity, false - timeout time from login +define('TIMEOUT_CHECK_ACTIVITY', true); + +################################################################## +# SETTINGS For E2 Upload End +################################################################## +?> diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2gallery.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2gallery.xml Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,114 @@ + + + + + + + 4 + Gallery Title + Gallery Description + /e2gallerypro/gallery/gallery1/ + /e2gallerypro/gallery/gallery1/large/ + /e2gallerypro/gallery/gallery1/thumbs/ + /e2gallerypro/gallery/gallery1/ + mainthumb.jpg + + + + + Cload Rays + E2interactive + Copyright E2interactive + Looking up to the sky while the clouds pass on a summer day + DSC_0670.jpg + + + 15 + 25 + 55 + 65 + + + + Down the Tracks + E2interactive + Copyright E2interactive 2007 + Looking across the bridge over the Crocked River in Crocked River Ranch Oregon + DSC_2051.jpg + + + 15 + 25 + 55 + 65 + + + + Sit Down + E2interactive + Copyright E2interactive + + DSC_2343.jpg + + + 15 + 25 + 55 + 65 + + + + Sky High + E2interactive + Copyright E2interactive + Went to the local race track to watch riders on the Motocross track. There was this kid on a small 125cc just screaming around the track showing all the older kids how to ride. + DSC_7850.jpg + + + 15 + 25 + 55 + 65 + + + + Untitled Ceiling + E2interactive + Copyright E2interactive + I liked the lines of this ceiling so I took an image of it. + E29_2000.jpg + + + 15 + 25 + 55 + 65 + + + + + + + 4 + Gallery Title + Gallery Description + /e2gallerypro/gallery/gallery1/ + /e2gallerypro/gallery/gallery1/large/ + /e2gallerypro/gallery/gallery1/thumbs/ + /e2gallerypro/gallery/gallery1/ + mainthumb.jpg + + + + + /e2gallerypro/gallery/gallery2/swf_file.swf + SWF file Test + E2 Gallery Pro SWF Sample + None + E2 Gallery Pro SWF Sample + design/e2gallerypro/flash.png + + + + + \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/7z.png Binary file e2gallerypro/e2upload/Assets/Icons/7z.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/ace.png Binary file e2gallerypro/e2upload/Assets/Icons/ace.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/as.png Binary file e2gallerypro/e2upload/Assets/Icons/as.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/bat.png Binary file e2gallerypro/e2upload/Assets/Icons/bat.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/bmp.png Binary file e2gallerypro/e2upload/Assets/Icons/bmp.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/cmd.png Binary file e2gallerypro/e2upload/Assets/Icons/cmd.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/default.png Binary file e2gallerypro/e2upload/Assets/Icons/default.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/dir.png Binary file e2gallerypro/e2upload/Assets/Icons/dir.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/dir_up.png Binary file e2gallerypro/e2upload/Assets/Icons/dir_up.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/doc.png Binary file e2gallerypro/e2upload/Assets/Icons/doc.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/docx.png Binary file e2gallerypro/e2upload/Assets/Icons/docx.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/exe.png Binary file e2gallerypro/e2upload/Assets/Icons/exe.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/flv.png Binary file e2gallerypro/e2upload/Assets/Icons/flv.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/gif.png Binary file e2gallerypro/e2upload/Assets/Icons/gif.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/gz.png Binary file e2gallerypro/e2upload/Assets/Icons/gz.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/html.png Binary file e2gallerypro/e2upload/Assets/Icons/html.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/ini.png Binary file e2gallerypro/e2upload/Assets/Icons/ini.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/iso.png Binary file e2gallerypro/e2upload/Assets/Icons/iso.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/jpeg.png Binary file e2gallerypro/e2upload/Assets/Icons/jpeg.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/jpg.png Binary file e2gallerypro/e2upload/Assets/Icons/jpg.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/js.png Binary file e2gallerypro/e2upload/Assets/Icons/js.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/lnk.png Binary file e2gallerypro/e2upload/Assets/Icons/lnk.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/mp3.png Binary file e2gallerypro/e2upload/Assets/Icons/mp3.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/odp.png Binary file e2gallerypro/e2upload/Assets/Icons/odp.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/ods.png Binary file e2gallerypro/e2upload/Assets/Icons/ods.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/odt.png Binary file e2gallerypro/e2upload/Assets/Icons/odt.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/pdf.png Binary file e2gallerypro/e2upload/Assets/Icons/pdf.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/php.png Binary file e2gallerypro/e2upload/Assets/Icons/php.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/png.png Binary file e2gallerypro/e2upload/Assets/Icons/png.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/ppt.png Binary file e2gallerypro/e2upload/Assets/Icons/ppt.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/rar.png Binary file e2gallerypro/e2upload/Assets/Icons/rar.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/rb.png Binary file e2gallerypro/e2upload/Assets/Icons/rb.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/sql.png Binary file e2gallerypro/e2upload/Assets/Icons/sql.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/swf.png Binary file e2gallerypro/e2upload/Assets/Icons/swf.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/tar.png Binary file e2gallerypro/e2upload/Assets/Icons/tar.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/wmv.png Binary file e2gallerypro/e2upload/Assets/Icons/wmv.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/xls.png Binary file e2gallerypro/e2upload/Assets/Icons/xls.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/xlsx.png Binary file e2gallerypro/e2upload/Assets/Icons/xlsx.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Icons/zip.png Binary file e2gallerypro/e2upload/Assets/Icons/zip.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/Swiff.Uploader.swf Binary file e2gallerypro/e2upload/Assets/Swiff.Uploader.swf has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/add.png Binary file e2gallerypro/e2upload/Assets/add.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/bar.gif Binary file e2gallerypro/e2upload/Assets/bar.gif has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/button.png Binary file e2gallerypro/e2upload/Assets/button.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/button_disabled.png Binary file e2gallerypro/e2upload/Assets/button_disabled.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/cancel.png Binary file e2gallerypro/e2upload/Assets/cancel.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/checkbox.png Binary file e2gallerypro/e2upload/Assets/checkbox.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/destroy.png Binary file e2gallerypro/e2upload/Assets/destroy.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/dewplayer.swf Binary file e2gallerypro/e2upload/Assets/dewplayer.swf has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/dialog.png Binary file e2gallerypro/e2upload/Assets/dialog.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/disk.png Binary file e2gallerypro/e2upload/Assets/disk.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/filelist.png Binary file e2gallerypro/e2upload/Assets/filelist.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/filelist_selected.png Binary file e2gallerypro/e2upload/Assets/filelist_selected.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/loader.gif Binary file e2gallerypro/e2upload/Assets/loader.gif has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/menu.png Binary file e2gallerypro/e2upload/Assets/menu.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/progress.gif Binary file e2gallerypro/e2upload/Assets/progress.gif has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Assets/rename.png Binary file e2gallerypro/e2upload/Assets/rename.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/getid3.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/getid3.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,1598 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | getid3.php | +// | Main getID3() file. | +// | dependencies: modules. | +// +----------------------------------------------------------------------+ +// +// $Id: getid3.php,v 1.26 2006/12/25 23:44:23 ah Exp $ + + +class getid3 +{ + //// Settings Section - do NOT modify this file - change setting after newing getid3! + + // Encoding + public $encoding = 'ISO-8859-1'; // CASE SENSITIVE! - i.e. (must be supported by iconv() - see http://www.gnu.org/software/libiconv/). Examples: ISO-8859-1 UTF-8 UTF-16 UTF-16BE. + public $encoding_id3v1 = 'ISO-8859-1'; // Override SPECIFICATION encoding for broken ID3v1 tags caused by bad tag programs. Examples: 'EUC-CN' for "Chinese MP3s" and 'CP1251' for "Cyrillic". + public $encoding_id3v2 = 'ISO-8859-1'; // Override ISO-8859-1 encoding for broken ID3v2 tags caused by BRAINDEAD tag programs that writes system codepage as 'ISO-8859-1' instead of UTF-8. + + // Tags - disable for speed + public $option_tag_id3v1 = true; // Read and process ID3v1 tags. + public $option_tag_id3v2 = true; // Read and process ID3v2 tags. + public $option_tag_lyrics3 = true; // Read and process Lyrics3 tags. + public $option_tag_apetag = true; // Read and process APE tags. + + // Misc calucations - disable for speed + public $option_analyze = true; // Analyze file - disable if you only need to detect file format. + public $option_accurate_results = true; // Disable to greatly speed up parsing of some file formats at the cost of accuracy. + public $option_tags_process = true; // Copy tags to root key 'tags' and 'comments' and encode to $this->encoding. + public $option_tags_images = false; // Scan tags for binary image data - ID3v2 and vorbiscomments only. + public $option_extra_info = true; // Calculate/return additional info such as bitrate, channelmode etc. + public $option_max_2gb_check = false; // Check whether file is larger than 2 Gb and thus not supported by PHP. + + // Misc data hashes - slow - require hash module + public $option_md5_data = false; // Get MD5 sum of data part - slow. + public $option_md5_data_source = false; // Use MD5 of source file if available - only FLAC, MAC, OptimFROG and Wavpack4. + public $option_sha1_data = false; // Get SHA1 sum of data part - slow. + + // Public variables + public $filename; // Filename of file being analysed. + public $fp; // Filepointer to file being analysed. + public $info; // Result array. + + // Protected variables + protected $include_path; // getid3 include path. + protected $warnings = array (); + protected $iconv_present; + + // Class constants + const VERSION = '2.0.0b4'; + const FREAD_BUFFER_SIZE = 16384; // Read buffer size in bytes. + const ICONV_TEST_STRING = ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ'; + + + + // Constructor - check PHP enviroment and load library. + public function __construct() { + + // Static varibles - no need to recalc every time we new getid3. + static $include_path; + static $iconv_present; + + + static $initialized; + if ($initialized) { + + // Import static variables + $this->include_path = $include_path; + $this->iconv_present = $iconv_present; + + // Run init checks only on first instance. + return; + } + + // Get include_path + $this->include_path = $include_path = dirname(__FILE__) . '/'; + + // Check for presence of iconv() and make sure it works (simpel test only). + if (function_exists('iconv') && @iconv('UTF-16LE', 'ISO-8859-1', @iconv('ISO-8859-1', 'UTF-16LE', getid3::ICONV_TEST_STRING)) == getid3::ICONV_TEST_STRING) { + $this->iconv_present = $iconv_present = true; + } + + // iconv() not present - load replacement module. + else { + $this->include_module('lib.iconv_replacement'); + $this->iconv_present = $iconv_present = false; + } + + + // Require magic_quotes_runtime off + if (get_magic_quotes_runtime()) { + throw new getid3_exception('magic_quotes_runtime must be disabled before running getID3(). Surround getid3 block by set_magic_quotes_runtime(0) and set_magic_quotes_runtime(1).'); + } + + + // Check memory limit. + $memory_limit = ini_get('memory_limit'); + if (eregi('([0-9]+)M', $memory_limit, $matches)) { + // could be stored as "16M" rather than 16777216 for example + $memory_limit = $matches[1] * 1048576; + } + if ($memory_limit <= 0) { + // Should not happen. + } elseif ($memory_limit <= 4194304) { + $this->warning('[SERIOUS] PHP has less than 4 Mb available memory and will very likely run out. Increase memory_limit in php.ini.'); + } elseif ($memory_limit <= 12582912) { + $this->warning('PHP has less than 12 Mb available memory and might run out if all modules are loaded. Increase memory_limit in php.ini if needed.'); + } + + + // Check safe_mode off + if ((bool)ini_get('safe_mode')) { + $this->warning('Safe mode is on, shorten support disabled, md5data/sha1data for ogg vorbis disabled, ogg vorbis/flac tag writing disabled.'); + } + + $initialized = true; + } + + + + // Analyze file by name + public function Analyze($filename) { + + // Init and save values + $this->filename = $filename; + $this->warnings = array (); + + // Init result array and set parameters + $this->info = array (); + $this->info['GETID3_VERSION'] = getid3::VERSION; + + // Remote files not supported + if (preg_match('/^(ht|f)tp:\/\//', $filename)) { + throw new getid3_exception('Remote files are not supported - please copy the file locally first.'); + } + + // Open local file + if (!$this->fp = @fopen($filename, 'rb')) { + throw new getid3_exception('Could not open file "'.$filename.'"'); + } + + // Set filesize related parameters + $this->info['filesize'] = filesize($filename); + $this->info['avdataoffset'] = 0; + $this->info['avdataend'] = $this->info['filesize']; + + // Option_max_2gb_check + if ($this->option_max_2gb_check) { + // PHP doesn't support integers larger than 31-bit (~2GB) + // filesize() simply returns (filesize % (pow(2, 32)), no matter the actual filesize + // ftell() returns 0 if seeking to the end is beyond the range of unsigned integer + fseek($this->fp, 0, SEEK_END); + if ((($this->info['filesize'] != 0) && (ftell($this->fp) == 0)) || + ($this->info['filesize'] < 0) || + (ftell($this->fp) < 0)) { + unset($this->info['filesize']); + fclose($this->fp); + throw new getid3_exception('File is most likely larger than 2GB and is not supported by PHP.'); + } + } + + + // ID3v2 detection (NOT parsing) done to make fileformat easier. + if (!$this->option_tag_id3v2) { + + fseek($this->fp, 0, SEEK_SET); + $header = fread($this->fp, 10); + if (substr($header, 0, 3) == 'ID3' && strlen($header) == 10) { + $this->info['id3v2']['header'] = true; + $this->info['id3v2']['majorversion'] = ord($header{3}); + $this->info['id3v2']['minorversion'] = ord($header{4}); + $this->info['avdataoffset'] += getid3_lib::BigEndian2Int(substr($header, 6, 4), 1) + 10; // length of ID3v2 tag in 10-byte header doesn't include 10-byte header length + } + } + + + // Handle tags + foreach (array ("id3v2", "id3v1", "apetag", "lyrics3") as $tag_name) { + + $option_tag = 'option_tag_' . $tag_name; + if ($this->$option_tag) { + $this->include_module('tag.'.$tag_name); + try { + $tag_class = 'getid3_' . $tag_name; + $tag = new $tag_class($this); + $tag->Analyze(); + } + catch (getid3_exception $e) { + throw $e; + } + } + } + + + + //// Determine file format by magic bytes in file header. + + // Read 32 kb file data + fseek($this->fp, $this->info['avdataoffset'], SEEK_SET); + $filedata = fread($this->fp, 32774); + + // Get huge FileFormatArray + $file_format_array = getid3::GetFileFormatArray(); + + // Identify file format - loop through $format_info and detect with reg expr + foreach ($file_format_array as $name => $info) { + + if (preg_match('/'.$info['pattern'].'/s', $filedata)) { // The /s switch on preg_match() forces preg_match() NOT to treat newline (0x0A) characters as special chars but do a binary match + + // Format detected but not supported + if (!@$info['module'] || !@$info['group']) { + fclose($this->fp); + $this->info['fileformat'] = $name; + $this->info['mime_type'] = $info['mime_type']; + $this->warning('Format only detected. Parsing not available yet.'); + $this->info['warning'] = $this->warnings; + return $this->info; + } + + $determined_format = $info; // copy $info deleted by foreach() + continue; + } + } + + // Unable to determine file format + if (!@$determined_format) { + + // Too many mp3 encoders on the market put gabage in front of mpeg files + // use assume format on these if format detection failed + if (preg_match('/\.mp[123a]$/i', $filename)) { + $determined_format = $file_format_array['mp3']; + } + + else { + fclose($this->fp); + throw new getid3_exception('Unable to determine file format'); + } + } + + // Free memory + unset($file_format_array); + + // Check for illegal ID3 tags + if (@$determined_format['fail_id3'] && (@$this->info['id3v1'] || @$this->info['id3v2'])) { + if ($determined_format['fail_id3'] === 'ERROR') { + fclose($this->fp); + throw new getid3_exception('ID3 tags not allowed on this file type.'); + } + elseif ($determined_format['fail_id3'] === 'WARNING') { + @$this->info['id3v1'] and $this->warning('ID3v1 tags not allowed on this file type.'); + @$this->info['id3v2'] and $this->warning('ID3v2 tags not allowed on this file type.'); + } + } + + // Check for illegal APE tags + if (@$determined_format['fail_ape'] && @$this->info['tags']['ape']) { + if ($determined_format['fail_ape'] === 'ERROR') { + fclose($this->fp); + throw new getid3_exception('APE tags not allowed on this file type.'); + } elseif ($determined_format['fail_ape'] === 'WARNING') { + $this->warning('APE tags not allowed on this file type.'); + } + } + + + // Set mime type + $this->info['mime_type'] = $determined_format['mime_type']; + + // Calc module file name + $determined_format['include'] = 'module.'.$determined_format['group'].'.'.$determined_format['module'].'.php'; + + // Supported format signature pattern detected, but module deleted. + if (!file_exists($this->include_path.$determined_format['include'])) { + fclose($this->fp); + throw new getid3_exception('Format not supported, module, '.$determined_format['include'].', was removed.'); + } + + // Include module + $this->include_module($determined_format['group'].'.'.$determined_format['module']); + + // Instantiate module class and analyze + $class_name = 'getid3_'.$determined_format['module']; + if (!class_exists($class_name)) { + throw new getid3_exception('Format not supported, module, '.$determined_format['include'].', is corrupt.'); + } + $class = new $class_name($this); + + try { + $this->option_analyze and $class->Analyze(); + } + catch (getid3_exception $e) { + throw $e; + } + catch (Exception $e) { + throw new getid3_exception('Corrupt file.'); + } + + // Close file + fclose($this->fp); + + // Optional - Process all tags - copy to 'tags' and convert charsets + if ($this->option_tags_process) { + $this->HandleAllTags(); + } + + + //// Optional - perform more calculations + if ($this->option_extra_info) { + + // Set channelmode on audio + if (@$this->info['audio']['channels'] == '1') { + $this->info['audio']['channelmode'] = 'mono'; + } elseif (@$this->info['audio']['channels'] == '2') { + $this->info['audio']['channelmode'] = 'stereo'; + } + + // Calculate combined bitrate - audio + video + $combined_bitrate = 0; + $combined_bitrate += (isset($this->info['audio']['bitrate']) ? $this->info['audio']['bitrate'] : 0); + $combined_bitrate += (isset($this->info['video']['bitrate']) ? $this->info['video']['bitrate'] : 0); + if (($combined_bitrate > 0) && empty($this->info['bitrate'])) { + $this->info['bitrate'] = $combined_bitrate; + } + if (!isset($this->info['playtime_seconds']) && !empty($this->info['bitrate'])) { + $this->info['playtime_seconds'] = (($this->info['avdataend'] - $this->info['avdataoffset']) * 8) / $this->info['bitrate']; + } + + // Set playtime string + if (!empty($this->info['playtime_seconds']) && empty($this->info['playtime_string'])) { + $this->info['playtime_string'] = floor(round($this->info['playtime_seconds']) / 60) . ':' . str_pad(floor(round($this->info['playtime_seconds']) % 60), 2, 0, STR_PAD_LEFT);; + } + + + // CalculateCompressionRatioVideo() { + if (@$this->info['video'] && @$this->info['video']['resolution_x'] && @$this->info['video']['resolution_y'] && @$this->info['video']['bits_per_sample']) { + + // From static image formats + if (in_array($this->info['video']['dataformat'], array ('bmp', 'gif', 'jpeg', 'jpg', 'png', 'tiff'))) { + $frame_rate = 1; + $bitrate_compressed = $this->info['filesize'] * 8; + } + + // From video formats + else { + $frame_rate = @$this->info['video']['frame_rate']; + $bitrate_compressed = @$this->info['video']['bitrate']; + } + + if ($frame_rate && $bitrate_compressed) { + $this->info['video']['compression_ratio'] = $bitrate_compressed / ($this->info['video']['resolution_x'] * $this->info['video']['resolution_y'] * $this->info['video']['bits_per_sample'] * $frame_rate); + } + } + + + // CalculateCompressionRatioAudio() { + if (@$this->info['audio']['bitrate'] && @$this->info['audio']['channels'] && @$this->info['audio']['sample_rate']) { + $this->info['audio']['compression_ratio'] = $this->info['audio']['bitrate'] / ($this->info['audio']['channels'] * $this->info['audio']['sample_rate'] * (@$this->info['audio']['bits_per_sample'] ? $this->info['audio']['bits_per_sample'] : 16)); + } + + if (@$this->info['audio']['streams']) { + foreach ($this->info['audio']['streams'] as $stream_number => $stream_data) { + if (@$stream_data['bitrate'] && @$stream_data['channels'] && @$stream_data['sample_rate']) { + $this->info['audio']['streams'][$stream_number]['compression_ratio'] = $stream_data['bitrate'] / ($stream_data['channels'] * $stream_data['sample_rate'] * (@$stream_data['bits_per_sample'] ? $stream_data['bits_per_sample'] : 16)); + } + } + } + + + // CalculateReplayGain() { + if (@$this->info['replay_gain']) { + if (!@$this->info['replay_gain']['reference_volume']) { + $this->info['replay_gain']['reference_volume'] = 89; + } + if (isset($this->info['replay_gain']['track']['adjustment'])) { + $this->info['replay_gain']['track']['volume'] = $this->info['replay_gain']['reference_volume'] - $this->info['replay_gain']['track']['adjustment']; + } + if (isset($this->info['replay_gain']['album']['adjustment'])) { + $this->info['replay_gain']['album']['volume'] = $this->info['replay_gain']['reference_volume'] - $this->info['replay_gain']['album']['adjustment']; + } + + if (isset($this->info['replay_gain']['track']['peak'])) { + $this->info['replay_gain']['track']['max_noclip_gain'] = 0 - 20 * log10($this->info['replay_gain']['track']['peak']); + } + if (isset($this->info['replay_gain']['album']['peak'])) { + $this->info['replay_gain']['album']['max_noclip_gain'] = 0 - 20 * log10($this->info['replay_gain']['album']['peak']); + } + } + + + // ProcessAudioStreams() { + if (@!$this->info['audio']['streams'] && (@$this->info['audio']['bitrate'] || @$this->info['audio']['channels'] || @$this->info['audio']['sample_rate'])) { + foreach ($this->info['audio'] as $key => $value) { + if ($key != 'streams') { + $this->info['audio']['streams'][0][$key] = $value; + } + } + } + } + + + // Get the md5/sha1sum of the audio/video portion of the file - without ID3/APE/Lyrics3/etc header/footer tags. + if ($this->option_md5_data || $this->option_sha1_data) { + + // Load data-hash library if needed + $this->include_module('lib.data_hash'); + + if ($this->option_sha1_data) { + new getid3_lib_data_hash($this, 'sha1'); + } + + if ($this->option_md5_data) { + + // no md5_data_source or option disabled -- md5_data_source supported by FLAC, MAC, OptimFROG, Wavpack4 + if (!$this->option_md5_data_source || !@$this->info['md5_data_source']) { + new getid3_lib_data_hash($this, 'md5'); + } + + // copy md5_data_source to md5_data if option set to true + elseif ($this->option_md5_data_source && @$this->info['md5_data_source']) { + $this->info['md5_data'] = $this->info['md5_data_source']; + } + } + } + + // Set warnings + if ($this->warnings) { + $this->info['warning'] = $this->warnings; + } + + // Return result + return $this->info; + } + + + + // Return array of warnings + public function warnings() { + + return $this->warnings; + } + + + + // Add warning(s) to $this->warnings[] + public function warning($message) { + + if (is_array($message)) { + $this->warnings = array_merge($this->warnings, $message); + } + else { + $this->warnings[] = $message; + } + } + + + + // Clear all warnings when cloning + public function __clone() { + + $this->warnings = array (); + + // Copy info array, otherwise it will be a reference. + $temp = $this->info; + unset($this->info); + $this->info = $temp; + } + + + + // Convert string between charsets -- iconv() wrapper + public function iconv($in_charset, $out_charset, $string, $drop01 = false) { + + if ($drop01 && ($string === "\x00" || $string === "\x01")) { + return ''; + } + + + if (!$this->iconv_present) { + return getid3_iconv_replacement::iconv($in_charset, $out_charset, $string); + } + + + // iconv() present + if ($result = @iconv($in_charset, $out_charset.'//TRANSLIT', $string)) { + + if ($out_charset == 'ISO-8859-1') { + return rtrim($result, "\x00"); + } + return $result; + } + + $this->warning('iconv() was unable to convert the string: "' . $string . '" from ' . $in_charset . ' to ' . $out_charset); + return $string; + } + + + + public function include_module($name) { + + if (!file_exists($this->include_path.'module.'.$name.'.php')) { + throw new getid3_exception('Required module.'.$name.'.php is missing.'); + } + + include_once($this->include_path.'module.'.$name.'.php'); + } + + + + public function include_module_optional($name) { + + if (!file_exists($this->include_path.'module.'.$name.'.php')) { + return; + } + + include_once($this->include_path.'module.'.$name.'.php'); + return true; + } + + + // Return array containing information about all supported formats + public static function GetFileFormatArray() { + + static $format_info = array ( + + // Audio formats + + // AC-3 - audio - Dolby AC-3 / Dolby Digital + 'ac3' => array ( + 'pattern' => '^\x0B\x77', + 'group' => 'audio', + 'module' => 'ac3', + 'mime_type' => 'audio/ac3', + ), + + // AAC - audio - Advanced Audio Coding (AAC) - ADIF format + 'adif' => array ( + 'pattern' => '^ADIF', + 'group' => 'audio', + 'module' => 'aac_adif', + 'mime_type' => 'application/octet-stream', + 'fail_ape' => 'WARNING', + ), + + + // AAC - audio - Advanced Audio Coding (AAC) - ADTS format (very similar to MP3) + 'adts' => array ( + 'pattern' => '^\xFF[\xF0-\xF1\xF8-\xF9]', + 'group' => 'audio', + 'module' => 'aac_adts', + 'mime_type' => 'application/octet-stream', + 'fail_ape' => 'WARNING', + ), + + + // AU - audio - NeXT/Sun AUdio (AU) + 'au' => array ( + 'pattern' => '^\.snd', + 'group' => 'audio', + 'module' => 'au', + 'mime_type' => 'audio/basic', + ), + + // AVR - audio - Audio Visual Research + 'avr' => array ( + 'pattern' => '^2BIT', + 'group' => 'audio', + 'module' => 'avr', + 'mime_type' => 'application/octet-stream', + ), + + // BONK - audio - Bonk v0.9+ + 'bonk' => array ( + 'pattern' => '^\x00(BONK|INFO|META| ID3)', + 'group' => 'audio', + 'module' => 'bonk', + 'mime_type' => 'audio/xmms-bonk', + ), + + // DTS - audio - Dolby Theatre System + 'dts' => array( + 'pattern' => '^\x7F\xFE\x80\x01', + 'group' => 'audio', + 'module' => 'dts', + 'mime_type' => 'audio/dts', + ), + + // FLAC - audio - Free Lossless Audio Codec + 'flac' => array ( + 'pattern' => '^fLaC', + 'group' => 'audio', + 'module' => 'xiph', + 'mime_type' => 'audio/x-flac', + ), + + // LA - audio - Lossless Audio (LA) + 'la' => array ( + 'pattern' => '^LA0[2-4]', + 'group' => 'audio', + 'module' => 'la', + 'mime_type' => 'application/octet-stream', + ), + + // LPAC - audio - Lossless Predictive Audio Compression (LPAC) + 'lpac' => array ( + 'pattern' => '^LPAC', + 'group' => 'audio', + 'module' => 'lpac', + 'mime_type' => 'application/octet-stream', + ), + + // MIDI - audio - MIDI (Musical Instrument Digital Interface) + 'midi' => array ( + 'pattern' => '^MThd', + 'group' => 'audio', + 'module' => 'midi', + 'mime_type' => 'audio/midi', + ), + + // MAC - audio - Monkey's Audio Compressor + 'mac' => array ( + 'pattern' => '^MAC ', + 'group' => 'audio', + 'module' => 'monkey', + 'mime_type' => 'application/octet-stream', + ), + + // MOD - audio - MODule (assorted sub-formats) + 'mod' => array ( + 'pattern' => '^.{1080}(M.K.|[5-9]CHN|[1-3][0-9]CH)', + 'mime_type' => 'audio/mod', + ), + + // MOD - audio - MODule (Impulse Tracker) + 'it' => array ( + 'pattern' => '^IMPM', + 'mime_type' => 'audio/it', + ), + + // MOD - audio - MODule (eXtended Module, various sub-formats) + 'xm' => array ( + 'pattern' => '^Extended Module', + 'mime_type' => 'audio/xm', + ), + + // MOD - audio - MODule (ScreamTracker) + 's3m' => array ( + 'pattern' => '^.{44}SCRM', + 'mime_type' => 'audio/s3m', + ), + + // MPC - audio - Musepack / MPEGplus SV7+ + 'mpc' => array ( + 'pattern' => '^(MP\+)', + 'group' => 'audio', + 'module' => 'mpc', + 'mime_type' => 'audio/x-musepack', + ), + + // MPC - audio - Musepack / MPEGplus SV4-6 + 'mpc_old' => array ( + 'pattern' => '^([\x00\x01\x10\x11\x40\x41\x50\x51\x80\x81\x90\x91\xC0\xC1\xD0\xD1][\x20-37][\x00\x20\x40\x60\x80\xA0\xC0\xE0])', + 'group' => 'audio', + 'module' => 'mpc_old', + 'mime_type' => 'application/octet-stream', + ), + + + // MP3 - audio - MPEG-audio Layer 3 (very similar to AAC-ADTS) + 'mp3' => array ( + 'pattern' => '^\xFF[\xE2-\xE7\xF2-\xF7\xFA-\xFF][\x00-\xEB]', + 'group' => 'audio', + 'module' => 'mp3', + 'mime_type' => 'audio/mpeg', + ), + + // OFR - audio - OptimFROG + 'ofr' => array ( + 'pattern' => '^(\*RIFF|OFR)', + 'group' => 'audio', + 'module' => 'optimfrog', + 'mime_type' => 'application/octet-stream', + ), + + // RKAU - audio - RKive AUdio compressor + 'rkau' => array ( + 'pattern' => '^RKA', + 'group' => 'audio', + 'module' => 'rkau', + 'mime_type' => 'application/octet-stream', + ), + + // SHN - audio - Shorten + 'shn' => array ( + 'pattern' => '^ajkg', + 'group' => 'audio', + 'module' => 'shorten', + 'mime_type' => 'audio/xmms-shn', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // TTA - audio - TTA Lossless Audio Compressor (http://tta.corecodec.org) + 'tta' => array ( + 'pattern' => '^TTA', // could also be '^TTA(\x01|\x02|\x03|2|1)' + 'group' => 'audio', + 'module' => 'tta', + 'mime_type' => 'application/octet-stream', + ), + + // VOC - audio - Creative Voice (VOC) + 'voc' => array ( + 'pattern' => '^Creative Voice File', + 'group' => 'audio', + 'module' => 'voc', + 'mime_type' => 'audio/voc', + ), + + // VQF - audio - transform-domain weighted interleave Vector Quantization Format (VQF) + 'vqf' => array ( + 'pattern' => '^TWIN', + 'group' => 'audio', + 'module' => 'vqf', + 'mime_type' => 'application/octet-stream', + ), + + // WV - audio - WavPack (v4.0+) + 'vw' => array( + 'pattern' => '^wvpk', + 'group' => 'audio', + 'module' => 'wavpack', + 'mime_type' => 'application/octet-stream', + ), + + + // Audio-Video formats + + // ASF - audio/video - Advanced Streaming Format, Windows Media Video, Windows Media Audio + 'asf' => array ( + 'pattern' => '^\x30\x26\xB2\x75\x8E\x66\xCF\x11\xA6\xD9\x00\xAA\x00\x62\xCE\x6C', + 'group' => 'audio-video', + 'module' => 'asf', + 'mime_type' => 'video/x-ms-asf', + ), + + // BINK - audio/video - Bink / Smacker + 'bink' => array( + 'pattern' => '^(BIK|SMK)', + 'mime_type' => 'application/octet-stream', + ), + + // FLV - audio/video - FLash Video + 'flv' => array( + 'pattern' => '^FLV\x01', + 'group' => 'audio-video', + 'module' => 'flv', + 'mime_type' => 'video/x-flv', + ), + + // MKAV - audio/video - Mastroka + 'matroska' => array ( + 'pattern' => '^\x1A\x45\xDF\xA3', + 'mime_type' => 'application/octet-stream', + ), + + // MPEG - audio/video - MPEG (Moving Pictures Experts Group) + 'mpeg' => array ( + 'pattern' => '^\x00\x00\x01(\xBA|\xB3)', + 'group' => 'audio-video', + 'module' => 'mpeg', + 'mime_type' => 'video/mpeg', + ), + + // NSV - audio/video - Nullsoft Streaming Video (NSV) + 'nsv' => array ( + 'pattern' => '^NSV[sf]', + 'group' => 'audio-video', + 'module' => 'nsv', + 'mime_type' => 'application/octet-stream', + ), + + // Ogg - audio/video - Ogg (Ogg Vorbis, OggFLAC, Speex, Ogg Theora(*), Ogg Tarkin(*)) + 'ogg' => array ( + 'pattern' => '^OggS', + 'group' => 'audio', + 'module' => 'xiph', + 'mime_type' => 'application/ogg', + 'fail_id3' => 'WARNING', + 'fail_ape' => 'WARNING', + ), + + // QT - audio/video - Quicktime + 'quicktime' => array ( + 'pattern' => '^.{4}(cmov|free|ftyp|mdat|moov|pnot|skip|wide)', + 'group' => 'audio-video', + 'module' => 'quicktime', + 'mime_type' => 'video/quicktime', + ), + + // RIFF - audio/video - Resource Interchange File Format (RIFF) / WAV / AVI / CD-audio / SDSS = renamed variant used by SmartSound QuickTracks (www.smartsound.com) / FORM = Audio Interchange File Format (AIFF) + 'riff' => array ( + 'pattern' => '^(RIFF|SDSS|FORM)', + 'group' => 'audio-video', + 'module' => 'riff', + 'mime_type' => 'audio/x-wave', + 'fail_ape' => 'WARNING', + ), + + // Real - audio/video - RealAudio, RealVideo + 'real' => array ( + 'pattern' => '^(\.RMF|.ra)', + 'group' => 'audio-video', + 'module' => 'real', + 'mime_type' => 'audio/x-realaudio', + ), + + // SWF - audio/video - ShockWave Flash + 'swf' => array ( + 'pattern' => '^(F|C)WS', + 'group' => 'audio-video', + 'module' => 'swf', + 'mime_type' => 'application/x-shockwave-flash', + ), + + + // Still-Image formats + + // BMP - still image - Bitmap (Windows, OS/2; uncompressed, RLE8, RLE4) + 'bmp' => array ( + 'pattern' => '^BM', + 'group' => 'graphic', + 'module' => 'bmp', + 'mime_type' => 'image/bmp', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // GIF - still image - Graphics Interchange Format + 'gif' => array ( + 'pattern' => '^GIF', + 'group' => 'graphic', + 'module' => 'gif', + 'mime_type' => 'image/gif', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // JPEG - still image - Joint Photographic Experts Group (JPEG) + 'jpeg' => array ( + 'pattern' => '^\xFF\xD8\xFF', + 'group' => 'graphic', + 'module' => 'jpeg', + 'mime_type' => 'image/jpeg', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // PCD - still image - Kodak Photo CD + 'pcd' => array ( + 'pattern' => '^.{2048}PCD_IPI\x00', + 'group' => 'graphic', + 'module' => 'pcd', + 'mime_type' => 'image/x-photo-cd', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + + // PNG - still image - Portable Network Graphics (PNG) + 'png' => array ( + 'pattern' => '^\x89\x50\x4E\x47\x0D\x0A\x1A\x0A', + 'group' => 'graphic', + 'module' => 'png', + 'mime_type' => 'image/png', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + + // SVG - still image - Scalable Vector Graphics (SVG) + 'svg' => array( + 'pattern' => ' 'image/svg+xml', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + + // TIFF - still image - Tagged Information File Format (TIFF) + 'tiff' => array ( + 'pattern' => '^(II\x2A\x00|MM\x00\x2A)', + 'group' => 'graphic', + 'module' => 'tiff', + 'mime_type' => 'image/tiff', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + + // Data formats + + 'exe' => array( + 'pattern' => '^MZ', + 'mime_type' => 'application/octet-stream', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // ISO - data - International Standards Organization (ISO) CD-ROM Image + 'iso' => array ( + 'pattern' => '^.{32769}CD001', + 'group' => 'misc', + 'module' => 'iso', + 'mime_type' => 'application/octet-stream', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // RAR - data - RAR compressed data + 'rar' => array( + 'pattern' => '^Rar\!', + 'mime_type' => 'application/octet-stream', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // SZIP - audio - SZIP compressed data + 'szip' => array ( + 'pattern' => '^SZ\x0A\x04', + 'group' => 'archive', + 'module' => 'szip', + 'mime_type' => 'application/octet-stream', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // TAR - data - TAR compressed data + 'tar' => array( + 'pattern' => '^.{100}[0-9\x20]{7}\x00[0-9\x20]{7}\x00[0-9\x20]{7}\x00[0-9\x20\x00]{12}[0-9\x20\x00]{12}', + 'group' => 'archive', + 'module' => 'tar', + 'mime_type' => 'application/x-tar', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // GZIP - data - GZIP compressed data + 'gz' => array( + 'pattern' => '^\x1F\x8B\x08', + 'group' => 'archive', + 'module' => 'gzip', + 'mime_type' => 'application/x-gzip', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + + // ZIP - data - ZIP compressed data + 'zip' => array ( + 'pattern' => '^PK\x03\x04', + 'group' => 'archive', + 'module' => 'zip', + 'mime_type' => 'application/zip', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + + // PAR2 - data - Parity Volume Set Specification 2.0 + 'par2' => array ( + 'pattern' => '^PAR2\x00PKT', + 'mime_type' => 'application/octet-stream', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + + // PDF - data - Portable Document Format + 'pdf' => array( + 'pattern' => '^\x25PDF', + 'mime_type' => 'application/pdf', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // DOC - data - Microsoft Word + 'msoffice' => array( + 'pattern' => '^\xD0\xCF\x11\xE0', // D0CF11E == DOCFILE == Microsoft Office Document + 'mime_type' => 'application/octet-stream', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + ); + + return $format_info; + } + + + + // Recursive over array - converts array to $encoding charset from $this->encoding + function CharConvert(&$array, $encoding) { + + // Identical encoding - end here + if ($encoding == $this->encoding) { + return; + } + + // Loop thru array + foreach ($array as $key => $value) { + + // Go recursive + if (is_array($value)) { + $this->CharConvert($array[$key], $encoding); + } + + // Convert string + elseif (is_string($value)) { + $array[$key] = $this->iconv($encoding, $this->encoding, $value); + } + } + } + + + + // Convert and copy tags + protected function HandleAllTags() { + + // Key name => array (tag name, character encoding) + static $tags = array ( + 'asf' => array ('asf', 'UTF-16LE'), + 'midi' => array ('midi', 'ISO-8859-1'), + 'nsv' => array ('nsv', 'ISO-8859-1'), + 'ogg' => array ('vorbiscomment', 'UTF-8'), + 'png' => array ('png', 'UTF-8'), + 'tiff' => array ('tiff', 'ISO-8859-1'), + 'quicktime' => array ('quicktime', 'ISO-8859-1'), + 'real' => array ('real', 'ISO-8859-1'), + 'vqf' => array ('vqf', 'ISO-8859-1'), + 'zip' => array ('zip', 'ISO-8859-1'), + 'riff' => array ('riff', 'ISO-8859-1'), + 'lyrics3' => array ('lyrics3', 'ISO-8859-1'), + 'id3v1' => array ('id3v1', ''), // change below - cannot assign variable to static array + 'id3v2' => array ('id3v2', 'UTF-8'), // module converts all frames to UTF-8 + 'ape' => array ('ape', 'UTF-8') + ); + $tags['id3v1'][1] = $this->encoding_id3v1; + + // Loop thru tags array + foreach ($tags as $comment_name => $tag_name_encoding_array) { + list($tag_name, $encoding) = $tag_name_encoding_array; + + // Fill in default encoding type if not already present + @$this->info[$comment_name] and $this->info[$comment_name]['encoding'] = $encoding; + + // Copy comments if key name set + if (@$this->info[$comment_name]['comments']) { + + foreach ($this->info[$comment_name]['comments'] as $tag_key => $value_array) { + foreach ($value_array as $key => $value) { + if (strlen(trim($value)) > 0) { + $this->info['tags'][$tag_name][trim($tag_key)][] = $value; // do not trim!! Unicode characters will get mangled if trailing nulls are removed! + } + } + + } + + if (!@$this->info['tags'][$tag_name]) { + // comments are set but contain nothing but empty strings, so skip + continue; + } + + $this->CharConvert($this->info['tags'][$tag_name], $encoding); + } + } + + + // Merge comments from ['tags'] into common ['comments'] + if (@$this->info['tags']) { + + foreach ($this->info['tags'] as $tag_type => $tag_array) { + + foreach ($tag_array as $tag_name => $tagdata) { + + foreach ($tagdata as $key => $value) { + + if (!empty($value)) { + + if (empty($this->info['comments'][$tag_name])) { + + // fall through and append value + } + elseif ($tag_type == 'id3v1') { + + $new_value_length = strlen(trim($value)); + foreach ($this->info['comments'][$tag_name] as $existing_key => $existing_value) { + $old_value_length = strlen(trim($existing_value)); + if (($new_value_length <= $old_value_length) && (substr($existing_value, 0, $new_value_length) == trim($value))) { + // new value is identical but shorter-than (or equal-length to) one already in comments - skip + break 2; + } + } + } + else { + + $new_value_length = strlen(trim($value)); + foreach ($this->info['comments'][$tag_name] as $existing_key => $existing_value) { + $old_value_length = strlen(trim($existing_value)); + if (($new_value_length > $old_value_length) && (substr(trim($value), 0, strlen($existing_value)) == $existing_value)) { + $this->info['comments'][$tag_name][$existing_key] = trim($value); + break 2; + } + } + } + + if (empty($this->info['comments'][$tag_name]) || !in_array(trim($value), $this->info['comments'][$tag_name])) { + $this->info['comments'][$tag_name][] = trim($value); + } + } + } + } + } + } + + return true; + } +} + + +abstract class getid3_handler +{ + + protected $getid3; // pointer + + protected $data_string_flag = false; // analyzing filepointer or string + protected $data_string; // string to analyze + protected $data_string_position = 0; // seek position in string + + + public function __construct(getID3 $getid3) { + + $this->getid3 = $getid3; + } + + + // Analyze from file pointer + abstract public function Analyze(); + + + + // Analyze from string instead + public function AnalyzeString(&$string) { + + // Enter string mode + $this->data_string_flag = true; + $this->data_string = $string; + + // Save info + $saved_avdataoffset = $this->getid3->info['avdataoffset']; + $saved_avdataend = $this->getid3->info['avdataend']; + $saved_filesize = $this->getid3->info['filesize']; + + // Reset some info + $this->getid3->info['avdataoffset'] = 0; + $this->getid3->info['avdataend'] = $this->getid3->info['filesize'] = strlen($string); + + // Analyze + $this->Analyze(); + + // Restore some info + $this->getid3->info['avdataoffset'] = $saved_avdataoffset; + $this->getid3->info['avdataend'] = $saved_avdataend; + $this->getid3->info['filesize'] = $saved_filesize; + + // Exit string mode + $this->data_string_flag = false; + } + + + protected function ftell() { + + if ($this->data_string_flag) { + return $this->data_string_position; + } + return ftell($this->getid3->fp); + } + + + protected function fread($bytes) { + + if ($this->data_string_flag) { + $this->data_string_position += $bytes; + return substr($this->data_string, $this->data_string_position - $bytes, $bytes); + } + return fread($this->getid3->fp, $bytes); + } + + + protected function fseek($bytes, $whence = SEEK_SET) { + + if ($this->data_string_flag) { + switch ($whence) { + case SEEK_SET: + $this->data_string_position = $bytes; + return; + + case SEEK_CUR: + $this->data_string_position += $bytes; + return; + + case SEEK_END: + $this->data_string_position = strlen($this->data_string) + $bytes; + return; + } + } + return fseek($this->getid3->fp, $bytes, $whence); + } + +} + + + + +abstract class getid3_handler_write +{ + protected $filename; + protected $user_abort; + + private $fp_lock; + private $owner; + private $group; + private $perms; + + + public function __construct($filename) { + + if (!file_exists($filename)) { + throw new getid3_exception('File does not exist: "' . $filename . '"'); + } + + if (!is_writeable($filename)) { + throw new getid3_exception('File is not writeable: "' . $filename . '"'); + } + + if (!is_writeable(dirname($filename))) { + throw new getid3_exception('Directory is not writeable: ' . dirname($filename) . ' (need to write lock file).'); + } + + $this->user_abort = ignore_user_abort(true); + + $this->fp_lock = fopen($filename . '.getid3.lock', 'w'); + flock($this->fp_lock, LOCK_EX); + + $this->filename = $filename; + } + + + public function __destruct() { + + flock($this->fp_lock, LOCK_UN); + fclose($this->fp_lock); + unlink($this->filename . '.getid3.lock'); + + ignore_user_abort($this->user_abort); + } + + + protected function save_permissions() { + + $this->owner = fileowner($this->filename); + $this->group = filegroup($this->filename); + $this->perms = fileperms($this->filename); + } + + + protected function restore_permissions() { + + @chown($this->filename, $this->owner); + @chgrp($this->filename, $this->group); + @chmod($this->filename, $this->perms); + } + + + abstract public function read(); + + abstract public function write(); + + abstract public function remove(); + +} + + + + +class getid3_exception extends Exception +{ + public $message; + +} + + + + +class getid3_lib +{ + + // Convert Little Endian byte string to int - max 32 bits + public static function LittleEndian2Int($byte_word, $signed = false) { + + return getid3_lib::BigEndian2Int(strrev($byte_word), $signed); + } + + + + // Convert number to Little Endian byte string + public static function LittleEndian2String($number, $minbytes=1, $synchsafe=false) { + $intstring = ''; + while ($number > 0) { + if ($synchsafe) { + $intstring = $intstring.chr($number & 127); + $number >>= 7; + } else { + $intstring = $intstring.chr($number & 255); + $number >>= 8; + } + } + return str_pad($intstring, $minbytes, "\x00", STR_PAD_RIGHT); + } + + + + // Convert Big Endian byte string to int - max 32 bits + public static function BigEndian2Int($byte_word, $signed = false) { + + $int_value = 0; + $byte_wordlen = strlen($byte_word); + + for ($i = 0; $i < $byte_wordlen; $i++) { + $int_value += ord($byte_word{$i}) * pow(256, ($byte_wordlen - 1 - $i)); + } + + if ($signed) { + $sign_mask_bit = 0x80 << (8 * ($byte_wordlen - 1)); + if ($int_value & $sign_mask_bit) { + $int_value = 0 - ($int_value & ($sign_mask_bit - 1)); + } + } + + return $int_value; + } + + + + // Convert Big Endian byte sybc safe string to int - max 32 bits + public static function BigEndianSyncSafe2Int($byte_word) { + + $int_value = 0; + $byte_wordlen = strlen($byte_word); + + // disregard MSB, effectively 7-bit bytes + for ($i = 0; $i < $byte_wordlen; $i++) { + $int_value = $int_value | (ord($byte_word{$i}) & 0x7F) << (($byte_wordlen - 1 - $i) * 7); + } + return $int_value; + } + + + + // Convert Big Endian byte string to bit string + public static function BigEndian2Bin($byte_word) { + + $bin_value = ''; + $byte_wordlen = strlen($byte_word); + for ($i = 0; $i < $byte_wordlen; $i++) { + $bin_value .= str_pad(decbin(ord($byte_word{$i})), 8, '0', STR_PAD_LEFT); + } + return $bin_value; + } + + + + public static function BigEndian2Float($byte_word) { + + // ANSI/IEEE Standard 754-1985, Standard for Binary Floating Point Arithmetic + // http://www.psc.edu/general/software/packages/ieee/ieee.html + // http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/ieee.html + + $bit_word = getid3_lib::BigEndian2Bin($byte_word); + if (!$bit_word) { + return 0; + } + $sign_bit = $bit_word{0}; + + switch (strlen($byte_word) * 8) { + case 32: + $exponent_bits = 8; + $fraction_bits = 23; + break; + + case 64: + $exponent_bits = 11; + $fraction_bits = 52; + break; + + case 80: + // 80-bit Apple SANE format + // http://www.mactech.com/articles/mactech/Vol.06/06.01/SANENormalized/ + $exponent_string = substr($bit_word, 1, 15); + $is_normalized = intval($bit_word{16}); + $fraction_string = substr($bit_word, 17, 63); + $exponent = pow(2, getid3_lib::Bin2Dec($exponent_string) - 16383); + $fraction = $is_normalized + getid3_lib::DecimalBinary2Float($fraction_string); + $float_value = $exponent * $fraction; + if ($sign_bit == '1') { + $float_value *= -1; + } + return $float_value; + break; + + default: + return false; + break; + } + $exponent_string = substr($bit_word, 1, $exponent_bits); + $fraction_string = substr($bit_word, $exponent_bits + 1, $fraction_bits); + $exponent = bindec($exponent_string); + $fraction = bindec($fraction_string); + + if (($exponent == (pow(2, $exponent_bits) - 1)) && ($fraction != 0)) { + // Not a Number + $float_value = false; + } elseif (($exponent == (pow(2, $exponent_bits) - 1)) && ($fraction == 0)) { + if ($sign_bit == '1') { + $float_value = '-infinity'; + } else { + $float_value = '+infinity'; + } + } elseif (($exponent == 0) && ($fraction == 0)) { + if ($sign_bit == '1') { + $float_value = -0; + } else { + $float_value = 0; + } + $float_value = ($sign_bit ? 0 : -0); + } elseif (($exponent == 0) && ($fraction != 0)) { + // These are 'unnormalized' values + $float_value = pow(2, (-1 * (pow(2, $exponent_bits - 1) - 2))) * getid3_lib::DecimalBinary2Float($fraction_string); + if ($sign_bit == '1') { + $float_value *= -1; + } + } elseif ($exponent != 0) { + $float_value = pow(2, ($exponent - (pow(2, $exponent_bits - 1) - 1))) * (1 + getid3_lib::DecimalBinary2Float($fraction_string)); + if ($sign_bit == '1') { + $float_value *= -1; + } + } + return (float) $float_value; + } + + + + public static function LittleEndian2Float($byte_word) { + + return getid3_lib::BigEndian2Float(strrev($byte_word)); + } + + + + public static function DecimalBinary2Float($binary_numerator) { + $numerator = bindec($binary_numerator); + $denominator = bindec('1'.str_repeat('0', strlen($binary_numerator))); + return ($numerator / $denominator); + } + + + public static function PrintHexBytes($string, $hex=true, $spaces=true, $html_safe=true) { + + $return_string = ''; + for ($i = 0; $i < strlen($string); $i++) { + if ($hex) { + $return_string .= str_pad(dechex(ord($string{$i})), 2, '0', STR_PAD_LEFT); + } else { + $return_string .= ' '.(ereg("[\x20-\x7E]", $string{$i}) ? $string{$i} : '¤'); + } + if ($spaces) { + $return_string .= ' '; + } + } + if ($html_safe) { + $return_string = htmlentities($return_string); + } + return $return_string; + } + + + + // Process header data string - read several values with algorithm and add to target + // algorithm is one one the getid3_lib::Something2Something() function names + // parts_array is index => length - $target[index] = algorithm(substring(data)) + // - OR just substring(data) if length is negative! + // indexes == 'IGNORE**' are ignored + + public static function ReadSequence($algorithm, &$target, &$data, $offset, $parts_array) { + + // Loop thru $parts_array + foreach ($parts_array as $target_string => $length) { + + // Add to target + if (!strstr($target_string, 'IGNORE')) { + + // substr(....length) + if ($length < 0) { + $target[$target_string] = substr($data, $offset, -$length); + } + + // algorithm(substr(...length)) + else { + $target[$target_string] = getid3_lib::$algorithm(substr($data, $offset, $length)); + } + } + + // Move pointer + $offset += abs($length); + } + } + +} + + + +class getid3_lib_replaygain +{ + + public static function NameLookup($name_code) { + + static $lookup = array ( + 0 => 'not set', + 1 => 'Track Gain Adjustment', + 2 => 'Album Gain Adjustment' + ); + + return @$lookup[$name_code]; + } + + + + public static function OriginatorLookup($originator_code) { + + static $lookup = array ( + 0 => 'unspecified', + 1 => 'pre-set by artist/producer/mastering engineer', + 2 => 'set by user', + 3 => 'determined automatically' + ); + + return @$lookup[$originator_code]; + } + + + + public static function AdjustmentLookup($raw_adjustment, $sign_bit) { + + return (float)$raw_adjustment / 10 * ($sign_bit == 1 ? -1 : 1); + } + + + + public static function GainString($name_code, $originator_code, $replaygain) { + + $sign_bit = $replaygain < 0 ? 1 : 0; + + $stored_replaygain = intval(round($replaygain * 10)); + $gain_string = str_pad(decbin($name_code), 3, '0', STR_PAD_LEFT); + $gain_string .= str_pad(decbin($originator_code), 3, '0', STR_PAD_LEFT); + $gain_string .= $sign_bit; + $gain_string .= str_pad(decbin($stored_replaygain), 9, '0', STR_PAD_LEFT); + + return $gain_string; + } + +} + + + + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.archive.gzip.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.archive.gzip.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,296 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.archive.gzip.php | +// | module for analyzing GZIP files | +// | dependencies: PHP compiled with zlib support (optional) | +// +----------------------------------------------------------------------+ +// | Module originally written by Mike Mozolin | +// +----------------------------------------------------------------------+ +// +// $Id: module.archive.gzip.php,v 1.4 2006/12/04 16:00:35 ah Exp $ + + + +class getid3_gzip extends getid3_handler +{ + + // public: Optional file list - disable for speed. + public $option_gzip_parse_contents = true; // decode gzipped files, if possible, and parse recursively (.tar.gz for example) + + + // Reads the gzip-file + function Analyze() { + + $info = &$this->getid3->info; + + $info['fileformat'] = 'gzip'; + + $start_length = 10; + $unpack_header = 'a1id1/a1id2/a1cmethod/a1flags/a4mtime/a1xflags/a1os'; + + //+---+---+---+---+---+---+---+---+---+---+ + //|ID1|ID2|CM |FLG| MTIME |XFL|OS | + //+---+---+---+---+---+---+---+---+---+---+ + + @fseek($this->getid3->fp, 0); + $buffer = @fread($this->getid3->fp, $info['filesize']); + + $arr_members = explode("\x1F\x8B\x08", $buffer); + + while (true) { + $is_wrong_members = false; + $num_members = intval(count($arr_members)); + for ($i = 0; $i < $num_members; $i++) { + if (strlen($arr_members[$i]) == 0) { + continue; + } + $buf = "\x1F\x8B\x08".$arr_members[$i]; + + $attr = unpack($unpack_header, substr($buf, 0, $start_length)); + if (!$this->get_os_type(ord($attr['os']))) { + + // Merge member with previous if wrong OS type + $arr_members[$i - 1] .= $buf; + $arr_members[$i] = ''; + $is_wrong_members = true; + continue; + } + } + if (!$is_wrong_members) { + break; + } + } + + $fpointer = 0; + $idx = 0; + for ($i = 0; $i < $num_members; $i++) { + if (strlen($arr_members[$i]) == 0) { + continue; + } + $info_gzip_member_header_idx = &$info['gzip']['member_header'][++$idx]; + + $buff = "\x1F\x8B\x08".$arr_members[$i]; + + $attr = unpack($unpack_header, substr($buff, 0, $start_length)); + $info_gzip_member_header_idx['filemtime'] = getid3_lib::LittleEndian2Int($attr['mtime']); + $info_gzip_member_header_idx['raw']['id1'] = ord($attr['cmethod']); + $info_gzip_member_header_idx['raw']['id2'] = ord($attr['cmethod']); + $info_gzip_member_header_idx['raw']['cmethod'] = ord($attr['cmethod']); + $info_gzip_member_header_idx['raw']['os'] = ord($attr['os']); + $info_gzip_member_header_idx['raw']['xflags'] = ord($attr['xflags']); + $info_gzip_member_header_idx['raw']['flags'] = ord($attr['flags']); + + $info_gzip_member_header_idx['flags']['crc16'] = (bool) ($info_gzip_member_header_idx['raw']['flags'] & 0x02); + $info_gzip_member_header_idx['flags']['extra'] = (bool) ($info_gzip_member_header_idx['raw']['flags'] & 0x04); + $info_gzip_member_header_idx['flags']['filename'] = (bool) ($info_gzip_member_header_idx['raw']['flags'] & 0x08); + $info_gzip_member_header_idx['flags']['comment'] = (bool) ($info_gzip_member_header_idx['raw']['flags'] & 0x10); + + $info_gzip_member_header_idx['compression'] = $this->get_xflag_type($info_gzip_member_header_idx['raw']['xflags']); + + $info_gzip_member_header_idx['os'] = $this->get_os_type($info_gzip_member_header_idx['raw']['os']); + if (!$info_gzip_member_header_idx['os']) { + $info['error'][] = 'Read error on gzip file'; + return false; + } + + $fpointer = 10; + $arr_xsubfield = array (); + + // bit 2 - FLG.FEXTRA + //+---+---+=================================+ + //| XLEN |...XLEN bytes of "extra field"...| + //+---+---+=================================+ + + if ($info_gzip_member_header_idx['flags']['extra']) { + $w_xlen = substr($buff, $fpointer, 2); + $xlen = getid3_lib::LittleEndian2Int($w_xlen); + $fpointer += 2; + + $info_gzip_member_header_idx['raw']['xfield'] = substr($buff, $fpointer, $xlen); + + // Extra SubFields + //+---+---+---+---+==================================+ + //|SI1|SI2| LEN |... LEN bytes of subfield data ...| + //+---+---+---+---+==================================+ + + $idx = 0; + while (true) { + if ($idx >= $xlen) { + break; + } + $si1 = ord(substr($buff, $fpointer + $idx++, 1)); + $si2 = ord(substr($buff, $fpointer + $idx++, 1)); + if (($si1 == 0x41) && ($si2 == 0x70)) { + $w_xsublen = substr($buff, $fpointer+$idx, 2); + $xsublen = getid3_lib::LittleEndian2Int($w_xsublen); + $idx += 2; + $arr_xsubfield[] = substr($buff, $fpointer+$idx, $xsublen); + $idx += $xsublen; + } else { + break; + } + } + $fpointer += $xlen; + } + + // bit 3 - FLG.FNAME + //+=========================================+ + //|...original file name, zero-terminated...| + //+=========================================+ + // GZIP files may have only one file, with no filename, so assume original filename is current filename without .gz + + $info_gzip_member_header_idx['filename'] = eregi_replace('.gz$', '', @$info['filename']); + if ($info_gzip_member_header_idx['flags']['filename']) { + while (true) { + if (ord($buff[$fpointer]) == 0) { + $fpointer++; + break; + } + $info_gzip_member_header_idx['filename'] .= $buff[$fpointer]; + $fpointer++; + } + } + + // bit 4 - FLG.FCOMMENT + //+===================================+ + //|...file comment, zero-terminated...| + //+===================================+ + + if ($info_gzip_member_header_idx['flags']['comment']) { + while (true) { + if (ord($buff[$fpointer]) == 0) { + $fpointer++; + break; + } + $info_gzip_member_header_idx['comment'] .= $buff[$fpointer]; + $fpointer++; + } + } + + // bit 1 - FLG.FHCRC + //+---+---+ + //| CRC16 | + //+---+---+ + + if ($info_gzip_member_header_idx['flags']['crc16']) { + $w_crc = substr($buff, $fpointer, 2); + $info_gzip_member_header_idx['crc16'] = getid3_lib::LittleEndian2Int($w_crc); + $fpointer += 2; + } + + // bit 0 - FLG.FTEXT + //if ($info_gzip_member_header_idx['raw']['flags'] & 0x01) { + // Ignored... + //} + // bits 5, 6, 7 - reserved + + $info_gzip_member_header_idx['crc32'] = getid3_lib::LittleEndian2Int(substr($buff, strlen($buff) - 8, 4)); + $info_gzip_member_header_idx['filesize'] = getid3_lib::LittleEndian2Int(substr($buff, strlen($buff) - 4)); + + if ($this->option_gzip_parse_contents) { + + // Try to inflate GZip + + if (!function_exists('gzinflate')) { + $this->getid3->warning('PHP does not have zlib support - contents not parsed.'); + return true; + } + + $csize = 0; + $inflated = ''; + $chkcrc32 = ''; + + $cdata = substr($buff, $fpointer); + $cdata = substr($cdata, 0, strlen($cdata) - 8); + $csize = strlen($cdata); + $inflated = gzinflate($cdata); + + // Calculate CRC32 for inflated content + $info_gzip_member_header_idx['crc32_valid'] = (bool) (sprintf('%u', crc32($inflated)) == $info_gzip_member_header_idx['crc32']); + + + //// Analyse contents + + // write content to temp file + if (($temp_file_name = tempnam('*', 'getID3')) === false) { + throw new getid3_exception('Unable to create temporary file.'); + } + + if ($tmp = fopen($temp_file_name, 'wb')) { + fwrite($tmp, $inflated); + fclose($tmp); + + // clone getid3 - we want same settings + $clone = clone $this->getid3; + unset($clone->info); + try { + $clone->Analyze($temp_file_name); + $info_gzip_member_header_idx['parsed_content'] = $clone->info; + } + catch (getid3_exception $e) { + // unable to parse contents + } + + unlink($temp_file_name); + } + + // Unknown/unhandled format + else { + + } + } + } + return true; + } + + + // Converts the OS type + public static function get_os_type($key) { + static $os_type = array ( + '0' => 'FAT filesystem (MS-DOS, OS/2, NT/Win32)', + '1' => 'Amiga', + '2' => 'VMS (or OpenVMS)', + '3' => 'Unix', + '4' => 'VM/CMS', + '5' => 'Atari TOS', + '6' => 'HPFS filesystem (OS/2, NT)', + '7' => 'Macintosh', + '8' => 'Z-System', + '9' => 'CP/M', + '10' => 'TOPS-20', + '11' => 'NTFS filesystem (NT)', + '12' => 'QDOS', + '13' => 'Acorn RISCOS', + '255' => 'unknown' + ); + return @$os_type[$key]; + } + + + // Converts the eXtra FLags + public static function get_xflag_type($key) { + static $xflag_type = array ( + '0' => 'unknown', + '2' => 'maximum compression', + '4' => 'fastest algorithm' + ); + return @$xflag_type[$key]; + } + +} + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.archive.szip.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.archive.szip.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,105 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.archive.szip.php | +// | module for analyzing SZIP compressed files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.archive.szip.php,v 1.2 2006/11/02 10:48:00 ah Exp $ + + + +class getid3_szip extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $szip_rkau = fread($getid3->fp, 6); + + // Magic bytes: 'SZ'."\x0A\x04" + + $getid3->info['fileformat'] = 'szip'; + + $getid3->info['szip']['major_version'] = getid3_lib::BigEndian2Int(substr($szip_rkau, 4, 1)); + $getid3->info['szip']['minor_version'] = getid3_lib::BigEndian2Int(substr($szip_rkau, 5, 1)); + + while (!feof($getid3->fp)) { + $next_block_id = fread($getid3->fp, 2); + switch ($next_block_id) { + case 'SZ': + // Note that szip files can be concatenated, this has the same effect as + // concatenating the files. this also means that global header blocks + // might be present between directory/data blocks. + fseek($getid3->fp, 4, SEEK_CUR); + break; + + case 'BH': + $bh_header_bytes = getid3_lib::BigEndian2Int(fread($getid3->fp, 3)); + $bh_header_data = fread($getid3->fp, $bh_header_bytes); + $bh_header_offset = 0; + while (strpos($bh_header_data, "\x00", $bh_header_offset) > 0) { + //filename as \0 terminated string (empty string indicates end) + //owner as \0 terminated string (empty is same as last file) + //group as \0 terminated string (empty is same as last file) + //3 byte filelength in this block + //2 byte access flags + //4 byte creation time (like in unix) + //4 byte modification time (like in unix) + //4 byte access time (like in unix) + + $bh_data_array['filename'] = substr($bh_header_data, $bh_header_offset, strcspn($bh_header_data, "\x00")); + $bh_header_offset += (strlen($bh_data_array['filename']) + 1); + + $bh_data_array['owner'] = substr($bh_header_data, $bh_header_offset, strcspn($bh_header_data, "\x00")); + $bh_header_offset += (strlen($bh_data_array['owner']) + 1); + + $bh_data_array['group'] = substr($bh_header_data, $bh_header_offset, strcspn($bh_header_data, "\x00")); + $bh_header_offset += (strlen($bh_data_array['group']) + 1); + + $bh_data_array['filelength'] = getid3_lib::BigEndian2Int(substr($bh_header_data, $bh_header_offset, 3)); + $bh_header_offset += 3; + + $bh_data_array['access_flags'] = getid3_lib::BigEndian2Int(substr($bh_header_data, $bh_header_offset, 2)); + $bh_header_offset += 2; + + $bh_data_array['creation_time'] = getid3_lib::BigEndian2Int(substr($bh_header_data, $bh_header_offset, 4)); + $bh_header_offset += 4; + + $bh_data_array['modification_time'] = getid3_lib::BigEndian2Int(substr($bh_header_data, $bh_header_offset, 4)); + $bh_header_offset += 4; + + $bh_data_array['access_time'] = getid3_lib::BigEndian2Int(substr($bh_header_data, $bh_header_offset, 4)); + $bh_header_offset += 4; + + $getid3->info['szip']['BH'][] = $bh_data_array; + } + break; + + default: + break 2; + } + } + + return true; + } + +} + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.archive.tar.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.archive.tar.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,231 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.archive.tar.php | +// | module for analyzing TAR files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// | Module originally written by Mike Mozolin | +// +----------------------------------------------------------------------+ +// +// $Id: module.archive.tar.php,v 1.2 2006/11/02 10:48:00 ah Exp $ + + + +class getid3_tar extends getid3_handler +{ + + function Analyze() { + + $info = &$this->getid3->info; + + $info['fileformat'] = 'tar'; + + $fp = $this->getid3->fp; + + fseek($fp, 0); + + $unpack_header = 'a100fname/a8mode/a8uid/a8gid/a12size/a12mtime/a8chksum/a1typflag/a100lnkname/a6magic/a2ver/a32uname/a32gname/a8devmaj/a8devmin/a155/prefix'; + + $null_512k = str_repeat("\0", 512); // end-of-file marker + + $already_warned = false; + + while (!feof($fp)) { + + $buffer = fread($fp, 512); + + // check the block + $checksum = 0; + for ($i = 0; $i < 148; $i++) { + $checksum += ord(substr($buffer, $i, 1)); + } + for ($i = 148; $i < 156; $i++) { + $checksum += ord(' '); + } + for ($i = 156; $i < 512; $i++) { + $checksum += ord(substr($buffer, $i, 1)); + } + $attr = unpack($unpack_header, $buffer); + $name = trim(@$attr['fname']); + $mode = octdec(trim(@$attr['mode'])); + $uid = octdec(trim(@$attr['uid'])); + $gid = octdec(trim(@$attr['gid'])); + $size = octdec(trim(@$attr['size'])); + $mtime = octdec(trim(@$attr['mtime'])); + $chksum = octdec(trim(@$attr['chksum'])); + $typflag = trim(@$attr['typflag']); + $lnkname = trim(@$attr['lnkname']); + $magic = trim(@$attr['magic']); + $ver = trim(@$attr['ver']); + $uname = trim(@$attr['uname']); + $gname = trim(@$attr['gname']); + $devmaj = octdec(trim(@$attr['devmaj'])); + $devmin = octdec(trim(@$attr['devmin'])); + $prefix = trim(@$attr['prefix']); + + // EOF Found + if (($checksum == 256) && ($chksum == 0)) { + break; + } + + // Check if filename if 7bit as spec requires + if (!$already_warned) { + for ($i = 0; $i < strlen($name); $i++) { + if ($name{$i} < chr(32) || $name{$i} > chr(127)) { + $this->getid3->warning('Some filenames contains extended characters, which breaks the tar specifation. This is not uncommon, but you will have to handle the character encoding for filenames yourself.'); + $already_warned = true; + break; + } + } + } + + if ($prefix) { + $name = $prefix.'/'.$name; + } + if ((preg_match('#/$#', $name)) && !$name) { + $typeflag = 5; + } + + // If it's the end of the tar-file... + if ($buffer == $null_512k) { + break; + } + + // Protect against tar-files with garbage at the end + if ($name == '') { + break; + } + + $info['tar']['file_details'][$name] = array ( + 'name' => $name, + 'mode_raw' => $mode, + 'mode' => getid3_tar::display_perms($mode), + 'uid' => $uid, + 'gid' => $gid, + 'size' => $size, + 'mtime' => $mtime, + 'chksum' => $chksum, + 'typeflag' => getid3_tar::get_flag_type($typflag), + 'linkname' => $lnkname, + 'magic' => $magic, + 'version' => $ver, + 'uname' => $uname, + 'gname' => $gname, + 'devmajor' => $devmaj, + 'devminor' => $devmin + ); + + // Skip the next chunk + fseek($fp, $size, SEEK_CUR); + + // Throw away padding + if ($size % 512) { + fseek($fp, 512 - $diff, SEEK_CUR); + } + + } + return true; + } + + + // Parses the file mode to file permissions + public static function display_perms($mode) { + + // Determine Type + if ($mode & 0x1000) { + $type='p'; // FIFO pipe + } + elseif ($mode & 0x2000) { + $type='c'; // Character special + } + elseif ($mode & 0x4000) { + $type='d'; // Directory + } + elseif ($mode & 0x6000) { + $type='b'; // Block special + } + elseif ($mode & 0x8000) { + $type='-'; // Regular + } + elseif ($mode & 0xA000) { + $type='l'; // Symbolic Link + } + elseif ($mode & 0xC000) { + $type='s'; // Socket + } + else { + $type='u'; // UNKNOWN + } + + // Determine permissions + $owner['read'] = (($mode & 00400) ? 'r' : '-'); + $owner['write'] = (($mode & 00200) ? 'w' : '-'); + $owner['execute'] = (($mode & 00100) ? 'x' : '-'); + $group['read'] = (($mode & 00040) ? 'r' : '-'); + $group['write'] = (($mode & 00020) ? 'w' : '-'); + $group['execute'] = (($mode & 00010) ? 'x' : '-'); + $world['read'] = (($mode & 00004) ? 'r' : '-'); + $world['write'] = (($mode & 00002) ? 'w' : '-'); + $world['execute'] = (($mode & 00001) ? 'x' : '-'); + + // Adjust for SUID, SGID and sticky bit + if ($mode & 0x800) { + $owner['execute'] = ($owner['execute'] == 'x') ? 's' : 'S'; + } + if ($mode & 0x400) { + $group['execute'] = ($group['execute'] == 'x') ? 's' : 'S'; + } + if ($mode & 0x200) { + $world['execute'] = ($world['execute'] == 'x') ? 't' : 'T'; + } + + $s = sprintf('%1s', $type); + $s .= sprintf('%1s%1s%1s', $owner['read'], $owner['write'], $owner['execute']); + $s .= sprintf('%1s%1s%1s', $group['read'], $group['write'], $group['execute']); + $s .= sprintf('%1s%1s%1s'."\n", $world['read'], $world['write'], $world['execute']); + + return $s; + } + + + // Converts the file type + public static function get_flag_type($typflag) { + + static $flag_types = array ( + '0' => 'LF_NORMAL', + '1' => 'LF_LINK', + '2' => 'LF_SYNLINK', + '3' => 'LF_CHR', + '4' => 'LF_BLK', + '5' => 'LF_DIR', + '6' => 'LF_FIFO', + '7' => 'LF_CONFIG', + 'D' => 'LF_DUMPDIR', + 'K' => 'LF_LONGLINK', + 'L' => 'LF_LONGNAME', + 'M' => 'LF_MULTIVOL', + 'N' => 'LF_NAMES', + 'S' => 'LF_SPARSE', + 'V' => 'LF_VOLHDR' + ); + + return @$flag_types[$typflag]; + } + +} + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.archive.zip.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.archive.zip.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,510 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.archive.zip.php | +// | Module for analyzing pkZip files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.archive.zip.php,v 1.4 2006/11/02 10:48:00 ah Exp $ + + + +class getid3_zip extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->info['zip'] = array (); + $info_zip = &$getid3->info['zip']; + + $getid3->info['fileformat'] = 'zip'; + + $info_zip['encoding'] = 'ISO-8859-1'; + $info_zip['files'] = array (); + $info_zip['compressed_size'] = $info_zip['uncompressed_size'] = $info_zip['entries_count'] = 0; + + $eocd_search_data = ''; + $eocd_search_counter = 0; + while ($eocd_search_counter++ < 512) { + + fseek($getid3->fp, -128 * $eocd_search_counter, SEEK_END); + $eocd_search_data = fread($getid3->fp, 128).$eocd_search_data; + + if (strstr($eocd_search_data, 'PK'."\x05\x06")) { + + $eocd_position = strpos($eocd_search_data, 'PK'."\x05\x06"); + fseek($getid3->fp, (-128 * $eocd_search_counter) + $eocd_position, SEEK_END); + $info_zip['end_central_directory'] = $this->ZIPparseEndOfCentralDirectory(); + + fseek($getid3->fp, $info_zip['end_central_directory']['directory_offset'], SEEK_SET); + $info_zip['entries_count'] = 0; + while ($central_directoryentry = $this->ZIPparseCentralDirectory($getid3->fp)) { + $info_zip['central_directory'][] = $central_directoryentry; + $info_zip['entries_count']++; + $info_zip['compressed_size'] += $central_directoryentry['compressed_size']; + $info_zip['uncompressed_size'] += $central_directoryentry['uncompressed_size']; + + if ($central_directoryentry['uncompressed_size'] > 0) { + $info_zip['files'] = getid3_zip::array_merge_clobber($info_zip['files'], getid3_zip::CreateDeepArray($central_directoryentry['filename'], '/', $central_directoryentry['uncompressed_size'])); + } + } + + if ($info_zip['entries_count'] == 0) { + throw new getid3_exception('No Central Directory entries found (truncated file?)'); + } + + if (!empty($info_zip['end_central_directory']['comment'])) { + $info_zip['comments']['comment'][] = $info_zip['end_central_directory']['comment']; + } + + if (isset($info_zip['central_directory'][0]['compression_method'])) { + $info_zip['compression_method'] = $info_zip['central_directory'][0]['compression_method']; + } + if (isset($info_zip['central_directory'][0]['flags']['compression_speed'])) { + $info_zip['compression_speed'] = $info_zip['central_directory'][0]['flags']['compression_speed']; + } + if (isset($info_zip['compression_method']) && ($info_zip['compression_method'] == 'store') && !isset($info_zip['compression_speed'])) { + $info_zip['compression_speed'] = 'store'; + } + + return true; + } + } + + if ($this->getZIPentriesFilepointer()) { + + // central directory couldn't be found and/or parsed + // scan through actual file data entries, recover as much as possible from probable trucated file + if (@$info_zip['compressed_size'] > ($getid3->info['filesize'] - 46 - 22)) { + throw new getid3_exception('Warning: Truncated file! - Total compressed file sizes ('.$info_zip['compressed_size'].' bytes) is greater than filesize minus Central Directory and End Of Central Directory structures ('.($getid3->info['filesize'] - 46 - 22).' bytes)'); + } + throw new getid3_exception('Cannot find End Of Central Directory - returned list of files in [zip][entries] array may not be complete'); + } + + //throw new getid3_exception('Cannot find End Of Central Directory (truncated file?)'); + } + + + + private function getZIPHeaderFilepointerTopDown() { + + // shortcut + $getid3 = $this->getid3; + + $getid3->info['fileformat'] = 'zip'; + + $getid3->info['zip'] = array (); + $info_zip['compressed_size'] = $info_zip['uncompressed_size'] = $info_zip['entries_count'] = 0; + + rewind($getid3->fp); + while ($fileentry = $this->ZIPparseLocalFileHeader()) { + $info_zip['entries'][] = $fileentry; + $info_zip['entries_count']++; + } + if ($info_zip['entries_count'] == 0) { + throw new getid3_exception('No Local File Header entries found'); + } + + $info_zip['entries_count'] = 0; + while ($central_directoryentry = $this->ZIPparseCentralDirectory($getid3->fp)) { + $info_zip['central_directory'][] = $central_directoryentry; + $info_zip['entries_count']++; + $info_zip['compressed_size'] += $central_directoryentry['compressed_size']; + $info_zip['uncompressed_size'] += $central_directoryentry['uncompressed_size']; + } + if ($info_zip['entries_count'] == 0) { + throw new getid3_exception('No Central Directory entries found (truncated file?)'); + } + + if ($eocd = $this->ZIPparseEndOfCentralDirectory()) { + $info_zip['end_central_directory'] = $eocd; + } else { + throw new getid3_exception('No End Of Central Directory entry found (truncated file?)'); + } + + if (!@$info_zip['end_central_directory']['comment']) { + $info_zip['comments']['comment'][] = $info_zip['end_central_directory']['comment']; + } + + return true; + } + + + + private function getZIPentriesFilepointer() { + + // shortcut + $getid3 = $this->getid3; + + $getid3->info['zip'] = array (); + $info_zip['compressed_size'] = $info_zip['uncompressed_size'] = $info_zip['entries_count'] = 0; + + rewind($getid3->fp); + while ($fileentry = $this->ZIPparseLocalFileHeader($getid3->fp)) { + $info_zip['entries'][] = $fileentry; + $info_zip['entries_count']++; + $info_zip['compressed_size'] += $fileentry['compressed_size']; + $info_zip['uncompressed_size'] += $fileentry['uncompressed_size']; + } + if ($info_zip['entries_count'] == 0) { + throw new getid3_exception('No Local File Header entries found'); + } + + return true; + } + + + + private function ZIPparseLocalFileHeader() { + + // shortcut + $getid3 = $this->getid3; + + $local_file_header['offset'] = ftell($getid3->fp); + + $zip_local_file_header = fread($getid3->fp, 30); + + $local_file_header['raw']['signature'] = getid3_lib::LittleEndian2Int(substr($zip_local_file_header, 0, 4)); + + // Invalid Local File Header Signature + if ($local_file_header['raw']['signature'] != 0x04034B50) { + fseek($getid3->fp, $local_file_header['offset'], SEEK_SET); // seek back to where filepointer originally was so it can be handled properly + return false; + } + + getid3_lib::ReadSequence('LittleEndian2Int', $local_file_header['raw'], $zip_local_file_header, 4, + array ( + 'extract_version' => 2, + 'general_flags' => 2, + 'compression_method' => 2, + 'last_mod_file_time' => 2, + 'last_mod_file_date' => 2, + 'crc_32' => 2, + 'compressed_size' => 2, + 'uncompressed_size' => 2, + 'filename_length' => 2, + 'extra_field_length' => 2 + ) + ); + + $local_file_header['extract_version'] = sprintf('%1.1f', $local_file_header['raw']['extract_version'] / 10); + $local_file_header['host_os'] = $this->ZIPversionOSLookup(($local_file_header['raw']['extract_version'] & 0xFF00) >> 8); + $local_file_header['compression_method'] = $this->ZIPcompressionMethodLookup($local_file_header['raw']['compression_method']); + $local_file_header['compressed_size'] = $local_file_header['raw']['compressed_size']; + $local_file_header['uncompressed_size'] = $local_file_header['raw']['uncompressed_size']; + $local_file_header['flags'] = $this->ZIPparseGeneralPurposeFlags($local_file_header['raw']['general_flags'], $local_file_header['raw']['compression_method']); + $local_file_header['last_modified_timestamp'] = $this->DOStime2UNIXtime($local_file_header['raw']['last_mod_file_date'], $local_file_header['raw']['last_mod_file_time']); + + $filename_extra_field_length = $local_file_header['raw']['filename_length'] + $local_file_header['raw']['extra_field_length']; + if ($filename_extra_field_length > 0) { + $zip_local_file_header .= fread($getid3->fp, $filename_extra_field_length); + + if ($local_file_header['raw']['filename_length'] > 0) { + $local_file_header['filename'] = substr($zip_local_file_header, 30, $local_file_header['raw']['filename_length']); + } + if ($local_file_header['raw']['extra_field_length'] > 0) { + $local_file_header['raw']['extra_field_data'] = substr($zip_local_file_header, 30 + $local_file_header['raw']['filename_length'], $local_file_header['raw']['extra_field_length']); + } + } + + $local_file_header['data_offset'] = ftell($getid3->fp); + fseek($getid3->fp, $local_file_header['raw']['compressed_size'], SEEK_CUR); + + if ($local_file_header['flags']['data_descriptor_used']) { + $data_descriptor = fread($getid3->fp, 12); + + getid3_lib::ReadSequence('LittleEndian2Int', $local_file_header['data_descriptor'], $data_descriptor, 0, + array ( + 'crc_32' => 4, + 'compressed_size' => 4, + 'uncompressed_size' => 4 + ) + ); + } + + return $local_file_header; + } + + + + private function ZIPparseCentralDirectory() { + + // shortcut + $getid3 = $this->getid3; + + $central_directory['offset'] = ftell($getid3->fp); + + $zip_central_directory = fread($getid3->fp, 46); + + $central_directory['raw']['signature'] = getid3_lib::LittleEndian2Int(substr($zip_central_directory, 0, 4)); + + // invalid Central Directory Signature + if ($central_directory['raw']['signature'] != 0x02014B50) { + fseek($getid3->fp, $central_directory['offset'], SEEK_SET); // seek back to where filepointer originally was so it can be handled properly + return false; + } + + getid3_lib::ReadSequence('LittleEndian2Int', $central_directory['raw'], $zip_central_directory, 4, + array ( + 'create_version' => 2, + 'extract_version' => 2, + 'general_flags' => 2, + 'compression_method' => 2, + 'last_mod_file_time' => 2, + 'last_mod_file_date' => 2, + 'crc_32' => 4, + 'compressed_size' => 4, + 'uncompressed_size' => 4, + 'filename_length' => 2, + 'extra_field_length' => 2, + 'file_comment_length' => 2, + 'disk_number_start' => 2, + 'internal_file_attrib' => 2, + 'external_file_attrib' => 4, + 'local_header_offset' => 4 + ) + ); + + $central_directory['entry_offset'] = $central_directory['raw']['local_header_offset']; + $central_directory['create_version'] = sprintf('%1.1f', $central_directory['raw']['create_version'] / 10); + $central_directory['extract_version'] = sprintf('%1.1f', $central_directory['raw']['extract_version'] / 10); + $central_directory['host_os'] = $this->ZIPversionOSLookup(($central_directory['raw']['extract_version'] & 0xFF00) >> 8); + $central_directory['compression_method'] = $this->ZIPcompressionMethodLookup($central_directory['raw']['compression_method']); + $central_directory['compressed_size'] = $central_directory['raw']['compressed_size']; + $central_directory['uncompressed_size'] = $central_directory['raw']['uncompressed_size']; + $central_directory['flags'] = $this->ZIPparseGeneralPurposeFlags($central_directory['raw']['general_flags'], $central_directory['raw']['compression_method']); + $central_directory['last_modified_timestamp'] = $this->DOStime2UNIXtime($central_directory['raw']['last_mod_file_date'], $central_directory['raw']['last_mod_file_time']); + + $filename_extra_field_comment_length = $central_directory['raw']['filename_length'] + $central_directory['raw']['extra_field_length'] + $central_directory['raw']['file_comment_length']; + if ($filename_extra_field_comment_length > 0) { + $filename_extra_field_comment = fread($getid3->fp, $filename_extra_field_comment_length); + + if ($central_directory['raw']['filename_length'] > 0) { + $central_directory['filename']= substr($filename_extra_field_comment, 0, $central_directory['raw']['filename_length']); + } + if ($central_directory['raw']['extra_field_length'] > 0) { + $central_directory['raw']['extra_field_data'] = substr($filename_extra_field_comment, $central_directory['raw']['filename_length'], $central_directory['raw']['extra_field_length']); + } + if ($central_directory['raw']['file_comment_length'] > 0) { + $central_directory['file_comment'] = substr($filename_extra_field_comment, $central_directory['raw']['filename_length'] + $central_directory['raw']['extra_field_length'], $central_directory['raw']['file_comment_length']); + } + } + + return $central_directory; + } + + + + private function ZIPparseEndOfCentralDirectory() { + + // shortcut + $getid3 = $this->getid3; + + $end_of_central_directory['offset'] = ftell($getid3->fp); + + $zip_end_of_central_directory = fread($getid3->fp, 22); + + $end_of_central_directory['signature'] = getid3_lib::LittleEndian2Int(substr($zip_end_of_central_directory, 0, 4)); + + // invalid End Of Central Directory Signature + if ($end_of_central_directory['signature'] != 0x06054B50) { + fseek($getid3->fp, $end_of_central_directory['offset'], SEEK_SET); // seek back to where filepointer originally was so it can be handled properly + return false; + } + + getid3_lib::ReadSequence('LittleEndian2Int', $end_of_central_directory, $zip_end_of_central_directory, 4, + array ( + 'disk_number_current' => 2, + 'disk_number_start_directory' => 2, + 'directory_entries_this_disk' => 2, + 'directory_entries_total' => 2, + 'directory_size' => 4, + 'directory_offset' => 4, + 'comment_length' => 2 + ) + ); + + if ($end_of_central_directory['comment_length'] > 0) { + $end_of_central_directory['comment'] = fread($getid3->fp, $end_of_central_directory['comment_length']); + } + + return $end_of_central_directory; + } + + + + public static function ZIPparseGeneralPurposeFlags($flag_bytes, $compression_method) { + + $parsed_flags['encrypted'] = (bool)($flag_bytes & 0x0001); + + switch ($compression_method) { + case 6: + $parsed_flags['dictionary_size'] = (($flag_bytes & 0x0002) ? 8192 : 4096); + $parsed_flags['shannon_fano_trees'] = (($flag_bytes & 0x0004) ? 3 : 2); + break; + + case 8: + case 9: + switch (($flag_bytes & 0x0006) >> 1) { + case 0: + $parsed_flags['compression_speed'] = 'normal'; + break; + case 1: + $parsed_flags['compression_speed'] = 'maximum'; + break; + case 2: + $parsed_flags['compression_speed'] = 'fast'; + break; + case 3: + $parsed_flags['compression_speed'] = 'superfast'; + break; + } + break; + } + $parsed_flags['data_descriptor_used'] = (bool)($flag_bytes & 0x0008); + + return $parsed_flags; + } + + + + public static function ZIPversionOSLookup($index) { + + static $lookup = array ( + 0 => 'MS-DOS and OS/2 (FAT / VFAT / FAT32 file systems)', + 1 => 'Amiga', + 2 => 'OpenVMS', + 3 => 'Unix', + 4 => 'VM/CMS', + 5 => 'Atari ST', + 6 => 'OS/2 H.P.F.S.', + 7 => 'Macintosh', + 8 => 'Z-System', + 9 => 'CP/M', + 10 => 'Windows NTFS', + 11 => 'MVS', + 12 => 'VSE', + 13 => 'Acorn Risc', + 14 => 'VFAT', + 15 => 'Alternate MVS', + 16 => 'BeOS', + 17 => 'Tandem' + ); + return (isset($lookup[$index]) ? $lookup[$index] : '[unknown]'); + } + + + + public static function ZIPcompressionMethodLookup($index) { + + static $lookup = array ( + 0 => 'store', + 1 => 'shrink', + 2 => 'reduce-1', + 3 => 'reduce-2', + 4 => 'reduce-3', + 5 => 'reduce-4', + 6 => 'implode', + 7 => 'tokenize', + 8 => 'deflate', + 9 => 'deflate64', + 10 => 'PKWARE Date Compression Library Imploding' + ); + return (isset($lookup[$index]) ? $lookup[$index] : '[unknown]'); + } + + + + public static function DOStime2UNIXtime($DOSdate, $DOStime) { + + /* + // wFatDate + // Specifies the MS-DOS date. The date is a packed 16-bit value with the following format: + // Bits Contents + // 0-4 Day of the month (1-31) + // 5-8 Month (1 = January, 2 = February, and so on) + // 9-15 Year offset from 1980 (add 1980 to get actual year) + + $UNIXday = ($DOSdate & 0x001F); + $UNIXmonth = (($DOSdate & 0x01E0) >> 5); + $UNIXyear = (($DOSdate & 0xFE00) >> 9) + 1980; + + // wFatTime + // Specifies the MS-DOS time. The time is a packed 16-bit value with the following format: + // Bits Contents + // 0-4 Second divided by 2 + // 5-10 Minute (0-59) + // 11-15 Hour (0-23 on a 24-hour clock) + + $UNIXsecond = ($DOStime & 0x001F) * 2; + $UNIXminute = (($DOStime & 0x07E0) >> 5); + $UNIXhour = (($DOStime & 0xF800) >> 11); + + return gmmktime($UNIXhour, $UNIXminute, $UNIXsecond, $UNIXmonth, $UNIXday, $UNIXyear); + */ + return gmmktime(($DOStime & 0xF800) >> 11, ($DOStime & 0x07E0) >> 5, ($DOStime & 0x001F) * 2, ($DOSdate & 0x01E0) >> 5, $DOSdate & 0x001F, (($DOSdate & 0xFE00) >> 9) + 1980); + } + + + + public static function array_merge_clobber($array1, $array2) { + + // written by kcØhireability*com + // taken from http://www.php.net/manual/en/function.array-merge-recursive.php + + if (!is_array($array1) || !is_array($array2)) { + return false; + } + + $newarray = $array1; + foreach ($array2 as $key => $val) { + if (is_array($val) && isset($newarray[$key]) && is_array($newarray[$key])) { + $newarray[$key] = getid3_zip::array_merge_clobber($newarray[$key], $val); + } else { + $newarray[$key] = $val; + } + } + return $newarray; + } + + + + public static function CreateDeepArray($array_path, $separator, $value) { + + // assigns $value to a nested array path: + // $foo = getid3_lib::CreateDeepArray('/path/to/my', '/', 'file.txt') + // is the same as: + // $foo = array ('path'=>array('to'=>'array('my'=>array('file.txt')))); + // or + // $foo['path']['to']['my'] = 'file.txt'; + + while ($array_path{0} == $separator) { + $array_path = substr($array_path, 1); + } + if (($pos = strpos($array_path, $separator)) !== false) { + return array (substr($array_path, 0, $pos) => getid3_zip::CreateDeepArray(substr($array_path, $pos + 1), $separator, $value)); + } + + return array ($array_path => $value); + } + +} + + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.audio-video.asf.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.audio-video.asf.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,1846 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio-video.php | +// | Module for analyzing Microsoft ASF, WMA and WMV files. | +// | dependencies: module.audio-video.riff.php | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio-video.asf.php,v 1.7 2006/12/01 22:39:48 ah Exp $ + + + +class getid3_asf extends getid3_handler +{ + + const Extended_Stream_Properties_Object = '14E6A5CB-C672-4332-8399-A96952065B5A'; + const Padding_Object = '1806D474-CADF-4509-A4BA-9AABCB96AAE8'; + const Payload_Ext_Syst_Pixel_Aspect_Ratio = '1B1EE554-F9EA-4BC8-821A-376B74E4C4B8'; + const Script_Command_Object = '1EFB1A30-0B62-11D0-A39B-00A0C90348F6'; + const No_Error_Correction = '20FB5700-5B55-11CF-A8FD-00805F5C442B'; + const Content_Branding_Object = '2211B3FA-BD23-11D2-B4B7-00A0C955FC6E'; + const Content_Encryption_Object = '2211B3FB-BD23-11D2-B4B7-00A0C955FC6E'; + const Digital_Signature_Object = '2211B3FC-BD23-11D2-B4B7-00A0C955FC6E'; + const Extended_Content_Encryption_Object = '298AE614-2622-4C17-B935-DAE07EE9289C'; + const Simple_Index_Object = '33000890-E5B1-11CF-89F4-00A0C90349CB'; + const Degradable_JPEG_Media = '35907DE0-E415-11CF-A917-00805F5C442B'; + const Payload_Extension_System_Timecode = '399595EC-8667-4E2D-8FDB-98814CE76C1E'; + const Binary_Media = '3AFB65E2-47EF-40F2-AC2C-70A90D71D343'; + const Timecode_Index_Object = '3CB73FD0-0C4A-4803-953D-EDF7B6228F0C'; + const Metadata_Library_Object = '44231C94-9498-49D1-A141-1D134E457054'; + const Reserved_3 = '4B1ACBE3-100B-11D0-A39B-00A0C90348F6'; + const Reserved_4 = '4CFEDB20-75F6-11CF-9C0F-00A0C90349CB'; + const Command_Media = '59DACFC0-59E6-11D0-A3AC-00A0C90348F6'; + const Header_Extension_Object = '5FBF03B5-A92E-11CF-8EE3-00C00C205365'; + const Media_Object_Index_Parameters_Obj = '6B203BAD-3F11-4E84-ACA8-D7613DE2CFA7'; + const Header_Object = '75B22630-668E-11CF-A6D9-00AA0062CE6C'; + const Content_Description_Object = '75B22633-668E-11CF-A6D9-00AA0062CE6C'; + const Error_Correction_Object = '75B22635-668E-11CF-A6D9-00AA0062CE6C'; + const Data_Object = '75B22636-668E-11CF-A6D9-00AA0062CE6C'; + const Web_Stream_Media_Subtype = '776257D4-C627-41CB-8F81-7AC7FF1C40CC'; + const Stream_Bitrate_Properties_Object = '7BF875CE-468D-11D1-8D82-006097C9A2B2'; + const Language_List_Object = '7C4346A9-EFE0-4BFC-B229-393EDE415C85'; + const Codec_List_Object = '86D15240-311D-11D0-A3A4-00A0C90348F6'; + const Reserved_2 = '86D15241-311D-11D0-A3A4-00A0C90348F6'; + const File_Properties_Object = '8CABDCA1-A947-11CF-8EE4-00C00C205365'; + const File_Transfer_Media = '91BD222C-F21C-497A-8B6D-5AA86BFC0185'; + const Old_RTP_Extension_Data = '96800C63-4C94-11D1-837B-0080C7A37F95'; + const Advanced_Mutual_Exclusion_Object = 'A08649CF-4775-4670-8A16-6E35357566CD'; + const Bandwidth_Sharing_Object = 'A69609E6-517B-11D2-B6AF-00C04FD908E9'; + const Reserved_1 = 'ABD3D211-A9BA-11CF-8EE6-00C00C205365'; + const Bandwidth_Sharing_Exclusive = 'AF6060AA-5197-11D2-B6AF-00C04FD908E9'; + const Bandwidth_Sharing_Partial = 'AF6060AB-5197-11D2-B6AF-00C04FD908E9'; + const JFIF_Media = 'B61BE100-5B4E-11CF-A8FD-00805F5C442B'; + const Stream_Properties_Object = 'B7DC0791-A9B7-11CF-8EE6-00C00C205365'; + const Video_Media = 'BC19EFC0-5B4D-11CF-A8FD-00805F5C442B'; + const Audio_Spread = 'BFC3CD50-618F-11CF-8BB2-00AA00B4E220'; + const Metadata_Object = 'C5F8CBEA-5BAF-4877-8467-AA8C44FA4CCA'; + const Payload_Ext_Syst_Sample_Duration = 'C6BD9450-867F-4907-83A3-C77921B733AD'; + const Group_Mutual_Exclusion_Object = 'D1465A40-5A79-4338-B71B-E36B8FD6C249'; + const Extended_Content_Description_Object = 'D2D0A440-E307-11D2-97F0-00A0C95EA850'; + const Stream_Prioritization_Object = 'D4FED15B-88D3-454F-81F0-ED5C45999E24'; + const Payload_Ext_System_Content_Type = 'D590DC20-07BC-436C-9CF7-F3BBFBF1A4DC'; + const Old_File_Properties_Object = 'D6E229D0-35DA-11D1-9034-00A0C90349BE'; + const Old_ASF_Header_Object = 'D6E229D1-35DA-11D1-9034-00A0C90349BE'; + const Old_ASF_Data_Object = 'D6E229D2-35DA-11D1-9034-00A0C90349BE'; + const Index_Object = 'D6E229D3-35DA-11D1-9034-00A0C90349BE'; + const Old_Stream_Properties_Object = 'D6E229D4-35DA-11D1-9034-00A0C90349BE'; + const Old_Content_Description_Object = 'D6E229D5-35DA-11D1-9034-00A0C90349BE'; + const Old_Script_Command_Object = 'D6E229D6-35DA-11D1-9034-00A0C90349BE'; + const Old_Marker_Object = 'D6E229D7-35DA-11D1-9034-00A0C90349BE'; + const Old_Component_Download_Object = 'D6E229D8-35DA-11D1-9034-00A0C90349BE'; + const Old_Stream_Group_Object = 'D6E229D9-35DA-11D1-9034-00A0C90349BE'; + const Old_Scalable_Object = 'D6E229DA-35DA-11D1-9034-00A0C90349BE'; + const Old_Prioritization_Object = 'D6E229DB-35DA-11D1-9034-00A0C90349BE'; + const Bitrate_Mutual_Exclusion_Object = 'D6E229DC-35DA-11D1-9034-00A0C90349BE'; + const Old_Inter_Media_Dependency_Object = 'D6E229DD-35DA-11D1-9034-00A0C90349BE'; + const Old_Rating_Object = 'D6E229DE-35DA-11D1-9034-00A0C90349BE'; + const Index_Parameters_Object = 'D6E229DF-35DA-11D1-9034-00A0C90349BE'; + const Old_Color_Table_Object = 'D6E229E0-35DA-11D1-9034-00A0C90349BE'; + const Old_Language_List_Object = 'D6E229E1-35DA-11D1-9034-00A0C90349BE'; + const Old_Audio_Media = 'D6E229E2-35DA-11D1-9034-00A0C90349BE'; + const Old_Video_Media = 'D6E229E3-35DA-11D1-9034-00A0C90349BE'; + const Old_Image_Media = 'D6E229E4-35DA-11D1-9034-00A0C90349BE'; + const Old_Timecode_Media = 'D6E229E5-35DA-11D1-9034-00A0C90349BE'; + const Old_Text_Media = 'D6E229E6-35DA-11D1-9034-00A0C90349BE'; + const Old_MIDI_Media = 'D6E229E7-35DA-11D1-9034-00A0C90349BE'; + const Old_Command_Media = 'D6E229E8-35DA-11D1-9034-00A0C90349BE'; + const Old_No_Error_Concealment = 'D6E229EA-35DA-11D1-9034-00A0C90349BE'; + const Old_Scrambled_Audio = 'D6E229EB-35DA-11D1-9034-00A0C90349BE'; + const Old_No_Color_Table = 'D6E229EC-35DA-11D1-9034-00A0C90349BE'; + const Old_SMPTE_Time = 'D6E229ED-35DA-11D1-9034-00A0C90349BE'; + const Old_ASCII_Text = 'D6E229EE-35DA-11D1-9034-00A0C90349BE'; + const Old_Unicode_Text = 'D6E229EF-35DA-11D1-9034-00A0C90349BE'; + const Old_HTML_Text = 'D6E229F0-35DA-11D1-9034-00A0C90349BE'; + const Old_URL_Command = 'D6E229F1-35DA-11D1-9034-00A0C90349BE'; + const Old_Filename_Command = 'D6E229F2-35DA-11D1-9034-00A0C90349BE'; + const Old_ACM_Codec = 'D6E229F3-35DA-11D1-9034-00A0C90349BE'; + const Old_VCM_Codec = 'D6E229F4-35DA-11D1-9034-00A0C90349BE'; + const Old_QuickTime_Codec = 'D6E229F5-35DA-11D1-9034-00A0C90349BE'; + const Old_DirectShow_Transform_Filter = 'D6E229F6-35DA-11D1-9034-00A0C90349BE'; + const Old_DirectShow_Rendering_Filter = 'D6E229F7-35DA-11D1-9034-00A0C90349BE'; + const Old_No_Enhancement = 'D6E229F8-35DA-11D1-9034-00A0C90349BE'; + const Old_Unknown_Enhancement_Type = 'D6E229F9-35DA-11D1-9034-00A0C90349BE'; + const Old_Temporal_Enhancement = 'D6E229FA-35DA-11D1-9034-00A0C90349BE'; + const Old_Spatial_Enhancement = 'D6E229FB-35DA-11D1-9034-00A0C90349BE'; + const Old_Quality_Enhancement = 'D6E229FC-35DA-11D1-9034-00A0C90349BE'; + const Old_Number_of_Channels_Enhancement = 'D6E229FD-35DA-11D1-9034-00A0C90349BE'; + const Old_Frequency_Response_Enhancement = 'D6E229FE-35DA-11D1-9034-00A0C90349BE'; + const Old_Media_Object = 'D6E229FF-35DA-11D1-9034-00A0C90349BE'; + const Mutex_Language = 'D6E22A00-35DA-11D1-9034-00A0C90349BE'; + const Mutex_Bitrate = 'D6E22A01-35DA-11D1-9034-00A0C90349BE'; + const Mutex_Unknown = 'D6E22A02-35DA-11D1-9034-00A0C90349BE'; + const Old_ASF_Placeholder_Object = 'D6E22A0E-35DA-11D1-9034-00A0C90349BE'; + const Old_Data_Unit_Extension_Object = 'D6E22A0F-35DA-11D1-9034-00A0C90349BE'; + const Web_Stream_Format = 'DA1E6B13-8359-4050-B398-388E965BF00C'; + const Payload_Ext_System_File_Name = 'E165EC0E-19ED-45D7-B4A7-25CBD1E28E9B'; + const Marker_Object = 'F487CD01-A951-11CF-8EE6-00C00C205365'; + const Timecode_Index_Parameters_Object = 'F55E496D-9797-4B5D-8C8B-604DFE9BFB24'; + const Audio_Media = 'F8699E40-5B4D-11CF-A8FD-00805F5C442B'; + const Media_Object_Index_Object = 'FEB103F8-12AD-4C64-840F-2A1D2F7AD48C'; + const Alt_Extended_Content_Encryption_Obj = 'FF889EF1-ADEE-40DA-9E71-98704BB928CE'; + + + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->include_module('audio-video.riff'); + + !isset($getid3->info['audio']) and $getid3->info['audio'] = array (); + !isset($getid3->info['video']) and $getid3->info['video'] = array (); + $getid3->info['asf']['comments'] = $getid3->info['asf']['header_object'] = array (); + + $info_audio = &$getid3->info['audio']; + $info_video = &$getid3->info['video']; + $info_asf = &$getid3->info['asf']; + $info_asf_comments = &$info_asf['comments']; + $info_asf_header_object = &$info_asf['header_object']; + + // ASF structure: + // * Header Object [required] + // * File Properties Object [required] (global file attributes) + // * Stream Properties Object [required] (defines media stream & characteristics) + // * Header Extension Object [required] (additional functionality) + // * Content Description Object (bibliographic information) + // * Script Command Object (commands for during playback) + // * Marker Object (named jumped points within the file) + // * Data Object [required] + // * Data Packets + // * Index Object + + // Header Object: (mandatory, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for header object - getid3_asf::Header_Object + // Object Size QWORD 64 // size of header object, including 30 bytes of Header Object header + // Number of Header Objects DWORD 32 // number of objects in header object + // Reserved1 BYTE 8 // hardcoded: 0x01 + // Reserved2 BYTE 8 // hardcoded: 0x02 + + $getid3->info['fileformat'] = 'asf'; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $header_object_data = fread($getid3->fp, 30); + + $info_asf_header_object['objectid_guid'] = getid3_asf::BytestringToGUID(substr($header_object_data, 0, 16)); + + if ($info_asf_header_object['objectid_guid'] != getid3_asf::Header_Object) { + throw new getid3_exception('ASF header GUID {'.$info_asf_header_object['objectid_guid'].'} does not match expected "getid3_asf::Header_Object" GUID {'.getid3_asf::Header_Object.'}'); + } + + getid3_lib::ReadSequence('LittleEndian2Int', $info_asf_header_object, $header_object_data, 16, + array ( + 'objectsize' => 8, + 'headerobjects' => 4, + 'reserved1' => 1, + 'reserved2' => 1 + ) + ); + + $asf_header_data = fread($getid3->fp, $info_asf_header_object['objectsize'] - 30); + $offset = 0; + + for ($header_objects_counter = 0; $header_objects_counter < $info_asf_header_object['headerobjects']; $header_objects_counter++) { + + $next_object_guid = substr($asf_header_data, $offset, 16); + $offset += 16; + + $next_object_size = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 8)); + $offset += 8; + + $next_object_guidtext = getid3_asf::BytestringToGUID($next_object_guid); + + switch ($next_object_guidtext) { + + case getid3_asf::File_Properties_Object: + + // File Properties Object: (mandatory, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for file properties object - getid3_asf::File_Properties_Object + // Object Size QWORD 64 // size of file properties object, including 104 bytes of File Properties Object header + // File ID GUID 128 // unique ID - identical to File ID in Data Object + // File Size QWORD 64 // entire file in bytes. Invalid if Broadcast Flag == 1 + // Creation Date QWORD 64 // date & time of file creation. Maybe invalid if Broadcast Flag == 1 + // Data Packets Count QWORD 64 // number of data packets in Data Object. Invalid if Broadcast Flag == 1 + // Play Duration QWORD 64 // playtime, in 100-nanosecond units. Invalid if Broadcast Flag == 1 + // Send Duration QWORD 64 // time needed to send file, in 100-nanosecond units. Players can ignore this value. Invalid if Broadcast Flag == 1 + // Preroll QWORD 64 // time to buffer data before starting to play file, in 1-millisecond units. If <> 0, PlayDuration and PresentationTime have been offset by this amount + // Flags DWORD 32 // + // * Broadcast Flag bits 1 (0x01) // file is currently being written, some header values are invalid + // * Seekable Flag bits 1 (0x02) // is file seekable + // * Reserved bits 30 (0xFFFFFFFC) // reserved - set to zero + // Minimum Data Packet Size DWORD 32 // in bytes. should be same as Maximum Data Packet Size. Invalid if Broadcast Flag == 1 + // Maximum Data Packet Size DWORD 32 // in bytes. should be same as Minimum Data Packet Size. Invalid if Broadcast Flag == 1 + // Maximum Bitrate DWORD 32 // maximum instantaneous bitrate in bits per second for entire file, including all data streams and ASF overhead + + $info_asf['file_properties_object'] = array (); + $info_asf_file_properties_object = &$info_asf['file_properties_object']; + + $info_asf_file_properties_object['objectid_guid'] = $next_object_guidtext; + $info_asf_file_properties_object['objectsize'] = $next_object_size; + + $info_asf_file_properties_object['fileid_guid'] = getid3_asf::BytestringToGUID(substr($asf_header_data, $offset, 16)); + $offset += 16; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_asf_file_properties_object, $asf_header_data, $offset, + array ( + 'filesize' => 8, + 'creation_date' => 8, + 'data_packets' => 8, + 'play_duration' => 8, + 'send_duration' => 8, + 'preroll' => 8, + 'flags_raw' => 4, + 'min_packet_size' => 4, + 'max_packet_size' => 4, + 'max_bitrate' => 4 + ) + ); + + $offset += 64 ; + + $info_asf_file_properties_object['creation_date_unix'] = getid3_asf::FiletimeToUNIXtime($info_asf_file_properties_object['creation_date']); + $info_asf_file_properties_object['flags']['broadcast'] = (bool)($info_asf_file_properties_object['flags_raw'] & 0x0001); + $info_asf_file_properties_object['flags']['seekable'] = (bool)($info_asf_file_properties_object['flags_raw'] & 0x0002); + + $getid3->info['playtime_seconds'] = ($info_asf_file_properties_object['play_duration'] / 10000000) - ($info_asf_file_properties_object['preroll'] / 1000); + $getid3->info['bitrate'] = ($info_asf_file_properties_object['filesize'] * 8) / $getid3->info['playtime_seconds']; + break; + + + case getid3_asf::Stream_Properties_Object: + + // Stream Properties Object: (mandatory, one per media stream) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for stream properties object - getid3_asf::Stream_Properties_Object + // Object Size QWORD 64 // size of stream properties object, including 78 bytes of Stream Properties Object header + // Stream Type GUID 128 // getid3_asf::Audio_Media, getid3_asf::Video_Media or getid3_asf::Command_Media + // Error Correction Type GUID 128 // getid3_asf::Audio_Spread for audio-only streams, getid3_asf::No_Error_Correction for other stream types + // Time Offset QWORD 64 // 100-nanosecond units. typically zero. added to all timestamps of samples in the stream + // Type-Specific Data Length DWORD 32 // number of bytes for Type-Specific Data field + // Error Correction Data Length DWORD 32 // number of bytes for Error Correction Data field + // Flags WORD 16 // + // * Stream Number bits 7 (0x007F) // number of this stream. 1 <= valid <= 127 + // * Reserved bits 8 (0x7F80) // reserved - set to zero + // * Encrypted Content Flag bits 1 (0x8000) // stream contents encrypted if set + // Reserved DWORD 32 // reserved - set to zero + // Type-Specific Data BYTESTREAM variable // type-specific format data, depending on value of Stream Type + // Error Correction Data BYTESTREAM variable // error-correction-specific format data, depending on value of Error Correct Type + + // There is one getid3_asf::Stream_Properties_Object for each stream (audio, video) but the + // stream number isn't known until halfway through decoding the structure, hence it + // it is decoded to a temporary variable and then stuck in the appropriate index later + + $stream_properties_object_data['objectid_guid'] = $next_object_guidtext; + $stream_properties_object_data['objectsize'] = $next_object_size; + + getid3_lib::ReadSequence('LittleEndian2Int', $stream_properties_object_data, $asf_header_data, $offset, + array ( + 'stream_type' => -16, + 'error_correct_type' => -16, + 'time_offset' => 8, + 'type_data_length' => 4, + 'error_data_length' => 4, + 'flags_raw' => 2 + ) + ); + + $stream_properties_stream_number = $stream_properties_object_data['flags_raw'] & 0x007F; + $stream_properties_object_data['flags']['encrypted'] = (bool)($stream_properties_object_data['flags_raw'] & 0x8000); + + $stream_properties_object_data['stream_type_guid'] = getid3_asf::BytestringToGUID($stream_properties_object_data['stream_type']); + $stream_properties_object_data['error_correct_guid'] = getid3_asf::BytestringToGUID($stream_properties_object_data['error_correct_type']); + + $offset += 54; // 50 bytes + 4 bytes reserved - DWORD + + $stream_properties_object_data['type_specific_data'] = substr($asf_header_data, $offset, $stream_properties_object_data['type_data_length']); + $offset += $stream_properties_object_data['type_data_length']; + + $stream_properties_object_data['error_correct_data'] = substr($asf_header_data, $offset, $stream_properties_object_data['error_data_length']); + $offset += $stream_properties_object_data['error_data_length']; + + switch ($stream_properties_object_data['stream_type_guid']) { + + case getid3_asf::Audio_Media: + + $info_audio['dataformat'] = (@$info_audio['dataformat'] ? $info_audio['dataformat'] : 'asf'); + $info_audio['bitrate_mode'] = (@$info_audio['bitrate_mode'] ? $info_audio['bitrate_mode'] : 'cbr'); + + $audiodata = getid3_riff::RIFFparseWAVEFORMATex(substr($stream_properties_object_data['type_specific_data'], 0, 16)); + unset($audiodata['raw']); + $info_audio = getid3_riff::array_merge_noclobber($audiodata, $info_audio); + break; + + + case getid3_asf::Video_Media: + + $info_video['dataformat'] = (@$info_video['dataformat'] ? $info_video['dataformat'] : 'asf'); + $info_video['bitrate_mode'] = (@$info_video['bitrate_mode'] ? $info_video['bitrate_mode'] : 'cbr'); + break; + + + /* does nothing but eat memory + case getid3_asf::Command_Media: + default: + // do nothing + break; + */ + } + + $info_asf['stream_properties_object'][$stream_properties_stream_number] = $stream_properties_object_data; + unset($stream_properties_object_data); // clear for next stream, if any + break; + + + case getid3_asf::Header_Extension_Object: + + // Header Extension Object: (mandatory, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Header Extension object - getid3_asf::Header_Extension_Object + // Object Size QWORD 64 // size of Header Extension object, including 46 bytes of Header Extension Object header + // Reserved Field 1 GUID 128 // hardcoded: getid3_asf::Reserved_1 + // Reserved Field 2 WORD 16 // hardcoded: 0x00000006 + // Header Extension Data Size DWORD 32 // in bytes. valid: 0, or > 24. equals object size minus 46 + // Header Extension Data BYTESTREAM variable // array of zero or more extended header objects + + $info_asf['header_extension_object'] = array (); + $info_asf_header_extension_object = &$info_asf['header_extension_object']; + + $info_asf_header_extension_object['objectid_guid'] = $next_object_guidtext; + $info_asf_header_extension_object['objectsize'] = $next_object_size; + $info_asf_header_extension_object['reserved_1_guid'] = getid3_asf::BytestringToGUID(substr($asf_header_data, $offset, 16)); + $offset += 16; + + if ($info_asf_header_extension_object['reserved_1_guid'] != getid3_asf::Reserved_1) { + $getid3->warning('header_extension_object.reserved_1 GUID ('.$info_asf_header_extension_object['reserved_1_guid'].') does not match expected "getid3_asf::Reserved_1" GUID ('.getid3_asf::Reserved_1.')'); + break; + } + + $info_asf_header_extension_object['reserved_2'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + + if ($info_asf_header_extension_object['reserved_2'] != 6) { + $getid3->warning('header_extension_object.reserved_2 ('.getid3_lib::PrintHexBytes($info_asf_header_extension_object['reserved_2']).') does not match expected value of "6"'); + break; + } + + $info_asf_header_extension_object['extension_data_size'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 4)); + $offset += 4; + + $info_asf_header_extension_object['extension_data'] = substr($asf_header_data, $offset, $info_asf_header_extension_object['extension_data_size']); + $offset += $info_asf_header_extension_object['extension_data_size']; + break; + + + case getid3_asf::Codec_List_Object: + + // Codec List Object: (optional, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Codec List object - getid3_asf::Codec_List_Object + // Object Size QWORD 64 // size of Codec List object, including 44 bytes of Codec List Object header + // Reserved GUID 128 // hardcoded: 86D15241-311D-11D0-A3A4-00A0C90348F6 + // Codec Entries Count DWORD 32 // number of entries in Codec Entries array + // Codec Entries array of: variable // + // * Type WORD 16 // 0x0001 = Video Codec, 0x0002 = Audio Codec, 0xFFFF = Unknown Codec + // * Codec Name Length WORD 16 // number of Unicode characters stored in the Codec Name field + // * Codec Name WCHAR variable // array of Unicode characters - name of codec used to create the content + // * Codec Description Length WORD 16 // number of Unicode characters stored in the Codec Description field + // * Codec Description WCHAR variable // array of Unicode characters - description of format used to create the content + // * Codec Information Length WORD 16 // number of Unicode characters stored in the Codec Information field + // * Codec Information BYTESTREAM variable // opaque array of information bytes about the codec used to create the content + + $info_asf['codec_list_object'] = array (); + $info_asf_codec_list_object = &$info_asf['codec_list_object']; + + $info_asf_codec_list_object['objectid_guid'] = $next_object_guidtext; + $info_asf_codec_list_object['objectsize'] = $next_object_size; + + $info_asf_codec_list_object['reserved_guid'] = getid3_asf::BytestringToGUID(substr($asf_header_data, $offset, 16)); + $offset += 16; + + if ($info_asf_codec_list_object['reserved_guid'] != '86D15241-311D-11D0-A3A4-00A0C90348F6') { + $getid3->warning('codec_list_object.reserved GUID {'.$info_asf_codec_list_object['reserved_guid'].'} does not match expected "getid3_asf::Reserved_1" GUID {86D15241-311D-11D0-A3A4-00A0C90348F6}'); + break; + } + + $info_asf_codec_list_object['codec_entries_count'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 4)); + $offset += 4; + + for ($codec_entry_counter = 0; $codec_entry_counter < $info_asf_codec_list_object['codec_entries_count']; $codec_entry_counter++) { + + $info_asf_codec_list_object['codec_entries'][$codec_entry_counter] = array (); + $info_asf_codec_list_object_codecentries_current = &$info_asf_codec_list_object['codec_entries'][$codec_entry_counter]; + + $info_asf_codec_list_object_codecentries_current['type_raw'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + + $info_asf_codec_list_object_codecentries_current['type'] = getid3_asf::ASFCodecListObjectTypeLookup($info_asf_codec_list_object_codecentries_current['type_raw']); + + $codec_name_length = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)) * 2; // 2 bytes per character + $offset += 2; + + $info_asf_codec_list_object_codecentries_current['name'] = substr($asf_header_data, $offset, $codec_name_length); + $offset += $codec_name_length; + + $codec_description_length = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)) * 2; // 2 bytes per character + $offset += 2; + + $info_asf_codec_list_object_codecentries_current['description'] = substr($asf_header_data, $offset, $codec_description_length); + $offset += $codec_description_length; + + $codec_information_length = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + + $info_asf_codec_list_object_codecentries_current['information'] = substr($asf_header_data, $offset, $codec_information_length); + $offset += $codec_information_length; + + if ($info_asf_codec_list_object_codecentries_current['type_raw'] == 2) { + + // audio codec + if (strpos($info_asf_codec_list_object_codecentries_current['description'], ',') === false) { + throw new getid3_exception('[asf][codec_list_object][codec_entries]['.$codec_entry_counter.'][description] expected to contain comma-seperated list of parameters: "'.$info_asf_codec_list_object_codecentries_current['description'].'"'); + } + list($audio_codec_bitrate, $audio_codec_frequency, $audio_codec_channels) = explode(',', $this->TrimConvert($info_asf_codec_list_object_codecentries_current['description'])); + $info_audio['codec'] = $this->TrimConvert($info_asf_codec_list_object_codecentries_current['name']); + + if (!isset($info_audio['bitrate']) && strstr($audio_codec_bitrate, 'kbps')) { + $info_audio['bitrate'] = (int)(trim(str_replace('kbps', '', $audio_codec_bitrate)) * 1000); + } + + if (!isset($info_video['bitrate']) && isset($info_audio['bitrate']) && isset($info_asf['file_properties_object']['max_bitrate']) && ($info_asf_codec_list_object['codec_entries_count'] > 1)) { + $info_video['bitrate'] = $info_asf['file_properties_object']['max_bitrate'] - $info_audio['bitrate']; + } + + if (!@$info_video['bitrate'] && @$info_audio['bitrate'] && @$getid3->info['bitrate']) { + $info_video['bitrate'] = $getid3->info['bitrate'] - $info_audio['bitrate']; + } + + $audio_codec_frequency = (int)trim(str_replace('kHz', '', $audio_codec_frequency)); + + static $sample_rate_lookup = array ( + 8 => 8000, 8000 => 8000, + 11 => 11025, 11025 => 11025, + 12 => 12000, 12000 => 12000, + 16 => 16000, 16000 => 16000, + 22 => 22050, 22050 => 22050, + 24 => 24000, 24000 => 24000, + 32 => 32000, 32000 => 32000, + 44 => 44100, 44100 => 44100, + 48 => 48000, 48000 => 48000, + ); + + $info_audio['sample_rate'] = @$sample_rate_lookup[$audio_codec_frequency]; + + if (!$info_audio['sample_rate']) { + $getid3->warning('unknown frequency: "'.$audio_codec_frequency.'" ('.$this->TrimConvert($info_asf_codec_list_object_codecentries_current['description']).')'); + break; + } + + if (!isset($info_audio['channels'])) { + if (strstr($audio_codec_channels, 'stereo')) { + $info_audio['channels'] = 2; + } elseif (strstr($audio_codec_channels, 'mono')) { + $info_audio['channels'] = 1; + } + } + } + } + break; + + + case getid3_asf::Script_Command_Object: + + // Script Command Object: (optional, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Script Command object - getid3_asf::Script_Command_Object + // Object Size QWORD 64 // size of Script Command object, including 44 bytes of Script Command Object header + // Reserved GUID 128 // hardcoded: 4B1ACBE3-100B-11D0-A39B-00A0C90348F6 + // Commands Count WORD 16 // number of Commands structures in the Script Commands Objects + // Command Types Count WORD 16 // number of Command Types structures in the Script Commands Objects + // Command Types array of: variable // + // * Command Type Name Length WORD 16 // number of Unicode characters for Command Type Name + // * Command Type Name WCHAR variable // array of Unicode characters - name of a type of command + // Commands array of: variable // + // * Presentation Time DWORD 32 // presentation time of that command, in milliseconds + // * Type Index WORD 16 // type of this command, as a zero-based index into the array of Command Types of this object + // * Command Name Length WORD 16 // number of Unicode characters for Command Name + // * Command Name WCHAR variable // array of Unicode characters - name of this command + + // shortcut + $info_asf['script_command_object'] = array (); + $info_asf_script_command_object = &$info_asf['script_command_object']; + + $info_asf_script_command_object['objectid_guid'] = $next_object_guidtext; + $info_asf_script_command_object['objectsize'] = $next_object_size; + $info_asf_script_command_object['reserved_guid'] = getid3_asf::BytestringToGUID(substr($asf_header_data, $offset, 16)); + $offset += 16; + + if ($info_asf_script_command_object['reserved_guid'] != '4B1ACBE3-100B-11D0-A39B-00A0C90348F6') { + $getid3->warning('script_command_object.reserved GUID {'.$info_asf_script_command_object['reserved_guid'].'} does not match expected GUID {4B1ACBE3-100B-11D0-A39B-00A0C90348F6}'); + break; + } + + $info_asf_script_command_object['commands_count'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + + $info_asf_script_command_object['command_types_count'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + + for ($command_types_counter = 0; $command_types_counter < $info_asf_script_command_object['command_types_count']; $command_types_counter++) { + + $command_type_name_length = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)) * 2; // 2 bytes per character + $offset += 2; + + $info_asf_script_command_object['command_types'][$command_types_counter]['name'] = substr($asf_header_data, $offset, $command_type_name_length); + $offset += $command_type_name_length; + } + + for ($commands_counter = 0; $commands_counter < $info_asf_script_command_object['commands_count']; $commands_counter++) { + + $info_asf_script_command_object['commands'][$commands_counter]['presentation_time'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 4)); + $offset += 4; + + $info_asf_script_command_object['commands'][$commands_counter]['type_index'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + + $command_type_name_length = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)) * 2; // 2 bytes per character + $offset += 2; + + $info_asf_script_command_object['commands'][$commands_counter]['name'] = substr($asf_header_data, $offset, $command_type_name_length); + $offset += $command_type_name_length; + } + break; + + + case getid3_asf::Marker_Object: + + // Marker Object: (optional, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Marker object - getid3_asf::Marker_Object + // Object Size QWORD 64 // size of Marker object, including 48 bytes of Marker Object header + // Reserved GUID 128 // hardcoded: 4CFEDB20-75F6-11CF-9C0F-00A0C90349CB + // Markers Count DWORD 32 // number of Marker structures in Marker Object + // Reserved WORD 16 // hardcoded: 0x0000 + // Name Length WORD 16 // number of bytes in the Name field + // Name WCHAR variable // name of the Marker Object + // Markers array of: variable // + // * Offset QWORD 64 // byte offset into Data Object + // * Presentation Time QWORD 64 // in 100-nanosecond units + // * Entry Length WORD 16 // length in bytes of (Send Time + Flags + Marker Description Length + Marker Description + Padding) + // * Send Time DWORD 32 // in milliseconds + // * Flags DWORD 32 // hardcoded: 0x00000000 + // * Marker Description Length DWORD 32 // number of bytes in Marker Description field + // * Marker Description WCHAR variable // array of Unicode characters - description of marker entry + // * Padding BYTESTREAM variable // optional padding bytes + + $info_asf['marker_object'] = array (); + $info_asf_marker_object = &$info_asf['marker_object']; + + $info_asf_marker_object['objectid_guid'] = $next_object_guidtext; + $info_asf_marker_object['objectsize'] = $next_object_size; + $info_asf_marker_object['reserved_guid'] = getid3_asf::BytestringToGUID(substr($asf_header_data, $offset, 16)); + $offset += 16; + + if ($info_asf_marker_object['reserved_guid'] != '4CFEDB20-75F6-11CF-9C0F-00A0C90349CB') { + $getid3->warning('marker_object.reserved GUID {'.$info_asf_marker_object['reserved_guid'].'} does not match expected GUID {4CFEDB20-75F6-11CF-9C0F-00A0C90349CB}'); + break; + } + + $info_asf_marker_object['markers_count'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 4)); + $offset += 4; + + $info_asf_marker_object['reserved_2'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + + if ($info_asf_marker_object['reserved_2'] != 0) { + $getid3->warning('marker_object.reserved_2 ('.getid3_lib::PrintHexBytes($info_asf_marker_object['reserved_2']).') does not match expected value of "0"'); + break; + } + + $info_asf_marker_object['name_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + + $info_asf_marker_object['name'] = substr($asf_header_data, $offset, $info_asf_marker_object['name_length']); + $offset += $info_asf_marker_object['name_length']; + + for ($markers_counter = 0; $markers_counter < $info_asf_marker_object['markers_count']; $markers_counter++) { + + getid3_lib::ReadSequence('LittleEndian2Int', $info_asf_marker_object['markers'][$markers_counter], $asf_header_data, $offset, + array ( + 'offset' => 8, + 'presentation_time' => 8, + 'entry_length' => 2, + 'send_time' => 4, + 'flags' => 4, + 'marker_description_length' => 4 + ) + ); + $offset += 30; + + $info_asf_marker_object['markers'][$markers_counter]['marker_description'] = substr($asf_header_data, $offset, $info_asf_marker_object['markers'][$markers_counter]['marker_description_length']); + $offset += $info_asf_marker_object['markers'][$markers_counter]['marker_description_length']; + + $padding_length = $info_asf_marker_object['markers'][$markers_counter]['entry_length'] - 4 - 4 - 4 - $info_asf_marker_object['markers'][$markers_counter]['marker_description_length']; + if ($padding_length > 0) { + $info_asf_marker_object['markers'][$markers_counter]['padding'] = substr($asf_header_data, $offset, $padding_length); + $offset += $padding_length; + } + } + break; + + + case getid3_asf::Bitrate_Mutual_Exclusion_Object: + + // Bitrate Mutual Exclusion Object: (optional) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Bitrate Mutual Exclusion object - getid3_asf::Bitrate_Mutual_Exclusion_Object + // Object Size QWORD 64 // size of Bitrate Mutual Exclusion object, including 42 bytes of Bitrate Mutual Exclusion Object header + // Exlusion Type GUID 128 // nature of mutual exclusion relationship. one of: (getid3_asf::Mutex_Bitrate, getid3_asf::Mutex_Unknown) + // Stream Numbers Count WORD 16 // number of video streams + // Stream Numbers WORD variable // array of mutually exclusive video stream numbers. 1 <= valid <= 127 + + // shortcut + $info_asf['bitrate_mutual_exclusion_object'] = array (); + $info_asf_bitrate_mutual_exclusion_object = &$info_asf['bitrate_mutual_exclusion_object']; + + $info_asf_bitrate_mutual_exclusion_object['objectid_guid'] = $next_object_guidtext; + $info_asf_bitrate_mutual_exclusion_object['objectsize'] = $next_object_size; + $info_asf_bitrate_mutual_exclusion_object['reserved_guid'] = getid3_asf::BytestringToGUID(substr($asf_header_data, $offset, 16)); + $offset += 16; + + if ($info_asf_bitrate_mutual_exclusion_object['reserved_guid'] != getid3_asf::Mutex_Bitrate && $info_asf_bitrate_mutual_exclusion_object['reserved_guid'] != getid3_asf::Mutex_Unknown) { + $getid3->warning('bitrate_mutual_exclusion_object.reserved GUID {'.$info_asf_bitrate_mutual_exclusion_object['reserved_guid'].'} does not match expected "getid3_asf::Mutex_Bitrate" GUID {'.getid3_asf::Mutex_Bitrate.'} or "getid3_asf::Mutex_Unknown" GUID {'.getid3_asf::Mutex_Unknown.'}'); + break; + } + + $info_asf_bitrate_mutual_exclusion_object['stream_numbers_count'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + + for ($stream_number_counter = 0; $stream_number_counter < $info_asf_bitrate_mutual_exclusion_object['stream_numbers_count']; $stream_number_counter++) { + $info_asf_bitrate_mutual_exclusion_object['stream_numbers'][$stream_number_counter] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + } + break; + + + case getid3_asf::Error_Correction_Object: + + // Error Correction Object: (optional, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Error Correction object - getid3_asf::Error_Correction_Object + // Object Size QWORD 64 // size of Error Correction object, including 44 bytes of Error Correction Object header + // Error Correction Type GUID 128 // type of error correction. one of: (getid3_asf::No_Error_Correction, getid3_asf::Audio_Spread) + // Error Correction Data Length DWORD 32 // number of bytes in Error Correction Data field + // Error Correction Data BYTESTREAM variable // structure depends on value of Error Correction Type field + + $info_asf['error_correction_object'] = array (); + $info_asf_error_correction_object = &$info_asf['error_correction_object']; + + $info_asf_error_correction_object['objectid_guid'] = $next_object_guidtext; + $info_asf_error_correction_object['objectsize'] = $next_object_size; + $info_asf_error_correction_object['error_correction_type'] = substr($asf_header_data, $offset, 16); + $offset += 16; + + $info_asf_error_correction_object['error_correction_guid'] = getid3_asf::BytestringToGUID($info_asf_error_correction_object['error_correction_type']); + $info_asf_error_correction_object['error_correction_data_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 4)); + $offset += 4; + + switch ($info_asf_error_correction_object['error_correction_type_guid']) { + + case getid3_asf::No_Error_Correction: + + // should be no data, but just in case there is, skip to the end of the field + $offset += $info_asf_error_correction_object['error_correction_data_length']; + break; + + + case getid3_asf::Audio_Spread: + + // Field Name Field Type Size (bits) + // Span BYTE 8 // number of packets over which audio will be spread. + // Virtual Packet Length WORD 16 // size of largest audio payload found in audio stream + // Virtual Chunk Length WORD 16 // size of largest audio payload found in audio stream + // Silence Data Length WORD 16 // number of bytes in Silence Data field + // Silence Data BYTESTREAM variable // hardcoded: 0x00 * (Silence Data Length) bytes + + getid3_lib::ReadSequence('LittleEndian2Int', $info_asf_error_correction_object, $asf_header_data, $offset, + array ( + 'span' => 1, + 'virtual_packet_length' => 2, + 'virtual_chunk_length' => 2, + 'silence_data_length' => 2 + ) + ); + $offset += 7; + + $info_asf_error_correction_object['silence_data'] = substr($asf_header_data, $offset, $info_asf_error_correction_object['silence_data_length']); + $offset += $info_asf_error_correction_object['silence_data_length']; + break; + + default: + $getid3->warning('error_correction_object.error_correction_type GUID {'.$info_asf_error_correction_object['reserved_guid'].'} does not match expected "getid3_asf::No_Error_Correction" GUID {'.getid3_asf::No_Error_Correction.'} or "getid3_asf::Audio_Spread" GUID {'.getid3_asf::Audio_Spread.'}'); + break; + } + + break; + + + case getid3_asf::Content_Description_Object: + + // Content Description Object: (optional, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Content Description object - getid3_asf::Content_Description_Object + // Object Size QWORD 64 // size of Content Description object, including 34 bytes of Content Description Object header + // Title Length WORD 16 // number of bytes in Title field + // Author Length WORD 16 // number of bytes in Author field + // Copyright Length WORD 16 // number of bytes in Copyright field + // Description Length WORD 16 // number of bytes in Description field + // Rating Length WORD 16 // number of bytes in Rating field + // Title WCHAR 16 // array of Unicode characters - Title + // Author WCHAR 16 // array of Unicode characters - Author + // Copyright WCHAR 16 // array of Unicode characters - Copyright + // Description WCHAR 16 // array of Unicode characters - Description + // Rating WCHAR 16 // array of Unicode characters - Rating + + $info_asf['content_description_object'] = array (); + $info_asf_content_description_object = &$info_asf['content_description_object']; + + $info_asf_content_description_object['objectid_guid'] = $next_object_guidtext; + $info_asf_content_description_object['objectsize'] = $next_object_size; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_asf_content_description_object, $asf_header_data, $offset, + array ( + 'title_length' => 2, + 'author_length' => 2, + 'copyright_length' => 2, + 'description_length' => 2, + 'rating_length' => 2 + ) + ); + $offset += 10; + + $info_asf_content_description_object['title'] = substr($asf_header_data, $offset, $info_asf_content_description_object['title_length']); + $offset += $info_asf_content_description_object['title_length']; + + $info_asf_content_description_object['author'] = substr($asf_header_data, $offset, $info_asf_content_description_object['author_length']); + $offset += $info_asf_content_description_object['author_length']; + + $info_asf_content_description_object['copyright'] = substr($asf_header_data, $offset, $info_asf_content_description_object['copyright_length']); + $offset += $info_asf_content_description_object['copyright_length']; + + $info_asf_content_description_object['description'] = substr($asf_header_data, $offset, $info_asf_content_description_object['description_length']); + $offset += $info_asf_content_description_object['description_length']; + + $info_asf_content_description_object['rating'] = substr($asf_header_data, $offset, $info_asf_content_description_object['rating_length']); + $offset += $info_asf_content_description_object['rating_length']; + + foreach (array ('title'=>'title', 'author'=>'artist', 'copyright'=>'copyright', 'description'=>'comment', 'rating'=>'rating') as $key_to_copy_from => $key_to_copy_to) { + if (!empty($info_asf_content_description_object[$key_to_copy_from])) { + $info_asf_comments[$key_to_copy_to][] = getid3_asf::TrimTerm($info_asf_content_description_object[$key_to_copy_from]); + } + } + break; + + + case getid3_asf::Extended_Content_Description_Object: + + // Extended Content Description Object: (optional, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Extended Content Description object - getid3_asf::Extended_Content_Description_Object + // Object Size QWORD 64 // size of ExtendedContent Description object, including 26 bytes of Extended Content Description Object header + // Content Descriptors Count WORD 16 // number of entries in Content Descriptors list + // Content Descriptors array of: variable // + // * Descriptor Name Length WORD 16 // size in bytes of Descriptor Name field + // * Descriptor Name WCHAR variable // array of Unicode characters - Descriptor Name + // * Descriptor Value Data Type WORD 16 // Lookup array: + // 0x0000 = Unicode String (variable length) + // 0x0001 = BYTE array (variable length) + // 0x0002 = BOOL (DWORD, 32 bits) + // 0x0003 = DWORD (DWORD, 32 bits) + // 0x0004 = QWORD (QWORD, 64 bits) + // 0x0005 = WORD (WORD, 16 bits) + // * Descriptor Value Length WORD 16 // number of bytes stored in Descriptor Value field + // * Descriptor Value variable variable // value for Content Descriptor + + $info_asf['extended_content_description_object'] = array (); + $info_asf_extended_content_description_object = &$info_asf['extended_content_description_object']; + + $info_asf_extended_content_description_object['objectid_guid'] = $next_object_guidtext; + $info_asf_extended_content_description_object['objectsize'] = $next_object_size; + $info_asf_extended_content_description_object['content_descriptors_count'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + + for ($extended_content_descriptors_counter = 0; $extended_content_descriptors_counter < $info_asf_extended_content_description_object['content_descriptors_count']; $extended_content_descriptors_counter++) { + + $info_asf_extended_content_description_object['content_descriptors'][$extended_content_descriptors_counter] = array (); + $info_asf_extended_content_description_object_content_descriptor_current = &$info_asf_extended_content_description_object['content_descriptors'][$extended_content_descriptors_counter]; + + $info_asf_extended_content_description_object_content_descriptor_current['base_offset'] = $offset + 30; + $info_asf_extended_content_description_object_content_descriptor_current['name_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + + $info_asf_extended_content_description_object_content_descriptor_current['name'] = substr($asf_header_data, $offset, $info_asf_extended_content_description_object_content_descriptor_current['name_length']); + $offset += $info_asf_extended_content_description_object_content_descriptor_current['name_length']; + + $info_asf_extended_content_description_object_content_descriptor_current['value_type'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + + $info_asf_extended_content_description_object_content_descriptor_current['value_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + + $info_asf_extended_content_description_object_content_descriptor_current['value'] = substr($asf_header_data, $offset, $info_asf_extended_content_description_object_content_descriptor_current['value_length']); + $offset += $info_asf_extended_content_description_object_content_descriptor_current['value_length']; + + switch ($info_asf_extended_content_description_object_content_descriptor_current['value_type']) { + + case 0x0000: // Unicode string + break; + + case 0x0001: // BYTE array + // do nothing + break; + + case 0x0002: // BOOL + $info_asf_extended_content_description_object_content_descriptor_current['value'] = (bool)getid3_lib::LittleEndian2Int($info_asf_extended_content_description_object_content_descriptor_current['value']); + break; + + case 0x0003: // DWORD + case 0x0004: // QWORD + case 0x0005: // WORD + $info_asf_extended_content_description_object_content_descriptor_current['value'] = getid3_lib::LittleEndian2Int($info_asf_extended_content_description_object_content_descriptor_current['value']); + break; + + default: + $getid3->warning('extended_content_description.content_descriptors.'.$extended_content_descriptors_counter.'.value_type is invalid ('.$info_asf_extended_content_description_object_content_descriptor_current['value_type'].')'); + break; + } + + switch ($this->TrimConvert(strtolower($info_asf_extended_content_description_object_content_descriptor_current['name']))) { + + case 'wm/albumartist': + case 'artist': + $info_asf_comments['artist'] = array (getid3_asf::TrimTerm($info_asf_extended_content_description_object_content_descriptor_current['value'])); + break; + + + case 'wm/albumtitle': + case 'album': + $info_asf_comments['album'] = array (getid3_asf::TrimTerm($info_asf_extended_content_description_object_content_descriptor_current['value'])); + break; + + + case 'wm/genre': + case 'genre': + $genre = getid3_asf::TrimTerm($info_asf_extended_content_description_object_content_descriptor_current['value']); + $info_asf_comments['genre'] = array ($genre); + break; + + + case 'wm/tracknumber': + case 'tracknumber': + $info_asf_comments['track'] = array (intval(getid3_asf::TrimTerm($info_asf_extended_content_description_object_content_descriptor_current['value']))); + break; + + + case 'wm/track': + if (empty($info_asf_comments['track'])) { + $info_asf_comments['track'] = array (1 + $this->TrimConvert($info_asf_extended_content_description_object_content_descriptor_current['value'])); + } + break; + + + case 'wm/year': + case 'year': + case 'date': + $info_asf_comments['year'] = array ( getid3_asf::TrimTerm($info_asf_extended_content_description_object_content_descriptor_current['value'])); + break; + + + case 'wm/lyrics': + case 'lyrics': + $info_asf_comments['lyrics'] = array ( getid3_asf::TrimTerm($info_asf_extended_content_description_object_content_descriptor_current['value'])); + break; + + + case 'isvbr': + if ($info_asf_extended_content_description_object_content_descriptor_current['value']) { + $info_audio['bitrate_mode'] = 'vbr'; + $info_video['bitrate_mode'] = 'vbr'; + } + break; + + + case 'id3': + + // id3v2 parsing might not be enabled + if (class_exists('getid3_id3v2')) { + + // Clone getid3 + $clone = clone $getid3; + + // Analyse clone by string + $id3v2 = new getid3_id3v2($clone); + $id3v2->AnalyzeString($info_asf_extended_content_description_object_content_descriptor_current['value']); + + // Import from clone and destroy + $getid3->info['id3v2'] = $clone->info['id3v2']; + $getid3->warnings($clone->warnings()); + unset($clone); + } + break; + + + case 'wm/encodingtime': + $info_asf_extended_content_description_object_content_descriptor_current['encoding_time_unix'] = getid3_asf::FiletimeToUNIXtime($info_asf_extended_content_description_object_content_descriptor_current['value']); + $info_asf_comments['encoding_time_unix'] = array ($info_asf_extended_content_description_object_content_descriptor_current['encoding_time_unix']); + break; + + + case 'wm/picture': + + //typedef struct _WMPicture{ + // LPWSTR pwszMIMEType; + // BYTE bPictureType; + // LPWSTR pwszDescription; + // DWORD dwDataLen; + // BYTE* pbData; + //} WM_PICTURE; + + $info_asf_extended_content_description_object_content_descriptor_current['image_type_id'] = getid3_lib::LittleEndian2Int($info_asf_extended_content_description_object_content_descriptor_current['value']{0}); + $info_asf_extended_content_description_object_content_descriptor_current['image_type'] = getid3_asf::WMpictureTypeLookup($info_asf_extended_content_description_object_content_descriptor_current['image_type_id']); + $info_asf_extended_content_description_object_content_descriptor_current['image_size'] = getid3_lib::LittleEndian2Int(substr($info_asf_extended_content_description_object_content_descriptor_current['value'], 1, 4)); + $info_asf_extended_content_description_object_content_descriptor_current['image_mime'] = ''; + + $wm_picture_offset = 5; + + do { + $next_byte_pair = substr($info_asf_extended_content_description_object_content_descriptor_current['value'], $wm_picture_offset, 2); + $wm_picture_offset += 2; + $info_asf_extended_content_description_object_content_descriptor_current['image_mime'] .= $next_byte_pair; + } while ($next_byte_pair !== "\x00\x00"); + + $info_asf_extended_content_description_object_content_descriptor_current['image_description'] = ''; + + do { + $next_byte_pair = substr($info_asf_extended_content_description_object_content_descriptor_current['value'], $wm_picture_offset, 2); + $wm_picture_offset += 2; + $info_asf_extended_content_description_object_content_descriptor_current['image_description'] .= $next_byte_pair; + } while ($next_byte_pair !== "\x00\x00"); + + $info_asf_extended_content_description_object_content_descriptor_current['dataoffset'] = $wm_picture_offset; + $info_asf_extended_content_description_object_content_descriptor_current['data'] = substr($info_asf_extended_content_description_object_content_descriptor_current['value'], $wm_picture_offset); + unset($info_asf_extended_content_description_object_content_descriptor_current['value']); + break; + + default: + switch ($info_asf_extended_content_description_object_content_descriptor_current['value_type']) { + case 0: // Unicode string + if (substr($this->TrimConvert($info_asf_extended_content_description_object_content_descriptor_current['name']), 0, 3) == 'WM/') { + $info_asf_comments[str_replace('wm/', '', strtolower($this->TrimConvert($info_asf_extended_content_description_object_content_descriptor_current['name'])))] = array (getid3_asf::TrimTerm($info_asf_extended_content_description_object_content_descriptor_current['value'])); + } + break; + + case 1: + break; + } + break; + } + + } + break; + + + case getid3_asf::Stream_Bitrate_Properties_Object: + + // Stream Bitrate Properties Object: (optional, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Stream Bitrate Properties object - getid3_asf::Stream_Bitrate_Properties_Object + // Object Size QWORD 64 // size of Extended Content Description object, including 26 bytes of Stream Bitrate Properties Object header + // Bitrate Records Count WORD 16 // number of records in Bitrate Records + // Bitrate Records array of: variable // + // * Flags WORD 16 // + // * * Stream Number bits 7 (0x007F) // number of this stream + // * * Reserved bits 9 (0xFF80) // hardcoded: 0 + // * Average Bitrate DWORD 32 // in bits per second + + // shortcut + $info_asf['stream_bitrate_properties_object'] = array (); + $info_asf_stream_bitrate_properties_object = &$info_asf['stream_bitrate_properties_object']; + + $info_asf_stream_bitrate_properties_object['objectid_guid'] = $next_object_guidtext; + $info_asf_stream_bitrate_properties_object['objectsize'] = $next_object_size; + $info_asf_stream_bitrate_properties_object['bitrate_records_count'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + + for ($bitrate_records_counter = 0; $bitrate_records_counter < $info_asf_stream_bitrate_properties_object['bitrate_records_count']; $bitrate_records_counter++) { + + $info_asf_stream_bitrate_properties_object['bitrate_records'][$bitrate_records_counter]['flags_raw'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + + $info_asf_stream_bitrate_properties_object['bitrate_records'][$bitrate_records_counter]['flags']['stream_number'] = $info_asf_stream_bitrate_properties_object['bitrate_records'][$bitrate_records_counter]['flags_raw'] & 0x007F; + + $info_asf_stream_bitrate_properties_object['bitrate_records'][$bitrate_records_counter]['bitrate'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 4)); + $offset += 4; + } + break; + + + case getid3_asf::Padding_Object: + + // Padding Object: (optional) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Padding object - getid3_asf::Padding_Object + // Object Size QWORD 64 // size of Padding object, including 24 bytes of ASF Padding Object header + // Padding Data BYTESTREAM variable // ignore + + // shortcut + $info_asf['padding_object'] = array (); + $info_asf_paddingobject = &$info_asf['padding_object']; + + $info_asf_paddingobject['objectid_guid'] = $next_object_guidtext; + $info_asf_paddingobject['objectsize'] = $next_object_size; + $info_asf_paddingobject['padding_length'] = $info_asf_paddingobject['objectsize'] - 16 - 8; + $info_asf_paddingobject['padding'] = substr($asf_header_data, $offset, $info_asf_paddingobject['padding_length']); + $offset += ($next_object_size - 16 - 8); + break; + + + case getid3_asf::Extended_Content_Encryption_Object: + case getid3_asf::Content_Encryption_Object: + + // WMA DRM - just ignore + $offset += ($next_object_size - 16 - 8); + break; + + + default: + + // Implementations shall ignore any standard or non-standard object that they do not know how to handle. + if (getid3_asf::GUIDname($next_object_guidtext)) { + $getid3->warning('unhandled GUID "'.getid3_asf::GUIDname($next_object_guidtext).'" {'.$next_object_guidtext.'} in ASF header at offset '.($offset - 16 - 8)); + } else { + $getid3->warning('unknown GUID {'.$next_object_guidtext.'} in ASF header at offset '.($offset - 16 - 8)); + } + $offset += ($next_object_size - 16 - 8); + break; + } + } + + if (isset($info_asf_stream_bitrate_properties['bitrate_records_count'])) { + $asf_bitrate_audio = 0; + $asf_bitrate_video = 0; + + for ($bitrate_records_counter = 0; $bitrate_records_counter < $info_asf_stream_bitrate_properties['bitrate_records_count']; $bitrate_records_counter++) { + if (isset($info_asf_codec_list_object['codec_entries'][$bitrate_records_counter])) { + switch ($info_asf_codec_list_object['codec_entries'][$bitrate_records_counter]['type_raw']) { + + case 1: + $asf_bitrate_video += $info_asf_stream_bitrate_properties['bitrate_records'][$bitrate_records_counter]['bitrate']; + break; + + case 2: + $asf_bitrate_audio += $info_asf_stream_bitrate_properties['bitrate_records'][$bitrate_records_counter]['bitrate']; + break; + } + } + } + if ($asf_bitrate_audio > 0) { + $info_audio['bitrate'] = $asf_bitrate_audio; + } + if ($asf_bitrate_video > 0) { + $info_video['bitrate'] = $asf_bitrate_video; + } + } + + if (isset($info_asf['stream_properties_object']) && is_array($info_asf['stream_properties_object'])) { + + $info_audio['bitrate'] = 0; + $info_video['bitrate'] = 0; + + foreach ($info_asf['stream_properties_object'] as $stream_number => $stream_data) { + + switch ($stream_data['stream_type_guid']) { + + case getid3_asf::Audio_Media: + + // Field Name Field Type Size (bits) + // Codec ID / Format Tag WORD 16 // unique ID of audio codec - defined as wFormatTag field of WAVEFORMATEX structure + // Number of Channels WORD 16 // number of channels of audio - defined as nChannels field of WAVEFORMATEX structure + // Samples Per Second DWORD 32 // in Hertz - defined as nSamplesPerSec field of WAVEFORMATEX structure + // Average number of Bytes/sec DWORD 32 // bytes/sec of audio stream - defined as nAvgBytesPerSec field of WAVEFORMATEX structure + // Block Alignment WORD 16 // block size in bytes of audio codec - defined as nBlockAlign field of WAVEFORMATEX structure + // Bits per sample WORD 16 // bits per sample of mono data. set to zero for variable bitrate codecs. defined as wBitsPerSample field of WAVEFORMATEX structure + // Codec Specific Data Size WORD 16 // size in bytes of Codec Specific Data buffer - defined as cbSize field of WAVEFORMATEX structure + // Codec Specific Data BYTESTREAM variable // array of codec-specific data bytes + + // shortcut + $info_asf['audio_media'][$stream_number] = array (); + $info_asf_audio_media_current_stream = &$info_asf['audio_media'][$stream_number]; + + $audio_media_offset = 0; + + $info_asf_audio_media_current_stream = getid3_riff::RIFFparseWAVEFORMATex(substr($stream_data['type_specific_data'], $audio_media_offset, 16)); + + $audio_media_offset += 16; + + $info_audio['lossless'] = false; + switch ($info_asf_audio_media_current_stream['raw']['wFormatTag']) { + case 0x0001: // PCM + case 0x0163: // WMA9 Lossless + $info_audio['lossless'] = true; + break; + } + + if (!empty($info_asf['stream_bitrate_properties_object']['bitrate_records'])) { + foreach ($info_asf['stream_bitrate_properties_object']['bitrate_records'] as $data_array) { + if (@$data_array['flags']['stream_number'] == $stream_number) { + $info_asf_audio_media_current_stream['bitrate'] = $data_array['bitrate']; + $info_audio['bitrate'] += $data_array['bitrate']; + break; + } + } + } else { + if (@$info_asf_audio_media_current_stream['bytes_sec']) { + $info_audio['bitrate'] += $info_asf_audio_media_current_stream['bytes_sec'] * 8; + } elseif (@$info_asf_audio_media_current_stream['bitrate']) { + $info_audio['bitrate'] += $info_asf_audio_media_current_stream['bitrate']; + } + } + + $info_audio['streams'][$stream_number] = $info_asf_audio_media_current_stream; + $info_audio['streams'][$stream_number]['wformattag'] = $info_asf_audio_media_current_stream['raw']['wFormatTag']; + $info_audio['streams'][$stream_number]['lossless'] = $info_audio['lossless']; + $info_audio['streams'][$stream_number]['bitrate'] = $info_audio['bitrate']; + unset($info_audio['streams'][$stream_number]['raw']); + + $info_asf_audio_media_current_stream['codec_data_size'] = getid3_lib::LittleEndian2Int(substr($stream_data['type_specific_data'], $audio_media_offset, 2)); + $audio_media_offset += 2; + + $info_asf_audio_media_current_stream['codec_data'] = substr($stream_data['type_specific_data'], $audio_media_offset, $info_asf_audio_media_current_stream['codec_data_size']); + $audio_media_offset += $info_asf_audio_media_current_stream['codec_data_size']; + break; + + + case getid3_asf::Video_Media: + + // Field Name Field Type Size (bits) + // Encoded Image Width DWORD 32 // width of image in pixels + // Encoded Image Height DWORD 32 // height of image in pixels + // Reserved Flags BYTE 8 // hardcoded: 0x02 + // Format Data Size WORD 16 // size of Format Data field in bytes + // Format Data array of: variable // + // * Format Data Size DWORD 32 // number of bytes in Format Data field, in bytes - defined as biSize field of BITMAPINFOHEADER structure + // * Image Width LONG 32 // width of encoded image in pixels - defined as biWidth field of BITMAPINFOHEADER structure + // * Image Height LONG 32 // height of encoded image in pixels - defined as biHeight field of BITMAPINFOHEADER structure + // * Reserved WORD 16 // hardcoded: 0x0001 - defined as biPlanes field of BITMAPINFOHEADER structure + // * Bits Per Pixel Count WORD 16 // bits per pixel - defined as biBitCount field of BITMAPINFOHEADER structure + // * Compression ID FOURCC 32 // fourcc of video codec - defined as biCompression field of BITMAPINFOHEADER structure + // * Image Size DWORD 32 // image size in bytes - defined as biSizeImage field of BITMAPINFOHEADER structure + // * Horizontal Pixels / Meter DWORD 32 // horizontal resolution of target device in pixels per meter - defined as biXPelsPerMeter field of BITMAPINFOHEADER structure + // * Vertical Pixels / Meter DWORD 32 // vertical resolution of target device in pixels per meter - defined as biYPelsPerMeter field of BITMAPINFOHEADER structure + // * Colors Used Count DWORD 32 // number of color indexes in the color table that are actually used - defined as biClrUsed field of BITMAPINFOHEADER structure + // * Important Colors Count DWORD 32 // number of color index required for displaying bitmap. if zero, all colors are required. defined as biClrImportant field of BITMAPINFOHEADER structure + // * Codec Specific Data BYTESTREAM variable // array of codec-specific data bytes + + $info_asf['video_media'][$stream_number] = array (); + $info_asf_video_media_current_stream = &$info_asf['video_media'][$stream_number]; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_asf_video_media_current_stream, $stream_data['type_specific_data'], 0, + array ( + 'image_width' => 4, + 'image_height' => 4, + 'flags' => 1, + 'format_data_size'=> 2 + ) + ); + + getid3_lib::ReadSequence('LittleEndian2Int', $info_asf_video_media_current_stream['format_data'], $stream_data['type_specific_data'], 11, + array ( + 'format_data_size' => 4, + 'image_width' => 4, + 'image_height' => 4, + 'reserved' => 2, + 'bits_per_pixel' => 2, + 'codec_fourcc' => -4, + 'image_size' => 4, + 'horizontal_pels' => 4, + 'vertical_pels' => 4, + 'colors_used' => 4, + 'colors_important' => 4 + ) + ); + + $info_asf_video_media_current_stream['format_data']['codec_data'] = substr($stream_data['type_specific_data'], 51); + + if (!empty($info_asf['stream_bitrate_properties_object']['bitrate_records'])) { + foreach ($info_asf['stream_bitrate_properties_object']['bitrate_records'] as $data_array) { + if (@$data_array['flags']['stream_number'] == $stream_number) { + $info_asf_video_media_current_stream['bitrate'] = $data_array['bitrate']; + $info_video['streams'][$stream_number]['bitrate'] = $data_array['bitrate']; + $info_video['bitrate'] += $data_array['bitrate']; + + break; + } + } + } + + $info_asf_video_media_current_stream['format_data']['codec'] = getid3_riff::RIFFfourccLookup($info_asf_video_media_current_stream['format_data']['codec_fourcc']); + + $info_video['streams'][$stream_number]['fourcc'] = $info_asf_video_media_current_stream['format_data']['codec_fourcc']; + $info_video['streams'][$stream_number]['codec'] = $info_asf_video_media_current_stream['format_data']['codec']; + $info_video['streams'][$stream_number]['resolution_x'] = $info_asf_video_media_current_stream['image_width']; + $info_video['streams'][$stream_number]['resolution_y'] = $info_asf_video_media_current_stream['image_height']; + $info_video['streams'][$stream_number]['bits_per_sample'] = $info_asf_video_media_current_stream['format_data']['bits_per_pixel']; + break; + + default: + break; + } + } + } + + while (ftell($getid3->fp) < $getid3->info['avdataend']) { + + $next_object_data_header = fread($getid3->fp, 24); + $offset = 0; + + $next_object_guid = substr($next_object_data_header, 0, 16); + $offset += 16; + + $next_object_guidtext = getid3_asf::BytestringToGUID($next_object_guid); + $next_object_size = getid3_lib::LittleEndian2Int(substr($next_object_data_header, $offset, 8)); + $offset += 8; + + switch ($next_object_guidtext) { + + case getid3_asf::Data_Object: + + // Data Object: (mandatory, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Data object - getid3_asf::Data_Object + // Object Size QWORD 64 // size of Data object, including 50 bytes of Data Object header. may be 0 if FilePropertiesObject.BroadcastFlag == 1 + // File ID GUID 128 // unique identifier. identical to File ID field in Header Object + // Total Data Packets QWORD 64 // number of Data Packet entries in Data Object. invalid if FilePropertiesObject.BroadcastFlag == 1 + // Reserved WORD 16 // hardcoded: 0x0101 + + // shortcut + $info_asf['data_object'] = array (); + $info_asf_data_object = &$info_asf['data_object']; + + $data_object_data = $next_object_data_header.fread($getid3->fp, 50 - 24); + $offset = 24; + + $info_asf_data_object['objectid_guid'] = $next_object_guidtext; + $info_asf_data_object['objectsize'] = $next_object_size; + + $info_asf_data_object['fileid_guid'] = getid3_asf::BytestringToGUID(substr($data_object_data, $offset, 16)); + $offset += 16; + + $info_asf_data_object['total_data_packets'] = getid3_lib::LittleEndian2Int(substr($data_object_data, $offset, 8)); + $offset += 8; + + $info_asf_data_object['reserved'] = getid3_lib::LittleEndian2Int(substr($data_object_data, $offset, 2)); + $offset += 2; + + if ($info_asf_data_object['reserved'] != 0x0101) { + $getid3->warning('data_object.reserved ('.getid3_lib::PrintHexBytes($info_asf_data_object['reserved']).') does not match expected value of "0x0101"'); + break; + } + + // Data Packets array of: variable // + // * Error Correction Flags BYTE 8 // + // * * Error Correction Data Length bits 4 // if Error Correction Length Type == 00, size of Error Correction Data in bytes, else hardcoded: 0000 + // * * Opaque Data Present bits 1 // + // * * Error Correction Length Type bits 2 // number of bits for size of the error correction data. hardcoded: 00 + // * * Error Correction Present bits 1 // If set, use Opaque Data Packet structure, else use Payload structure + // * Error Correction Data + + $getid3->info['avdataoffset'] = ftell($getid3->fp); + fseek($getid3->fp, ($info_asf_data_object['objectsize'] - 50), SEEK_CUR); // skip actual audio/video data + $getid3->info['avdataend'] = ftell($getid3->fp); + break; + + + case getid3_asf::Simple_Index_Object: + + // Simple Index Object: (optional, recommended, one per video stream) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Simple Index object - getid3_asf::Data_Object + // Object Size QWORD 64 // size of Simple Index object, including 56 bytes of Simple Index Object header + // File ID GUID 128 // unique identifier. may be zero or identical to File ID field in Data Object and Header Object + // Index Entry Time Interval QWORD 64 // interval between index entries in 100-nanosecond units + // Maximum Packet Count DWORD 32 // maximum packet count for all index entries + // Index Entries Count DWORD 32 // number of Index Entries structures + // Index Entries array of: variable // + // * Packet Number DWORD 32 // number of the Data Packet associated with this index entry + // * Packet Count WORD 16 // number of Data Packets to sent at this index entry + + // shortcut + $info_asf['simple_index_object'] = array (); + $info_asf_simple_index_object = &$info_asf['simple_index_object']; + + $info_asf_simple_index_object['objectid_guid'] = $next_object_guidtext; + $info_asf_simple_index_object['objectsize'] = $next_object_size; + + $simple_index_object_data = $next_object_data_header.fread($getid3->fp, 56 - 24); + + $info_asf_simple_index_object['fileid_guid'] = getid3_asf::BytestringToGUID(substr($simple_index_object_data, 24, 16)); + + getid3_lib::ReadSequence('LittleEndian2Int', $info_asf_simple_index_object, $simple_index_object_data, 40, + array ( + 'index_entry_time_interval' => 8, + 'maximum_packet_count' => 4, + 'index_entries_count' => 4 + ) + ); + + $offset = 56; + + $index_entries_data = $simple_index_object_data.fread($getid3->fp, 6 * $info_asf_simple_index_object['index_entries_count']); + for ($index_entries_counter = 0; $index_entries_counter < $info_asf_simple_index_object['index_entries_count']; $index_entries_counter++) { + + $info_asf_simple_index_object['index_entries'][$index_entries_counter]['packet_number'] = getid3_lib::LittleEndian2Int(substr($index_entries_data, $offset, 4)); + $offset += 4; + + $info_asf_simple_index_object['index_entries'][$index_entries_counter]['packet_count'] = getid3_lib::LittleEndian2Int(substr($index_entries_data, $offset, 4)); + $offset += 2; + } + break; + + + case getid3_asf::Index_Object: + + // 6.2 ASF top-level Index Object (optional but recommended when appropriate, 0 or 1) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for the Index Object - getid3_asf::Index_Object + // Object Size QWORD 64 // Specifies the size, in bytes, of the Index Object, including at least 34 bytes of Index Object header + // Index Entry Time Interval DWORD 32 // Specifies the time interval between each index entry in ms. + // Index Specifiers Count WORD 16 // Specifies the number of Index Specifiers structures in this Index Object. + // Index Blocks Count DWORD 32 // Specifies the number of Index Blocks structures in this Index Object. + + // Index Entry Time Interval DWORD 32 // Specifies the time interval between index entries in milliseconds. This value cannot be 0. + // Index Specifiers Count WORD 16 // Specifies the number of entries in the Index Specifiers list. Valid values are 1 and greater. + // Index Specifiers array of: varies // + // * Stream Number WORD 16 // Specifies the stream number that the Index Specifiers refer to. Valid values are between 1 and 127. + // * Index Type WORD 16 // Specifies Index Type values as follows: + // 1 = Nearest Past Data Packet - indexes point to the data packet whose presentation time is closest to the index entry time. + // 2 = Nearest Past Media Object - indexes point to the closest data packet containing an entire object or first fragment of an object. + // 3 = Nearest Past Cleanpoint. - indexes point to the closest data packet containing an entire object (or first fragment of an object) that has the Cleanpoint Flag set. + // Nearest Past Cleanpoint is the most common type of index. + // Index Entry Count DWORD 32 // Specifies the number of Index Entries in the block. + // * Block Positions QWORD varies // Specifies a list of byte offsets of the beginnings of the blocks relative to the beginning of the first Data Packet (i.e., the beginning of the Data Object + 50 bytes). The number of entries in this list is specified by the value of the Index Specifiers Count field. The order of those byte offsets is tied to the order in which Index Specifiers are listed. + // * Index Entries array of: varies // + // * * Offsets DWORD varies // An offset value of 0xffffffff indicates an invalid offset value + + // shortcut + $info_asf['asf_index_object'] = array (); + $info_asf_asf_index_object = &$info_asf['asf_index_object']; + + $asf_index_object_data = $next_object_data_header.fread($getid3->fp, 34 - 24); + + $info_asf_asf_index_object['objectid_guid'] = $next_object_guidtext; + $info_asf_asf_index_object['objectsize'] = $next_object_size; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_asf_asf_index_object, $asf_index_object_data, 24, + array ( + 'entry_time_interval' =>4, + 'index_specifiers_count' =>2, + 'index_blocks_count' =>4 + ) + ); + + $offset = 34; + + $asf_index_object_data .= fread($getid3->fp, 4 * $info_asf_asf_index_object['index_specifiers_count']); + + for ($index_specifiers_counter = 0; $index_specifiers_counter < $info_asf_asf_index_object['index_specifiers_count']; $index_specifiers_counter++) { + + $index_specifier_stream_number = getid3_lib::LittleEndian2Int(substr($asf_index_object_data, $offset, 2)); + $offset += 2; + + $info_asf_asf_index_object['index_specifiers'][$index_specifiers_counter]['stream_number'] = $index_specifier_stream_number; + + $info_asf_asf_index_object['index_specifiers'][$index_specifiers_counter]['index_type'] = getid3_lib::LittleEndian2Int(substr($asf_index_object_data, $offset, 2)); + $offset += 2; + + $info_asf_asf_index_object['index_specifiers'][$index_specifiers_counter]['index_type_text'] = getid3_asf::ASFIndexObjectIndexTypeLookup($info_asf_asf_index_object['index_specifiers'][$index_specifiers_counter]['index_type']); + } + + $asf_index_object_data .= fread($getid3->fp, 4); + $info_asf_asf_index_object['index_entry_count'] = getid3_lib::LittleEndian2Int(substr($asf_index_object_data, $offset, 4)); + $offset += 4; + + $asf_index_object_data .= fread($getid3->fp, 8 * $info_asf_asf_index_object['index_specifiers_count']); + + for ($index_specifiers_counter = 0; $index_specifiers_counter < $info_asf_asf_index_object['index_specifiers_count']; $index_specifiers_counter++) { + $info_asf_asf_index_object['block_positions'][$index_specifiers_counter] = getid3_lib::LittleEndian2Int(substr($asf_index_object_data, $offset, 8)); + $offset += 8; + } + + $asf_index_object_data .= fread($getid3->fp, 4 * $info_asf_asf_index_object['index_specifiers_count'] * $info_asf_asf_index_object['index_entry_count']); + + for ($index_entry_counter = 0; $index_entry_counter < $info_asf_asf_index_object['index_entry_count']; $index_entry_counter++) { + for ($index_specifiers_counter = 0; $index_specifiers_counter < $info_asf_asf_index_object['index_specifiers_count']; $index_specifiers_counter++) { + $info_asf_asf_index_object['offsets'][$index_specifiers_counter][$index_entry_counter] = getid3_lib::LittleEndian2Int(substr($asf_index_object_data, $offset, 4)); + $offset += 4; + } + } + break; + + + default: + + // Implementations shall ignore any standard or non-standard object that they do not know how to handle. + if (getid3_asf::GUIDname($next_object_guidtext)) { + $getid3->warning('unhandled GUID "'.getid3_asf::GUIDname($next_object_guidtext).'" {'.$next_object_guidtext.'} in ASF body at offset '.($offset - 16 - 8)); + } else { + $getid3->warning('unknown GUID {'.$next_object_guidtext.'} in ASF body at offset '.(ftell($getid3->fp) - 16 - 8)); + } + fseek($getid3->fp, ($next_object_size - 16 - 8), SEEK_CUR); + break; + } + } + + if (isset($info_asf_codec_list_object['codec_entries']) && is_array($info_asf_codec_list_object['codec_entries'])) { + foreach ($info_asf_codec_list_object['codec_entries'] as $stream_number => $stream_data) { + switch ($stream_data['information']) { + case 'WMV1': + case 'WMV2': + case 'WMV3': + case 'MSS1': + case 'MSS2': + case 'WMVA': + case 'WVC1': + case 'WMVP': + case 'WVP2': + $info_video['dataformat'] = 'wmv'; + $getid3->info['mime_type'] = 'video/x-ms-wmv'; + break; + + case 'MP42': + case 'MP43': + case 'MP4S': + case 'mp4s': + $info_video['dataformat'] = 'asf'; + $getid3->info['mime_type'] = 'video/x-ms-asf'; + break; + + default: + switch ($stream_data['type_raw']) { + case 1: + if (strstr($this->TrimConvert($stream_data['name']), 'Windows Media')) { + $info_video['dataformat'] = 'wmv'; + if ($getid3->info['mime_type'] == 'video/x-ms-asf') { + $getid3->info['mime_type'] = 'video/x-ms-wmv'; + } + } + break; + + case 2: + if (strstr($this->TrimConvert($stream_data['name']), 'Windows Media')) { + $info_audio['dataformat'] = 'wma'; + if ($getid3->info['mime_type'] == 'video/x-ms-asf') { + $getid3->info['mime_type'] = 'audio/x-ms-wma'; + } + } + break; + + } + break; + } + } + } + + switch (@$info_audio['codec']) { + case 'MPEG Layer-3': + $info_audio['dataformat'] = 'mp3'; + break; + + default: + break; + } + + if (isset($info_asf_codec_list_object['codec_entries'])) { + foreach ($info_asf_codec_list_object['codec_entries'] as $stream_number => $stream_data) { + switch ($stream_data['type_raw']) { + + case 1: // video + $info_video['encoder'] = $this->TrimConvert($info_asf_codec_list_object['codec_entries'][$stream_number]['name']); + break; + + case 2: // audio + $info_audio['encoder'] = $this->TrimConvert($info_asf_codec_list_object['codec_entries'][$stream_number]['name']); + $info_audio['encoder_options'] = $this->TrimConvert($info_asf_codec_list_object['codec_entries'][0]['description']); + $info_audio['codec'] = $info_audio['encoder']; + break; + + default: + $getid3->warning('Unknown streamtype: [codec_list_object][codec_entries]['.$stream_number.'][type_raw] == '.$stream_data['type_raw']); + break; + + } + } + } + + if (isset($getid3->info['audio'])) { + $info_audio['lossless'] = (isset($info_audio['lossless']) ? $info_audio['lossless'] : false); + $info_audio['dataformat'] = (!empty($info_audio['dataformat']) ? $info_audio['dataformat'] : 'asf'); + } + + if (!empty($info_video['dataformat'])) { + $info_video['lossless'] = (isset($info_audio['lossless']) ? $info_audio['lossless'] : false); + $info_video['pixel_aspect_ratio'] = (isset($info_audio['pixel_aspect_ratio']) ? $info_audio['pixel_aspect_ratio'] : (float)1); + $info_video['dataformat'] = (!empty($info_video['dataformat']) ? $info_video['dataformat'] : 'asf'); + } + + $getid3->info['bitrate'] = @$info_audio['bitrate'] + @$info_video['bitrate']; + + if (empty($info_audio)) { + unset($getid3->info['audio']); + } + + if (empty($info_video)) { + unset($getid3->info['video']); + } + + return true; + } + + + + // Remove terminator 00 00 and convert UNICODE to Latin-1 + private function TrimConvert($string) { + + // remove terminator, only if present (it should be, but...) + if (substr($string, strlen($string) - 2, 2) == "\x00\x00") { + $string = substr($string, 0, strlen($string) - 2); + } + + // convert + return trim($this->getid3->iconv('UTF-16LE', 'ISO-8859-1', $string), ' '); + } + + + + private function WMpictureTypeLookup($wm_picture_type) { + + static $lookup = array ( + 0x03 => 'Front Cover', + 0x04 => 'Back Cover', + 0x00 => 'User Defined', + 0x05 => 'Leaflet Page', + 0x06 => 'Media Label', + 0x07 => 'Lead Artist', + 0x08 => 'Artist', + 0x09 => 'Conductor', + 0x0A => 'Band', + 0x0B => 'Composer', + 0x0C => 'Lyricist', + 0x0D => 'Recording Location', + 0x0E => 'During Recording', + 0x0F => 'During Performance', + 0x10 => 'Video Screen Capture', + 0x12 => 'Illustration', + 0x13 => 'Band Logotype', + 0x14 => 'Publisher Logotype' + ); + + return isset($lookup[$wm_picture_type]) ? $this->getid3->iconv('ISO-8859-1', 'UTF-16LE', $lookup[$wm_picture_type]) : ''; + } + + + + public static function ASFCodecListObjectTypeLookup($codec_list_type) { + + static $lookup = array ( + 0x0001 => 'Video Codec', + 0x0002 => 'Audio Codec', + 0xFFFF => 'Unknown Codec' + ); + + return (isset($lookup[$codec_list_type]) ? $lookup[$codec_list_type] : 'Invalid Codec Type'); + } + + + + public static function GUIDname($guid_string) { + + static $lookup = array ( + getid3_asf::Extended_Stream_Properties_Object => 'Extended_Stream_Properties_Object', + getid3_asf::Padding_Object => 'Padding_Object', + getid3_asf::Payload_Ext_Syst_Pixel_Aspect_Ratio => 'Payload_Ext_Syst_Pixel_Aspect_Ratio', + getid3_asf::Script_Command_Object => 'Script_Command_Object', + getid3_asf::No_Error_Correction => 'No_Error_Correction', + getid3_asf::Content_Branding_Object => 'Content_Branding_Object', + getid3_asf::Content_Encryption_Object => 'Content_Encryption_Object', + getid3_asf::Digital_Signature_Object => 'Digital_Signature_Object', + getid3_asf::Extended_Content_Encryption_Object => 'Extended_Content_Encryption_Object', + getid3_asf::Simple_Index_Object => 'Simple_Index_Object', + getid3_asf::Degradable_JPEG_Media => 'Degradable_JPEG_Media', + getid3_asf::Payload_Extension_System_Timecode => 'Payload_Extension_System_Timecode', + getid3_asf::Binary_Media => 'Binary_Media', + getid3_asf::Timecode_Index_Object => 'Timecode_Index_Object', + getid3_asf::Metadata_Library_Object => 'Metadata_Library_Object', + getid3_asf::Reserved_3 => 'Reserved_3', + getid3_asf::Reserved_4 => 'Reserved_4', + getid3_asf::Command_Media => 'Command_Media', + getid3_asf::Header_Extension_Object => 'Header_Extension_Object', + getid3_asf::Media_Object_Index_Parameters_Obj => 'Media_Object_Index_Parameters_Obj', + getid3_asf::Header_Object => 'Header_Object', + getid3_asf::Content_Description_Object => 'Content_Description_Object', + getid3_asf::Error_Correction_Object => 'Error_Correction_Object', + getid3_asf::Data_Object => 'Data_Object', + getid3_asf::Web_Stream_Media_Subtype => 'Web_Stream_Media_Subtype', + getid3_asf::Stream_Bitrate_Properties_Object => 'Stream_Bitrate_Properties_Object', + getid3_asf::Language_List_Object => 'Language_List_Object', + getid3_asf::Codec_List_Object => 'Codec_List_Object', + getid3_asf::Reserved_2 => 'Reserved_2', + getid3_asf::File_Properties_Object => 'File_Properties_Object', + getid3_asf::File_Transfer_Media => 'File_Transfer_Media', + getid3_asf::Old_RTP_Extension_Data => 'Old_RTP_Extension_Data', + getid3_asf::Advanced_Mutual_Exclusion_Object => 'Advanced_Mutual_Exclusion_Object', + getid3_asf::Bandwidth_Sharing_Object => 'Bandwidth_Sharing_Object', + getid3_asf::Reserved_1 => 'Reserved_1', + getid3_asf::Bandwidth_Sharing_Exclusive => 'Bandwidth_Sharing_Exclusive', + getid3_asf::Bandwidth_Sharing_Partial => 'Bandwidth_Sharing_Partial', + getid3_asf::JFIF_Media => 'JFIF_Media', + getid3_asf::Stream_Properties_Object => 'Stream_Properties_Object', + getid3_asf::Video_Media => 'Video_Media', + getid3_asf::Audio_Spread => 'Audio_Spread', + getid3_asf::Metadata_Object => 'Metadata_Object', + getid3_asf::Payload_Ext_Syst_Sample_Duration => 'Payload_Ext_Syst_Sample_Duration', + getid3_asf::Group_Mutual_Exclusion_Object => 'Group_Mutual_Exclusion_Object', + getid3_asf::Extended_Content_Description_Object => 'Extended_Content_Description_Object', + getid3_asf::Stream_Prioritization_Object => 'Stream_Prioritization_Object', + getid3_asf::Payload_Ext_System_Content_Type => 'Payload_Ext_System_Content_Type', + getid3_asf::Old_File_Properties_Object => 'Old_File_Properties_Object', + getid3_asf::Old_ASF_Header_Object => 'Old_ASF_Header_Object', + getid3_asf::Old_ASF_Data_Object => 'Old_ASF_Data_Object', + getid3_asf::Index_Object => 'Index_Object', + getid3_asf::Old_Stream_Properties_Object => 'Old_Stream_Properties_Object', + getid3_asf::Old_Content_Description_Object => 'Old_Content_Description_Object', + getid3_asf::Old_Script_Command_Object => 'Old_Script_Command_Object', + getid3_asf::Old_Marker_Object => 'Old_Marker_Object', + getid3_asf::Old_Component_Download_Object => 'Old_Component_Download_Object', + getid3_asf::Old_Stream_Group_Object => 'Old_Stream_Group_Object', + getid3_asf::Old_Scalable_Object => 'Old_Scalable_Object', + getid3_asf::Old_Prioritization_Object => 'Old_Prioritization_Object', + getid3_asf::Bitrate_Mutual_Exclusion_Object => 'Bitrate_Mutual_Exclusion_Object', + getid3_asf::Old_Inter_Media_Dependency_Object => 'Old_Inter_Media_Dependency_Object', + getid3_asf::Old_Rating_Object => 'Old_Rating_Object', + getid3_asf::Index_Parameters_Object => 'Index_Parameters_Object', + getid3_asf::Old_Color_Table_Object => 'Old_Color_Table_Object', + getid3_asf::Old_Language_List_Object => 'Old_Language_List_Object', + getid3_asf::Old_Audio_Media => 'Old_Audio_Media', + getid3_asf::Old_Video_Media => 'Old_Video_Media', + getid3_asf::Old_Image_Media => 'Old_Image_Media', + getid3_asf::Old_Timecode_Media => 'Old_Timecode_Media', + getid3_asf::Old_Text_Media => 'Old_Text_Media', + getid3_asf::Old_MIDI_Media => 'Old_MIDI_Media', + getid3_asf::Old_Command_Media => 'Old_Command_Media', + getid3_asf::Old_No_Error_Concealment => 'Old_No_Error_Concealment', + getid3_asf::Old_Scrambled_Audio => 'Old_Scrambled_Audio', + getid3_asf::Old_No_Color_Table => 'Old_No_Color_Table', + getid3_asf::Old_SMPTE_Time => 'Old_SMPTE_Time', + getid3_asf::Old_ASCII_Text => 'Old_ASCII_Text', + getid3_asf::Old_Unicode_Text => 'Old_Unicode_Text', + getid3_asf::Old_HTML_Text => 'Old_HTML_Text', + getid3_asf::Old_URL_Command => 'Old_URL_Command', + getid3_asf::Old_Filename_Command => 'Old_Filename_Command', + getid3_asf::Old_ACM_Codec => 'Old_ACM_Codec', + getid3_asf::Old_VCM_Codec => 'Old_VCM_Codec', + getid3_asf::Old_QuickTime_Codec => 'Old_QuickTime_Codec', + getid3_asf::Old_DirectShow_Transform_Filter => 'Old_DirectShow_Transform_Filter', + getid3_asf::Old_DirectShow_Rendering_Filter => 'Old_DirectShow_Rendering_Filter', + getid3_asf::Old_No_Enhancement => 'Old_No_Enhancement', + getid3_asf::Old_Unknown_Enhancement_Type => 'Old_Unknown_Enhancement_Type', + getid3_asf::Old_Temporal_Enhancement => 'Old_Temporal_Enhancement', + getid3_asf::Old_Spatial_Enhancement => 'Old_Spatial_Enhancement', + getid3_asf::Old_Quality_Enhancement => 'Old_Quality_Enhancement', + getid3_asf::Old_Number_of_Channels_Enhancement => 'Old_Number_of_Channels_Enhancement', + getid3_asf::Old_Frequency_Response_Enhancement => 'Old_Frequency_Response_Enhancement', + getid3_asf::Old_Media_Object => 'Old_Media_Object', + getid3_asf::Mutex_Language => 'Mutex_Language', + getid3_asf::Mutex_Bitrate => 'Mutex_Bitrate', + getid3_asf::Mutex_Unknown => 'Mutex_Unknown', + getid3_asf::Old_ASF_Placeholder_Object => 'Old_ASF_Placeholder_Object', + getid3_asf::Old_Data_Unit_Extension_Object => 'Old_Data_Unit_Extension_Object', + getid3_asf::Web_Stream_Format => 'Web_Stream_Format', + getid3_asf::Payload_Ext_System_File_Name => 'Payload_Ext_System_File_Name', + getid3_asf::Marker_Object => 'Marker_Object', + getid3_asf::Timecode_Index_Parameters_Object => 'Timecode_Index_Parameters_Object', + getid3_asf::Audio_Media => 'Audio_Media', + getid3_asf::Media_Object_Index_Object => 'Media_Object_Index_Object', + getid3_asf::Alt_Extended_Content_Encryption_Obj => 'Alt_Extended_Content_Encryption_Obj' + ); + + return @$lookup[$guid_string]; + } + + + + public static function ASFIndexObjectIndexTypeLookup($id) { + + static $lookup = array ( + 1 => 'Nearest Past Data Packet', + 2 => 'Nearest Past Media Object', + 3 => 'Nearest Past Cleanpoint' + ); + + return (isset($lookup[$id]) ? $lookup[$id] : 'invalid'); + } + + + + public static function GUIDtoBytestring($guid_string) { + + // Microsoft defines these 16-byte (128-bit) GUIDs in the strangest way: + // first 4 bytes are in little-endian order + // next 2 bytes are appended in little-endian order + // next 2 bytes are appended in little-endian order + // next 2 bytes are appended in big-endian order + // next 6 bytes are appended in big-endian order + + // AaBbCcDd-EeFf-GgHh-IiJj-KkLlMmNnOoPp is stored as this 16-byte string: + // $Dd $Cc $Bb $Aa $Ff $Ee $Hh $Gg $Ii $Jj $Kk $Ll $Mm $Nn $Oo $Pp + + $hex_byte_char_string = chr(hexdec(substr($guid_string, 6, 2))); + $hex_byte_char_string .= chr(hexdec(substr($guid_string, 4, 2))); + $hex_byte_char_string .= chr(hexdec(substr($guid_string, 2, 2))); + $hex_byte_char_string .= chr(hexdec(substr($guid_string, 0, 2))); + + $hex_byte_char_string .= chr(hexdec(substr($guid_string, 11, 2))); + $hex_byte_char_string .= chr(hexdec(substr($guid_string, 9, 2))); + + $hex_byte_char_string .= chr(hexdec(substr($guid_string, 16, 2))); + $hex_byte_char_string .= chr(hexdec(substr($guid_string, 14, 2))); + + $hex_byte_char_string .= chr(hexdec(substr($guid_string, 19, 2))); + $hex_byte_char_string .= chr(hexdec(substr($guid_string, 21, 2))); + + $hex_byte_char_string .= chr(hexdec(substr($guid_string, 24, 2))); + $hex_byte_char_string .= chr(hexdec(substr($guid_string, 26, 2))); + $hex_byte_char_string .= chr(hexdec(substr($guid_string, 28, 2))); + $hex_byte_char_string .= chr(hexdec(substr($guid_string, 30, 2))); + $hex_byte_char_string .= chr(hexdec(substr($guid_string, 32, 2))); + $hex_byte_char_string .= chr(hexdec(substr($guid_string, 34, 2))); + + return $hex_byte_char_string; + } + + + + public static function BytestringToGUID($byte_string) { + + $guid_string = str_pad(dechex(ord($byte_string{3})), 2, '0', STR_PAD_LEFT); + $guid_string .= str_pad(dechex(ord($byte_string{2})), 2, '0', STR_PAD_LEFT); + $guid_string .= str_pad(dechex(ord($byte_string{1})), 2, '0', STR_PAD_LEFT); + $guid_string .= str_pad(dechex(ord($byte_string{0})), 2, '0', STR_PAD_LEFT); + $guid_string .= '-'; + $guid_string .= str_pad(dechex(ord($byte_string{5})), 2, '0', STR_PAD_LEFT); + $guid_string .= str_pad(dechex(ord($byte_string{4})), 2, '0', STR_PAD_LEFT); + $guid_string .= '-'; + $guid_string .= str_pad(dechex(ord($byte_string{7})), 2, '0', STR_PAD_LEFT); + $guid_string .= str_pad(dechex(ord($byte_string{6})), 2, '0', STR_PAD_LEFT); + $guid_string .= '-'; + $guid_string .= str_pad(dechex(ord($byte_string{8})), 2, '0', STR_PAD_LEFT); + $guid_string .= str_pad(dechex(ord($byte_string{9})), 2, '0', STR_PAD_LEFT); + $guid_string .= '-'; + $guid_string .= str_pad(dechex(ord($byte_string{10})), 2, '0', STR_PAD_LEFT); + $guid_string .= str_pad(dechex(ord($byte_string{11})), 2, '0', STR_PAD_LEFT); + $guid_string .= str_pad(dechex(ord($byte_string{12})), 2, '0', STR_PAD_LEFT); + $guid_string .= str_pad(dechex(ord($byte_string{13})), 2, '0', STR_PAD_LEFT); + $guid_string .= str_pad(dechex(ord($byte_string{14})), 2, '0', STR_PAD_LEFT); + $guid_string .= str_pad(dechex(ord($byte_string{15})), 2, '0', STR_PAD_LEFT); + + return strtoupper($guid_string); + } + + + + public static function FiletimeToUNIXtime($file_time, $round=true) { + + // FILETIME is a 64-bit unsigned integer representing + // the number of 100-nanosecond intervals since January 1, 1601 + // UNIX timestamp is number of seconds since January 1, 1970 + // 116444736000000000 = 10000000 * 60 * 60 * 24 * 365 * 369 + 89 leap days + + $time = ($file_time - 116444736000000000) / 10000000; + + if ($round) { + return intval(round($time)); + } + + return $time; + } + + + + public static function TrimTerm($string) { + + // remove terminator, only if present (it should be, but...) + if (substr($string, -2) == "\x00\x00") { + $string = substr($string, 0, -2); + } + return $string; + } + + +} + + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.audio-video.flv.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.audio-video.flv.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,574 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.archive.gzip.php | +// | module for analyzing GZIP files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// | FLV module by Seth Kaufman | +// | | +// | * version 0.1 (26 June 2005) | +// | | +// | minor modifications by James Heinrich | +// | * version 0.1.1 (15 July 2005) | +// | | +// | Support for On2 VP6 codec and meta information by | +// | Steve Webster | +// | * version 0.2 (22 February 2006) | +// | | +// | Modified to not read entire file into memory | +// | by James Heinrich | +// | * version 0.3 (15 June 2006) | +// | | +// | Modifications by Allan Hansen | +// | Adapted module for PHP5 and getID3 2.0.0. | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio-video.flv.php,v 1.7 2006/11/10 11:20:12 ah Exp $ + + + +class getid3_flv extends getid3_handler +{ + + const TAG_AUDIO = 8; + const TAG_VIDEO = 9; + const TAG_META = 18; + + const VIDEO_H263 = 2; + const VIDEO_SCREEN = 3; + const VIDEO_VP6 = 4; + + + public function Analyze() + { + $info = &$this->getid3->info; + + $info['flv'] = array (); + $info_flv = &$info['flv']; + + fseek($this->getid3->fp, $info['avdataoffset'], SEEK_SET); + + $flv_data_length = $info['avdataend'] - $info['avdataoffset']; + $flv_header = fread($this->getid3->fp, 5); + + $info['fileformat'] = 'flv'; + $info_flv['header']['signature'] = substr($flv_header, 0, 3); + $info_flv['header']['version'] = getid3_lib::BigEndian2Int(substr($flv_header, 3, 1)); + $type_flags = getid3_lib::BigEndian2Int(substr($flv_header, 4, 1)); + + $info_flv['header']['hasAudio'] = (bool) ($type_flags & 0x04); + $info_flv['header']['hasVideo'] = (bool) ($type_flags & 0x01); + + $frame_size_data_length = getid3_lib::BigEndian2Int(fread($this->getid3->fp, 4)); + $flv_header_frame_length = 9; + if ($frame_size_data_length > $flv_header_frame_length) { + fseek($this->getid3->fp, $frame_size_data_length - $flv_header_frame_length, SEEK_CUR); + } + + $duration = 0; + while ((ftell($this->getid3->fp) + 1) < $info['avdataend']) { + + $this_tag_header = fread($this->getid3->fp, 16); + + $previous_tag_length = getid3_lib::BigEndian2Int(substr($this_tag_header, 0, 4)); + $tag_type = getid3_lib::BigEndian2Int(substr($this_tag_header, 4, 1)); + $data_length = getid3_lib::BigEndian2Int(substr($this_tag_header, 5, 3)); + $timestamp = getid3_lib::BigEndian2Int(substr($this_tag_header, 8, 3)); + $last_header_byte = getid3_lib::BigEndian2Int(substr($this_tag_header, 15, 1)); + $next_offset = ftell($this->getid3->fp) - 1 + $data_length; + + switch ($tag_type) { + + case getid3_flv::TAG_AUDIO: + if (!isset($info_flv['audio']['audioFormat'])) { + $info_flv['audio']['audioFormat'] = $last_header_byte & 0x07; + $info_flv['audio']['audioRate'] = ($last_header_byte & 0x30) / 0x10; + $info_flv['audio']['audioSampleSize'] = ($last_header_byte & 0x40) / 0x40; + $info_flv['audio']['audioType'] = ($last_header_byte & 0x80) / 0x80; + } + break; + + + case getid3_flv::TAG_VIDEO: + if (!isset($info_flv['video']['videoCodec'])) { + $info_flv['video']['videoCodec'] = $last_header_byte & 0x07; + + $flv_video_header = fread($this->getid3->fp, 11); + + if ($info_flv['video']['videoCodec'] != getid3_flv::VIDEO_VP6) { + + $picture_size_type = (getid3_lib::BigEndian2Int(substr($flv_video_header, 3, 2))) >> 7; + $picture_size_type = $picture_size_type & 0x0007; + $info_flv['header']['videoSizeType'] = $picture_size_type; + + switch ($picture_size_type) { + case 0: + $picture_size_enc = getid3_lib::BigEndian2Int(substr($flv_video_header, 5, 2)); + $picture_size_enc <<= 1; + $info['video']['resolution_x'] = ($picture_size_enc & 0xFF00) >> 8; + $picture_size_enc = getid3_lib::BigEndian2Int(substr($flv_video_header, 6, 2)); + $picture_size_enc <<= 1; + $info['video']['resolution_y'] = ($picture_size_enc & 0xFF00) >> 8; + break; + + case 1: + $picture_size_enc = getid3_lib::BigEndian2Int(substr($flv_video_header, 5, 4)); + $picture_size_enc <<= 1; + $info['video']['resolution_x'] = ($picture_size_enc & 0xFFFF0000) >> 16; + + $picture_size_enc = getid3_lib::BigEndian2Int(substr($flv_video_header, 7, 4)); + $picture_size_enc <<= 1; + $info['video']['resolution_y'] = ($picture_size_enc & 0xFFFF0000) >> 16; + break; + + case 2: + $info['video']['resolution_x'] = 352; + $info['video']['resolution_y'] = 288; + break; + + case 3: + $info['video']['resolution_x'] = 176; + $info['video']['resolution_y'] = 144; + break; + + case 4: + $info['video']['resolution_x'] = 128; + $info['video']['resolution_y'] = 96; + break; + + case 5: + $info['video']['resolution_x'] = 320; + $info['video']['resolution_y'] = 240; + break; + + case 6: + $info['video']['resolution_x'] = 160; + $info['video']['resolution_y'] = 120; + break; + + default: + $info['video']['resolution_x'] = 0; + $info['video']['resolution_y'] = 0; + break; + } + } + } + break; + + + // Meta tag + case getid3_flv::TAG_META: + + fseek($this->getid3->fp, -1, SEEK_CUR); + $reader = new AMFReader(new AMFStream(fread($this->getid3->fp, $data_length))); + $event_name = $reader->readData(); + $info['meta'][$event_name] = $reader->readData(); + unset($reader); + + $info['video']['frame_rate'] = @$info['meta']['onMetaData']['framerate']; + $info['video']['resolution_x'] = @$info['meta']['onMetaData']['width']; + $info['video']['resolution_y'] = @$info['meta']['onMetaData']['height']; + break; + + default: + // noop + break; + } + + if ($timestamp > $duration) { + $duration = $timestamp; + } + + fseek($this->getid3->fp, $next_offset, SEEK_SET); + } + + if ($info['playtime_seconds'] = $duration / 1000) { + $info['bitrate'] = ($info['avdataend'] - $info['avdataoffset']) / $info['playtime_seconds']; + } + + if ($info_flv['header']['hasAudio']) { + $info['audio']['codec'] = $this->FLVaudioFormat($info_flv['audio']['audioFormat']); + $info['audio']['sample_rate'] = $this->FLVaudioRate($info_flv['audio']['audioRate']); + $info['audio']['bits_per_sample'] = $this->FLVaudioBitDepth($info_flv['audio']['audioSampleSize']); + + $info['audio']['channels'] = $info_flv['audio']['audioType'] + 1; // 0=mono,1=stereo + $info['audio']['lossless'] = ($info_flv['audio']['audioFormat'] ? false : true); // 0=uncompressed + $info['audio']['dataformat'] = 'flv'; + } + if (@$info_flv['header']['hasVideo']) { + $info['video']['codec'] = $this->FLVvideoCodec($info_flv['video']['videoCodec']); + $info['video']['dataformat'] = 'flv'; + $info['video']['lossless'] = false; + } + + return true; + } + + + public static function FLVaudioFormat($id) { + + static $lookup = array( + 0 => 'uncompressed', + 1 => 'ADPCM', + 2 => 'mp3', + 5 => 'Nellymoser 8kHz mono', + 6 => 'Nellymoser', + ); + return (@$lookup[$id] ? @$lookup[$id] : false); + } + + + public static function FLVaudioRate($id) { + + static $lookup = array( + 0 => 5500, + 1 => 11025, + 2 => 22050, + 3 => 44100, + ); + return (@$lookup[$id] ? @$lookup[$id] : false); + } + + + public static function FLVaudioBitDepth($id) { + + static $lookup = array( + 0 => 8, + 1 => 16, + ); + return (@$lookup[$id] ? @$lookup[$id] : false); + } + + + public static function FLVvideoCodec($id) { + + static $lookup = array( + getid3_flv::VIDEO_H263 => 'Sorenson H.263', + getid3_flv::VIDEO_SCREEN => 'Screen video', + getid3_flv::VIDEO_VP6 => 'On2 VP6', + ); + return (@$lookup[$id] ? @$lookup[$id] : false); + } +} + + + +class AMFStream +{ + public $bytes; + public $pos; + + + public function AMFStream($bytes) { + + $this->bytes = $bytes; + $this->pos = 0; + } + + + public function readByte() { + + return getid3_lib::BigEndian2Int(substr($this->bytes, $this->pos++, 1)); + } + + + public function readInt() { + + return ($this->readByte() << 8) + $this->readByte(); + } + + + public function readLong() { + + return ($this->readByte() << 24) + ($this->readByte() << 16) + ($this->readByte() << 8) + $this->readByte(); + } + + + public function readDouble() { + + return getid3_lib::BigEndian2Float($this->read(8)); + } + + + public function readUTF() { + + $length = $this->readInt(); + return $this->read($length); + } + + + public function readLongUTF() { + + $length = $this->readLong(); + return $this->read($length); + } + + + public function read($length) { + + $val = substr($this->bytes, $this->pos, $length); + $this->pos += $length; + return $val; + } + + + public function peekByte() { + + $pos = $this->pos; + $val = $this->readByte(); + $this->pos = $pos; + return $val; + } + + + public function peekInt() { + + $pos = $this->pos; + $val = $this->readInt(); + $this->pos = $pos; + return $val; + } + + + public function peekLong() { + + $pos = $this->pos; + $val = $this->readLong(); + $this->pos = $pos; + return $val; + } + + + public function peekDouble() { + + $pos = $this->pos; + $val = $this->readDouble(); + $this->pos = $pos; + return $val; + } + + + public function peekUTF() { + + $pos = $this->pos; + $val = $this->readUTF(); + $this->pos = $pos; + return $val; + } + + + public function peekLongUTF() { + + $pos = $this->pos; + $val = $this->readLongUTF(); + $this->pos = $pos; + return $val; + } +} + + + +class AMFReader +{ + public $stream; + + public function __construct($stream) { + + $this->stream = $stream; + } + + + public function readData() { + + $value = null; + + $type = $this->stream->readByte(); + + switch($type) { + // Double + case 0: + $value = $this->readDouble(); + break; + + // Boolean + case 1: + $value = $this->readBoolean(); + break; + + // String + case 2: + $value = $this->readString(); + break; + + // Object + case 3: + $value = $this->readObject(); + break; + + // null + case 6: + return null; + break; + + // Mixed array + case 8: + $value = $this->readMixedArray(); + break; + + // Array + case 10: + $value = $this->readArray(); + break; + + // Date + case 11: + $value = $this->readDate(); + break; + + // Long string + case 13: + $value = $this->readLongString(); + break; + + // XML (handled as string) + case 15: + $value = $this->readXML(); + break; + + // Typed object (handled as object) + case 16: + $value = $this->readTypedObject(); + break; + + // Long string + default: + $value = '(unknown or unsupported data type)'; + break; + } + + return $value; + } + + + public function readDouble() { + + return $this->stream->readDouble(); + } + + + public function readBoolean() { + + return $this->stream->readByte() == 1; + } + + + public function readString() { + + return $this->stream->readUTF(); + } + + + public function readObject() { + + // Get highest numerical index - ignored + $highestIndex = $this->stream->readLong(); + + $data = array(); + + while ($key = $this->stream->readUTF()) { + // Mixed array record ends with empty string (0x00 0x00) and 0x09 + if (($key == '') && ($this->stream->peekByte() == 0x09)) { + // Consume byte + $this->stream->readByte(); + break; + } + + $data[$key] = $this->readData(); + } + + return $data; + } + + + public function readMixedArray() { + + // Get highest numerical index - ignored + $highestIndex = $this->stream->readLong(); + + $data = array(); + + while ($key = $this->stream->readUTF()) { + // Mixed array record ends with empty string (0x00 0x00) and 0x09 + if (($key == '') && ($this->stream->peekByte() == 0x09)) { + // Consume byte + $this->stream->readByte(); + break; + } + + if (is_numeric($key)) { + $key = (float) $key; + } + + $data[$key] = $this->readData(); + } + + return $data; + } + + + public function readArray() { + + $length = $this->stream->readLong(); + + $data = array(); + + for ($i = 0; $i < count($length); $i++) { + $data[] = $this->readData(); + } + + return $data; + } + + + public function readDate() { + + $timestamp = $this->stream->readDouble(); + $timezone = $this->stream->readInt(); + return $timestamp; + } + + + public function readLongString() { + + return $this->stream->readLongUTF(); + } + + + public function readXML() { + + return $this->stream->readLongUTF(); + } + + + public function readTypedObject() { + + $className = $this->stream->readUTF(); + return $this->readObject(); + } +} + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.audio-video.mpeg.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.audio-video.mpeg.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,324 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio-video.mpeg.php | +// | Module for analyzing MPEG files | +// | dependencies: module.audio.mp3.php | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio-video.mpeg.php,v 1.3 2006/11/02 10:48:00 ah Exp $ + + + +class getid3_mpeg extends getid3_handler +{ + + const VIDEO_PICTURE_START = "\x00\x00\x01\x00"; + const VIDEO_USER_DATA_START = "\x00\x00\x01\xB2"; + const VIDEO_SEQUENCE_HEADER = "\x00\x00\x01\xB3"; + const VIDEO_SEQUENCE_ERROR = "\x00\x00\x01\xB4"; + const VIDEO_EXTENSION_START = "\x00\x00\x01\xB5"; + const VIDEO_SEQUENCE_END = "\x00\x00\x01\xB7"; + const VIDEO_GROUP_START = "\x00\x00\x01\xB8"; + const AUDIO_START = "\x00\x00\x01\xC0"; + + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->info['mpeg']['video']['raw'] = array (); + $info_mpeg_video = &$getid3->info['mpeg']['video']; + $info_mpeg_video_raw = &$info_mpeg_video['raw']; + + $getid3->info['video'] = array (); + $info_video = &$getid3->info['video']; + + $getid3->include_module('audio.mp3'); + + if ($getid3->info['avdataend'] <= $getid3->info['avdataoffset']) { + throw new getid3_exception('"avdataend" ('.$getid3->info['avdataend'].') is unexpectedly less-than-or-equal-to "avdataoffset" ('.$getid3->info['avdataoffset'].')'); + } + + $getid3->info['fileformat'] = 'mpeg'; + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $mpeg_stream_data = fread($getid3->fp, min(100000, $getid3->info['avdataend'] - $getid3->info['avdataoffset'])); + $mpeg_stream_data_length = strlen($mpeg_stream_data); + + $video_chunk_offset = 0; + while (substr($mpeg_stream_data, $video_chunk_offset++, 4) !== getid3_mpeg::VIDEO_SEQUENCE_HEADER) { + if ($video_chunk_offset >= $mpeg_stream_data_length) { + throw new getid3_exception('Could not find start of video block in the first 100,000 bytes (or before end of file) - this might not be an MPEG-video file?'); + } + } + + // Start code 32 bits + // horizontal frame size 12 bits + // vertical frame size 12 bits + // pixel aspect ratio 4 bits + // frame rate 4 bits + // bitrate 18 bits + // marker bit 1 bit + // VBV buffer size 10 bits + // constrained parameter flag 1 bit + // intra quant. matrix flag 1 bit + // intra quant. matrix values 512 bits (present if matrix flag == 1) + // non-intra quant. matrix flag 1 bit + // non-intra quant. matrix values 512 bits (present if matrix flag == 1) + + $info_video['dataformat'] = 'mpeg'; + + $video_chunk_offset += (strlen(getid3_mpeg::VIDEO_SEQUENCE_HEADER) - 1); + + $frame_size_dword = getid3_lib::BigEndian2Int(substr($mpeg_stream_data, $video_chunk_offset, 3)); + $video_chunk_offset += 3; + + $aspect_ratio_frame_rate_dword = getid3_lib::BigEndian2Int(substr($mpeg_stream_data, $video_chunk_offset, 1)); + $video_chunk_offset += 1; + + $assorted_information = getid3_lib::BigEndian2Bin(substr($mpeg_stream_data, $video_chunk_offset, 4)); + $video_chunk_offset += 4; + + $info_mpeg_video_raw['framesize_horizontal'] = ($frame_size_dword & 0xFFF000) >> 12; // 12 bits for horizontal frame size + $info_mpeg_video_raw['framesize_vertical'] = ($frame_size_dword & 0x000FFF); // 12 bits for vertical frame size + $info_mpeg_video_raw['pixel_aspect_ratio'] = ($aspect_ratio_frame_rate_dword & 0xF0) >> 4; + $info_mpeg_video_raw['frame_rate'] = ($aspect_ratio_frame_rate_dword & 0x0F); + + $info_mpeg_video['framesize_horizontal'] = $info_mpeg_video_raw['framesize_horizontal']; + $info_mpeg_video['framesize_vertical'] = $info_mpeg_video_raw['framesize_vertical']; + + $info_mpeg_video['pixel_aspect_ratio'] = $this->MPEGvideoAspectRatioLookup($info_mpeg_video_raw['pixel_aspect_ratio']); + $info_mpeg_video['pixel_aspect_ratio_text'] = $this->MPEGvideoAspectRatioTextLookup($info_mpeg_video_raw['pixel_aspect_ratio']); + $info_mpeg_video['frame_rate'] = $this->MPEGvideoFramerateLookup($info_mpeg_video_raw['frame_rate']); + + $info_mpeg_video_raw['bitrate'] = bindec(substr($assorted_information, 0, 18)); + $info_mpeg_video_raw['marker_bit'] = (bool)bindec($assorted_information{18}); + $info_mpeg_video_raw['vbv_buffer_size'] = bindec(substr($assorted_information, 19, 10)); + $info_mpeg_video_raw['constrained_param_flag'] = (bool)bindec($assorted_information{29}); + $info_mpeg_video_raw['intra_quant_flag'] = (bool)bindec($assorted_information{30}); + + if ($info_mpeg_video_raw['intra_quant_flag']) { + + // read 512 bits + $info_mpeg_video_raw['intra_quant'] = getid3_lib::BigEndian2Bin(substr($mpeg_stream_data, $video_chunk_offset, 64)); + $video_chunk_offset += 64; + + $info_mpeg_video_raw['non_intra_quant_flag'] = (bool)bindec($info_mpeg_video_raw['intra_quant']{511}); + $info_mpeg_video_raw['intra_quant'] = bindec($assorted_information{31}).substr(getid3_lib::BigEndian2Bin(substr($mpeg_stream_data, $video_chunk_offset, 64)), 0, 511); + + if ($info_mpeg_video_raw['non_intra_quant_flag']) { + $info_mpeg_video_raw['non_intra_quant'] = substr($mpeg_stream_data, $video_chunk_offset, 64); + $video_chunk_offset += 64; + } + + } else { + + $info_mpeg_video_raw['non_intra_quant_flag'] = (bool)bindec($assorted_information{31}); + if ($info_mpeg_video_raw['non_intra_quant_flag']) { + $info_mpeg_video_raw['non_intra_quant'] = substr($mpeg_stream_data, $video_chunk_offset, 64); + $video_chunk_offset += 64; + } + } + + if ($info_mpeg_video_raw['bitrate'] == 0x3FFFF) { // 18 set bits + + $getid3->warning('This version of getID3() cannot determine average bitrate of VBR MPEG video files'); + $info_mpeg_video['bitrate_mode'] = 'vbr'; + + } else { + + $info_mpeg_video['bitrate'] = $info_mpeg_video_raw['bitrate'] * 400; + $info_mpeg_video['bitrate_mode'] = 'cbr'; + $info_video['bitrate'] = $info_mpeg_video['bitrate']; + } + + $info_video['resolution_x'] = $info_mpeg_video['framesize_horizontal']; + $info_video['resolution_y'] = $info_mpeg_video['framesize_vertical']; + $info_video['frame_rate'] = $info_mpeg_video['frame_rate']; + $info_video['bitrate_mode'] = $info_mpeg_video['bitrate_mode']; + $info_video['pixel_aspect_ratio'] = $info_mpeg_video['pixel_aspect_ratio']; + $info_video['lossless'] = false; + $info_video['bits_per_sample'] = 24; + + + //0x000001B3 begins the sequence_header of every MPEG video stream. + //But in MPEG-2, this header must immediately be followed by an + //extension_start_code (0x000001B5) with a sequence_extension ID (1). + //(This extension contains all the additional MPEG-2 stuff.) + //MPEG-1 doesn't have this extension, so that's a sure way to tell the + //difference between MPEG-1 and MPEG-2 video streams. + + $info_video['codec'] = substr($mpeg_stream_data, $video_chunk_offset, 4) == getid3_mpeg::VIDEO_EXTENSION_START ? 'MPEG-2' : 'MPEG-1'; + + $audio_chunk_offset = 0; + while (true) { + while (substr($mpeg_stream_data, $audio_chunk_offset++, 4) !== getid3_mpeg::AUDIO_START) { + if ($audio_chunk_offset >= $mpeg_stream_data_length) { + break 2; + } + } + + for ($i = 0; $i <= 7; $i++) { + // some files have the MPEG-audio header 8 bytes after the end of the $00 $00 $01 $C0 signature, some have it up to 13 bytes (or more?) after + // I have no idea why or what the difference is, so this is a stupid hack. + // If anybody has any better idea of what's going on, please let me know - info@getid3.org + + // make copy of info + $dummy = $getid3->info; + + // clone getid3 - better safe than sorry + $clone = clone $this->getid3; + + // check + $mp3 = new getid3_mp3($clone); + if ($mp3->decodeMPEGaudioHeader($getid3->fp, ($audio_chunk_offset + 3) + 8 + $i, $dummy, false)) { + + $getid3->info = $dummy; + $getid3->info['audio']['bitrate_mode'] = 'cbr'; + $getid3->info['audio']['lossless'] = false; + break 2; + } + + // destroy copy + unset($dummy); + } + } + + // Temporary hack to account for interleaving overhead: + if (!empty($info_video['bitrate']) && !empty($getid3->info['audio']['bitrate'])) { + $getid3->info['playtime_seconds'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / ($info_video['bitrate'] + $getid3->info['audio']['bitrate']); + + // Interleaved MPEG audio/video files have a certain amount of overhead that varies + // by both video and audio bitrates, and not in any sensible, linear/logarithmic patter + // Use interpolated lookup tables to approximately guess how much is overhead, because + // playtime is calculated as filesize / total-bitrate + $getid3->info['playtime_seconds'] *= $this->MPEGsystemNonOverheadPercentage($info_video['bitrate'], $getid3->info['audio']['bitrate']); + + //switch ($info_video['bitrate']) { + // case('5000000'): + // $multiplier = 0.93292642112380355828048824319889; + // break; + // case('5500000'): + // $multiplier = 0.93582895375200989965359777343219; + // break; + // case('6000000'): + // $multiplier = 0.93796247714820932532911373859139; + // break; + // case('7000000'): + // $multiplier = 0.9413264083635103463010117778776; + // break; + // default: + // $multiplier = 1; + // break; + //} + //$getid3->info['playtime_seconds'] *= $multiplier; + //$getid3->warning('Interleaved MPEG audio/video playtime may be inaccurate. With current hack should be within a few seconds of accurate. Report to info@getid3.org if off by more than 10 seconds.'); + + if ($info_video['bitrate'] < 50000) { + $getid3->warning('Interleaved MPEG audio/video playtime may be slightly inaccurate for video bitrates below 100kbps. Except in extreme low-bitrate situations, error should be less than 1%. Report to info@getid3.org if greater than this.'); + } + } + + return true; + } + + + + public static function MPEGsystemNonOverheadPercentage($video_bitrate, $audio_bitrate) { + + $overhead_percentage = 0; + + $audio_bitrate = max(min($audio_bitrate / 1000, 384), 32); // limit to range of 32kbps - 384kbps (should be only legal bitrates, but maybe VBR?) + $video_bitrate = max(min($video_bitrate / 1000, 10000), 10); // limit to range of 10kbps - 10Mbps (beyond that curves flatten anyways, no big loss) + + //OMBB[audiobitrate] = array ( video-10kbps, video-100kbps, video-1000kbps, video-10000kbps) + static $overhead_multiplier_by_bitrate = array ( + 32 => array (0, 0.9676287944368530, 0.9802276264360310, 0.9844916183244460, 0.9852821845179940), + 48 => array (0, 0.9779100089209830, 0.9787770035359320, 0.9846738664076130, 0.9852683013799960), + 56 => array (0, 0.9731249855367600, 0.9776624308938040, 0.9832606361852130, 0.9843922606633340), + 64 => array (0, 0.9755642683275760, 0.9795256705493390, 0.9836573009193170, 0.9851122539404470), + 96 => array (0, 0.9788025247497290, 0.9798553314148700, 0.9822956869792560, 0.9834815119124690), + 128 => array (0, 0.9816940050925480, 0.9821675936072120, 0.9829756927470870, 0.9839763420152050), + 160 => array (0, 0.9825894094561180, 0.9820913399073960, 0.9823907143253970, 0.9832821783651570), + 192 => array (0, 0.9832038474336260, 0.9825731694317960, 0.9821028622712400, 0.9828262076447620), + 224 => array (0, 0.9836516298538770, 0.9824718601823890, 0.9818302180625380, 0.9823735101626480), + 256 => array (0, 0.9845863022094920, 0.9837229411967540, 0.9824521662210830, 0.9828645172100790), + 320 => array (0, 0.9849565280263180, 0.9837683142805110, 0.9822885275960400, 0.9824424382727190), + 384 => array (0, 0.9856094774357600, 0.9844573394432720, 0.9825970399837330, 0.9824673808303890) + ); + + $bitrate_to_use_min = $bitrate_to_use_max = $previous_bitrate = 32; + + foreach ($overhead_multiplier_by_bitrate as $key => $value) { + + if ($audio_bitrate >= $previous_bitrate) { + $bitrate_to_use_min = $previous_bitrate; + } + if ($audio_bitrate < $key) { + $bitrate_to_use_max = $key; + break; + } + $previous_bitrate = $key; + } + + $factor_a = ($bitrate_to_use_max - $audio_bitrate) / ($bitrate_to_use_max - $bitrate_to_use_min); + + $video_bitrate_log10 = log10($video_bitrate); + $video_factor_min1 = $overhead_multiplier_by_bitrate[$bitrate_to_use_min][floor($video_bitrate_log10)]; + $video_factor_min2 = $overhead_multiplier_by_bitrate[$bitrate_to_use_max][floor($video_bitrate_log10)]; + $video_factor_max1 = $overhead_multiplier_by_bitrate[$bitrate_to_use_min][ceil($video_bitrate_log10)]; + $video_factor_max2 = $overhead_multiplier_by_bitrate[$bitrate_to_use_max][ceil($video_bitrate_log10)]; + $factor_v = $video_bitrate_log10 - floor($video_bitrate_log10); + + $overhead_percentage = $video_factor_min1 * $factor_a * $factor_v; + $overhead_percentage += $video_factor_min2 * (1 - $factor_a) * $factor_v; + $overhead_percentage += $video_factor_max1 * $factor_a * (1 - $factor_v); + $overhead_percentage += $video_factor_max2 * (1 - $factor_a) * (1 - $factor_v); + + return $overhead_percentage; + } + + + + public static function MPEGvideoFramerateLookup($raw_frame_rate) { + + $lookup = array (0, 23.976, 24, 25, 29.97, 30, 50, 59.94, 60); + + return (float)(isset($lookup[$raw_frame_rate]) ? $lookup[$raw_frame_rate] : 0); + } + + + + public static function MPEGvideoAspectRatioLookup($raw_aspect_ratio) { + + $lookup = array (0, 1, 0.6735, 0.7031, 0.7615, 0.8055, 0.8437, 0.8935, 0.9157, 0.9815, 1.0255, 1.0695, 1.0950, 1.1575, 1.2015, 0); + + return (float)(isset($lookup[$raw_aspect_ratio]) ? $lookup[$raw_aspect_ratio] : 0); + } + + + + public static function MPEGvideoAspectRatioTextLookup($raw_aspect_ratio) { + + $lookup = array ('forbidden', 'square pixels', '0.6735', '16:9, 625 line, PAL', '0.7615', '0.8055', '16:9, 525 line, NTSC', '0.8935', '4:3, 625 line, PAL, CCIR601', '0.9815', '1.0255', '1.0695', '4:3, 525 line, NTSC, CCIR601', '1.1575', '1.2015', 'reserved'); + + return (isset($lookup[$raw_aspect_ratio]) ? $lookup[$raw_aspect_ratio] : ''); + } + +} + + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.audio-video.nsv.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.audio-video.nsv.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,210 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio-video.nsv.php | +// | module for analyzing Nullsoft NSV files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio-video.nsv.php,v 1.3 2006/11/02 10:48:00 ah Exp $ + + + +class getid3_nsv extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->info['fileformat'] = 'nsv'; + $getid3->info['audio']['dataformat'] = 'nsv'; + $getid3->info['video']['dataformat'] = 'nsv'; + $getid3->info['audio']['lossless'] = false; + $getid3->info['video']['lossless'] = false; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $nsv_header = fread($getid3->fp, 4); + + switch ($nsv_header) { + + case 'NSVs': + $this->getNSVsHeader(); + break; + + case 'NSVf': + if ($this->getNSVfHeader()) { + $this->getNSVsHeader($getid3->info['nsv']['NSVf']['header_length']); + } + break; + + default: + throw new getid3_exception('Expecting "NSVs" or "NSVf" at offset '.$getid3->info['avdataoffset'].', found "'.$nsv_header.'"'); + break; + } + + if (!isset($getid3->info['nsv']['NSVf'])) { + $getid3->warning('NSVf header not present - cannot calculate playtime or bitrate'); + } + + return true; + } + + + + private function getNSVsHeader($file_offset = 0) { + + $getid3 = $this->getid3; + + fseek($getid3->fp, $file_offset, SEEK_SET); + $nsvs_header = fread($getid3->fp, 28); + + $getid3->info['nsv']['NSVs'] = array (); + $info_nsv_NSVs = &$getid3->info['nsv']['NSVs']; + + $info_nsv_NSVs['identifier'] = substr($nsvs_header, 0, 4); + if ($info_nsv_NSVs['identifier'] != 'NSVs') { + throw new getid3_exception('expected "NSVs" at offset ('.$file_offset.'), found "'.$info_nsv_NSVs['identifier'].'" instead'); + } + + $info_nsv_NSVs['offset'] = $file_offset; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_nsv_NSVs, $nsvs_header, 4, + array ( + 'video_codec' => -4, // string + 'audio_codec' => -4, // string + 'resolution_x' => 2, + 'resolution_y' => 2, + 'framerate_index' => 1, + ) + ); + + if ($info_nsv_NSVs['audio_codec'] == 'PCM ') { + + getid3_lib::ReadSequence('LittleEndian2Int', $info_nsv_NSVs, $nsvs_header, 24, + array ( + 'bits_channel' => 1, + 'channels' => 1, + 'sample_rate' => 2 + ) + ); + $getid3->info['audio']['sample_rate'] = $info_nsv_NSVs['sample_rate']; + + } + + $getid3->info['video']['resolution_x'] = $info_nsv_NSVs['resolution_x']; + $getid3->info['video']['resolution_y'] = $info_nsv_NSVs['resolution_y']; + $info_nsv_NSVs['frame_rate'] = getid3_nsv::NSVframerateLookup($info_nsv_NSVs['framerate_index']); + $getid3->info['video']['frame_rate'] = $info_nsv_NSVs['frame_rate']; + $getid3->info['video']['bits_per_sample'] = 24; + $getid3->info['video']['pixel_aspect_ratio'] = (float)1; + + return true; + } + + + + private function getNSVfHeader($file_offset = 0, $get_toc_offsets=false) { + + $getid3 = $this->getid3; + + fseek($getid3->fp, $file_offset, SEEK_SET); + $nsvf_header = fread($getid3->fp, 28); + + $getid3->info['nsv']['NSVf'] = array (); + $info_nsv_NSVf = &$getid3->info['nsv']['NSVf']; + + $info_nsv_NSVf['identifier'] = substr($nsvf_header, 0, 4); + if ($info_nsv_NSVf['identifier'] != 'NSVf') { + throw new getid3_exception('expected "NSVf" at offset ('.$file_offset.'), found "'.$info_nsv_NSVf['identifier'].'" instead'); + } + + $getid3->info['nsv']['NSVs']['offset'] = $file_offset; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_nsv_NSVf, $nsvf_header, 4, + array ( + 'header_length' => 4, + 'file_size' => 4, + 'playtime_ms' => 4, + 'meta_size' => 4, + 'TOC_entries_1' => 4, + 'TOC_entries_2' => 4 + ) + ); + + if ($info_nsv_NSVf['playtime_ms'] == 0) { + throw new getid3_exception('Corrupt NSV file: NSVf.playtime_ms == zero'); + } + + if ($info_nsv_NSVf['file_size'] > $getid3->info['avdataend']) { + $getid3->warning('truncated file - NSVf header indicates '.$info_nsv_NSVf['file_size'].' bytes, file actually '.$getid3->info['avdataend'].' bytes'); + } + + $nsvf_header .= fread($getid3->fp, $info_nsv_NSVf['meta_size'] + (4 * $info_nsv_NSVf['TOC_entries_1']) + (4 * $info_nsv_NSVf['TOC_entries_2'])); + $nsvf_headerlength = strlen($nsvf_header); + $info_nsv_NSVf['metadata'] = substr($nsvf_header, 28, $info_nsv_NSVf['meta_size']); + + $offset = 28 + $info_nsv_NSVf['meta_size']; + if ($get_toc_offsets) { + $toc_counter = 0; + while ($toc_counter < $info_nsv_NSVf['TOC_entries_1']) { + if ($toc_counter < $info_nsv_NSVf['TOC_entries_1']) { + $info_nsv_NSVf['TOC_1'][$toc_counter] = getid3_lib::LittleEndian2Int(substr($nsvf_header, $offset, 4)); + $offset += 4; + $toc_counter++; + } + } + } + + if (trim($info_nsv_NSVf['metadata']) != '') { + $info_nsv_NSVf['metadata'] = str_replace('`', "\x01", $info_nsv_NSVf['metadata']); + $comment_pair_array = explode("\x01".' ', $info_nsv_NSVf['metadata']); + foreach ($comment_pair_array as $comment_pair) { + if (strstr($comment_pair, '='."\x01")) { + list($key, $value) = explode('='."\x01", $comment_pair, 2); + $getid3->info['nsv']['comments'][strtolower($key)][] = trim(str_replace("\x01", '', $value)); + } + } + } + + $getid3->info['playtime_seconds'] = $info_nsv_NSVf['playtime_ms'] / 1000; + $getid3->info['bitrate'] = ($info_nsv_NSVf['file_size'] * 8) / $getid3->info['playtime_seconds']; + + return true; + } + + + + public static function NSVframerateLookup($frame_rate_index) { + + if ($frame_rate_index <= 127) { + return (float)$frame_rate_index; + } + + static $lookup = array ( + 129 => 29.970, + 131 => 23.976, + 133 => 14.985, + 197 => 59.940, + 199 => 47.952 + ); + return (isset($lookup[$frame_rate_index]) ? $lookup[$frame_rate_index] : false); + } + +} + + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.audio-video.quicktime.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.audio-video.quicktime.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,1529 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio-video.quicktime.php | +// | Module for analyzing Quicktime, MP3-in-MP4 and Apple Lossless files. | +// | dependencies: module.audio.mp3.php | +// | zlib support in PHP (optional) | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio-video.quicktime.php,v 1.7 2006/11/02 16:03:28 ah Exp $ + + + +class getid3_quicktime extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $info = &$getid3->info; + + $getid3->include_module('audio.mp3'); + + $info['quicktime'] = array (); + $info_quicktime = &$info['quicktime']; + + $info['fileformat'] = 'quicktime'; + $info_quicktime['hinting'] = false; + + fseek($getid3->fp, $info['avdataoffset'], SEEK_SET); + + $offset = $atom_counter = 0; + + while ($offset < $info['avdataend']) { + + fseek($getid3->fp, $offset, SEEK_SET); + $atom_header = fread($getid3->fp, 8); + + $atom_size = getid3_lib::BigEndian2Int(substr($atom_header, 0, 4)); + $atom_name = substr($atom_header, 4, 4); + + $info_quicktime[$atom_name]['name'] = $atom_name; + $info_quicktime[$atom_name]['size'] = $atom_size; + $info_quicktime[$atom_name]['offset'] = $offset; + + if (($offset + $atom_size) > $info['avdataend']) { + throw new getid3_exception('Atom at offset '.$offset.' claims to go beyond end-of-file (length: '.$atom_size.' bytes)'); + } + + if ($atom_size == 0) { + // Furthermore, for historical reasons the list of atoms is optionally + // terminated by a 32-bit integer set to 0. If you are writing a program + // to read user data atoms, you should allow for the terminating 0. + break; + } + + switch ($atom_name) { + + case 'mdat': // Media DATa atom + // 'mdat' contains the actual data for the audio/video + if (($atom_size > 8) && (!isset($info['avdataend_tmp']) || ($info_quicktime[$atom_name]['size'] > ($info['avdataend_tmp'] - $info['avdataoffset'])))) { + + $info['avdataoffset'] = $info_quicktime[$atom_name]['offset'] + 8; + $old_av_data_end = $info['avdataend']; + $info['avdataend'] = $info_quicktime[$atom_name]['offset'] + $info_quicktime[$atom_name]['size']; + + + //// MP3 + + if (!$getid3->include_module_optional('audio.mp3')) { + $getid3->warning('MP3 skipped because mpeg module is missing.'); + } + + else { + + // Clone getid3 - messing with offsets - better safe than sorry + $clone = clone $getid3; + + if (getid3_mp3::MPEGaudioHeaderValid(getid3_mp3::MPEGaudioHeaderDecode(fread($clone->fp, 4)))) { + + $mp3 = new getid3_mp3($clone); + $mp3->AnalyzeMPEGaudioInfo(); + + // Import from clone and destroy + if (isset($clone->info['mpeg']['audio'])) { + + $info['mpeg']['audio'] = $clone->info['mpeg']['audio']; + + $info['audio']['dataformat'] = 'mp3'; + $info['audio']['codec'] = (!empty($info['mpeg']['audio']['encoder']) ? $info['mpeg']['audio']['encoder'] : (!empty($info['mpeg']['audio']['codec']) ? $info['mpeg']['audio']['codec'] : (!empty($info['mpeg']['audio']['LAME']) ? 'LAME' :'mp3'))); + $info['audio']['sample_rate'] = $info['mpeg']['audio']['sample_rate']; + $info['audio']['channels'] = $info['mpeg']['audio']['channels']; + $info['audio']['bitrate'] = $info['mpeg']['audio']['bitrate']; + $info['audio']['bitrate_mode'] = strtolower($info['mpeg']['audio']['bitrate_mode']); + $info['bitrate'] = $info['audio']['bitrate']; + + $getid3->warning($clone->warnings()); + unset($clone); + } + } + } + + $info['avdataend'] = $old_av_data_end; + unset($old_av_data_end); + + } + break; + + + case 'free': // FREE space atom + case 'skip': // SKIP atom + case 'wide': // 64-bit expansion placeholder atom + // 'free', 'skip' and 'wide' are just padding, contains no useful data at all + break; + + + default: + $atom_hierarchy = array (); + $info_quicktime[$atom_name] = $this->QuicktimeParseAtom($atom_name, $atom_size, fread($getid3->fp, $atom_size), $offset, $atom_hierarchy); + break; + } + + $offset += $atom_size; + $atom_counter++; + } + + if (!empty($info['avdataend_tmp'])) { + // this value is assigned to a temp value and then erased because + // otherwise any atoms beyond the 'mdat' atom would not get parsed + $info['avdataend'] = $info['avdataend_tmp']; + unset($info['avdataend_tmp']); + } + + if (!isset($info['bitrate']) && isset($info['playtime_seconds'])) { + $info['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; + } + + if (isset($info['bitrate']) && !isset($info['audio']['bitrate']) && !isset($info_quicktime['video'])) { + $info['audio']['bitrate'] = $info['bitrate']; + } + + if ((@$info['audio']['dataformat'] == 'mp4') && empty($info['video']['resolution_x'])) { + $info['fileformat'] = 'mp4'; + $info['mime_type'] = 'audio/mp4'; + unset($info['video']['dataformat']); + } + + if (!$getid3->option_extra_info) { + unset($info_quicktime['moov']); + } + + if (empty($info['audio']['dataformat']) && !empty($info_quicktime['audio'])) { + $info['audio']['dataformat'] = 'quicktime'; + } + + if (empty($info['video']['dataformat']) && !empty($info_quicktime['video'])) { + $info['video']['dataformat'] = 'quicktime'; + } + + return true; + } + + + + private function QuicktimeParseAtom($atom_name, $atom_size, $atom_data, $base_offset, &$atom_hierarchy) { + + // http://developer.apple.com/techpubs/quicktime/qtdevdocs/APIREF/INDEX/atomalphaindex.htm + + $getid3 = $this->getid3; + + $info = &$getid3->info; + $info_quicktime = &$info['quicktime']; + + array_push($atom_hierarchy, $atom_name); + $atom_structure['hierarchy'] = implode(' ', $atom_hierarchy); + $atom_structure['name'] = $atom_name; + $atom_structure['size'] = $atom_size; + $atom_structure['offset'] = $base_offset; + + switch ($atom_name) { + case 'moov': // MOVie container atom + case 'trak': // TRAcK container atom + case 'clip': // CLIPping container atom + case 'matt': // track MATTe container atom + case 'edts': // EDiTS container atom + case 'tref': // Track REFerence container atom + case 'mdia': // MeDIA container atom + case 'minf': // Media INFormation container atom + case 'dinf': // Data INFormation container atom + case 'udta': // User DaTA container atom + case 'stbl': // Sample TaBLe container atom + case 'cmov': // Compressed MOVie container atom + case 'rmra': // Reference Movie Record Atom + case 'rmda': // Reference Movie Descriptor Atom + case 'gmhd': // Generic Media info HeaDer atom (seen on QTVR) + $atom_structure['subatoms'] = $this->QuicktimeParseContainerAtom($atom_data, $base_offset + 8, $atom_hierarchy); + break; + + + case '©cpy': + case '©day': + case '©dir': + case '©ed1': + case '©ed2': + case '©ed3': + case '©ed4': + case '©ed5': + case '©ed6': + case '©ed7': + case '©ed8': + case '©ed9': + case '©fmt': + case '©inf': + case '©prd': + case '©prf': + case '©req': + case '©src': + case '©wrt': + case '©nam': + case '©cmt': + case '©wrn': + case '©hst': + case '©mak': + case '©mod': + case '©PRD': + case '©swr': + case '©aut': + case '©ART': + case '©trk': + case '©alb': + case '©com': + case '©gen': + case '©ope': + case '©url': + case '©enc': + $atom_structure['data_length'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 2)); + $atom_structure['language_id'] = getid3_lib::BigEndian2Int(substr($atom_data, 2, 2)); + $atom_structure['data'] = substr($atom_data, 4); + + $atom_structure['language'] = $this->QuicktimeLanguageLookup($atom_structure['language_id']); + if (empty($info['comments']['language']) || (!in_array($atom_structure['language'], $info['comments']['language']))) { + $info['comments']['language'][] = $atom_structure['language']; + } + $this->CopyToAppropriateCommentsSection($atom_name, $atom_structure['data']); + break; + + + case 'play': // auto-PLAY atom + $atom_structure['autoplay'] = (bool)getid3_lib::BigEndian2Int(substr($atom_data, 0, 1)); + + $info_quicktime['autoplay'] = $atom_structure['autoplay']; + break; + + + case 'WLOC': // Window LOCation atom + $atom_structure['location_x'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 2)); + $atom_structure['location_y'] = getid3_lib::BigEndian2Int(substr($atom_data, 2, 2)); + break; + + + case 'LOOP': // LOOPing atom + case 'SelO': // play SELection Only atom + case 'AllF': // play ALL Frames atom + $atom_structure['data'] = getid3_lib::BigEndian2Int($atom_data); + break; + + + case 'name': // + case 'MCPS': // Media Cleaner PRo + case '@PRM': // adobe PReMiere version + case '@PRQ': // adobe PRemiere Quicktime version + $atom_structure['data'] = $atom_data; + break; + + + case 'cmvd': // Compressed MooV Data atom + // Code by ubergeekØubergeek*tv based on information from + // http://developer.apple.com/quicktime/icefloe/dispatch012.html + $atom_structure['unCompressedSize'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 4)); + + $compressed_file_data = substr($atom_data, 4); + if (!function_exists('gzuncompress')) { + $getid3->warning('PHP does not have zlib support - cannot decompress MOV atom at offset '.$atom_structure['offset']); + } + elseif ($uncompressed_header = @gzuncompress($compressed_file_data)) { + $atom_structure['subatoms'] = $this->QuicktimeParseContainerAtom($uncompressed_header, 0, $atom_hierarchy); + } else { + $getid3->warning('Error decompressing compressed MOV atom at offset '.$atom_structure['offset']); + } + break; + + + case 'dcom': // Data COMpression atom + $atom_structure['compression_id'] = $atom_data; + $atom_structure['compression_text'] = getid3_quicktime::QuicktimeDCOMLookup($atom_data); + break; + + + case 'rdrf': // Reference movie Data ReFerence atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, + 'reference_type_name' => -4, + 'reference_length' => 4, + ) + ); + + $atom_structure['flags']['internal_data'] = (bool)($atom_structure['flags_raw'] & 0x000001); + + switch ($atom_structure['reference_type_name']) { + case 'url ': + $atom_structure['url'] = $this->NoNullString(substr($atom_data, 12)); + break; + + case 'alis': + $atom_structure['file_alias'] = substr($atom_data, 12); + break; + + case 'rsrc': + $atom_structure['resource_alias'] = substr($atom_data, 12); + break; + + default: + $atom_structure['data'] = substr($atom_data, 12); + break; + } + break; + + + case 'rmqu': // Reference Movie QUality atom + $atom_structure['movie_quality'] = getid3_lib::BigEndian2Int($atom_data); + break; + + + case 'rmcs': // Reference Movie Cpu Speed atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, // hardcoded: 0x0000 + 'cpu_speed_rating' => 2 + ) + ); + break; + + + case 'rmvc': // Reference Movie Version Check atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, // hardcoded: 0x0000 + 'gestalt_selector' => -4, + 'gestalt_value_mask' => 4, + 'gestalt_value' => 4, + 'gestalt_check_type' => 2 + ) + ); + break; + + + case 'rmcd': // Reference Movie Component check atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, // hardcoded: 0x0000 + 'component_type' => -4, + 'component_subtype' => -4, + 'component_manufacturer' => -4, + 'component_flags_raw' => 4, + 'component_flags_mask' => 4, + 'component_min_version' => 4 + ) + ); + break; + + + case 'rmdr': // Reference Movie Data Rate atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, // hardcoded: 0x0000 + 'data_rate' => 4 + ) + ); + + $atom_structure['data_rate_bps'] = $atom_structure['data_rate'] * 10; + break; + + + case 'rmla': // Reference Movie Language Atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, // hardcoded: 0x0000 + 'language_id' => 2 + ) + ); + + $atom_structure['language'] = $this->QuicktimeLanguageLookup($atom_structure['language_id']); + if (empty($info['comments']['language']) || (!in_array($atom_structure['language'], $info['comments']['language']))) { + $info['comments']['language'][] = $atom_structure['language']; + } + break; + + + case 'rmla': // Reference Movie Language Atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, // hardcoded: 0x0000 + 'track_id' => 2 + ) + ); + break; + + + case 'ptv ': // Print To Video - defines a movie's full screen mode + // http://developer.apple.com/documentation/QuickTime/APIREF/SOURCESIV/at_ptv-_pg.htm + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'display_size_raw' => 2, + 'reserved_1' => 2, // hardcoded: 0x0000 + 'reserved_2' => 2, // hardcoded: 0x0000 + 'slide_show_flag' => 1, + 'play_on_open_flag' => 1 + ) + ); + + $atom_structure['flags']['play_on_open'] = (bool)$atom_structure['play_on_open_flag']; + $atom_structure['flags']['slide_show'] = (bool)$atom_structure['slide_show_flag']; + + $ptv_lookup[0] = 'normal'; + $ptv_lookup[1] = 'double'; + $ptv_lookup[2] = 'half'; + $ptv_lookup[3] = 'full'; + $ptv_lookup[4] = 'current'; + if (isset($ptv_lookup[$atom_structure['display_size_raw']])) { + $atom_structure['display_size'] = $ptv_lookup[$atom_structure['display_size_raw']]; + } else { + $getid3->warning('unknown "ptv " display constant ('.$atom_structure['display_size_raw'].')'); + } + break; + + + case 'stsd': // Sample Table Sample Description atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, // hardcoded: 0x0000 + 'number_entries' => 4 + ) + ); + $stsd_entries_data_offset = 8; + for ($i = 0; $i < $atom_structure['number_entries']; $i++) { + + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure['sample_description_table'][$i], $atom_data, $stsd_entries_data_offset, + array ( + 'size' => 4, + 'data_format' => -4, + 'reserved' => 6, + 'reference_index' => 2 + ) + ); + + $atom_structure['sample_description_table'][$i]['data'] = substr($atom_data, 16+$stsd_entries_data_offset, ($atom_structure['sample_description_table'][$i]['size'] - 4 - 4 - 6 - 2)); + $stsd_entries_data_offset += 16 + ($atom_structure['sample_description_table'][$i]['size'] - 4 - 4 - 6 - 2); + + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure['sample_description_table'][$i], $atom_structure['sample_description_table'][$i]['data'], 0, + array ( + 'encoder_version' => 2, + 'encoder_revision' => 2, + 'encoder_vendor' => -4 + ) + ); + + switch ($atom_structure['sample_description_table'][$i]['encoder_vendor']) { + + case "\x00\x00\x00\x00": + // audio atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure['sample_description_table'][$i], $atom_structure['sample_description_table'][$i]['data'], 8, + array ( + 'audio_channels' => 2, + 'audio_bit_depth' => 2, + 'audio_compression_id' => 2, + 'audio_packet_size' => 2 + ) + ); + + $atom_structure['sample_description_table'][$i]['audio_sample_rate'] = getid3_quicktime::FixedPoint16_16(substr($atom_structure['sample_description_table'][$i]['data'], 16, 4)); + + switch ($atom_structure['sample_description_table'][$i]['data_format']) { + + case 'mp4v': + $info['fileformat'] = 'mp4'; + throw new getid3_exception('This version of getID3() does not fully support MPEG-4 audio/video streams'); + + case 'qtvr': + $info['video']['dataformat'] = 'quicktimevr'; + break; + + case 'mp4a': + default: + $info_quicktime['audio']['codec'] = $this->QuicktimeAudioCodecLookup($atom_structure['sample_description_table'][$i]['data_format']); + $info_quicktime['audio']['sample_rate'] = $atom_structure['sample_description_table'][$i]['audio_sample_rate']; + $info_quicktime['audio']['channels'] = $atom_structure['sample_description_table'][$i]['audio_channels']; + $info_quicktime['audio']['bit_depth'] = $atom_structure['sample_description_table'][$i]['audio_bit_depth']; + $info['audio']['codec'] = $info_quicktime['audio']['codec']; + $info['audio']['sample_rate'] = $info_quicktime['audio']['sample_rate']; + $info['audio']['channels'] = $info_quicktime['audio']['channels']; + $info['audio']['bits_per_sample'] = $info_quicktime['audio']['bit_depth']; + switch ($atom_structure['sample_description_table'][$i]['data_format']) { + case 'raw ': // PCM + case 'alac': // Apple Lossless Audio Codec + $info['audio']['lossless'] = true; + break; + default: + $info['audio']['lossless'] = false; + break; + } + break; + } + break; + + default: + switch ($atom_structure['sample_description_table'][$i]['data_format']) { + case 'mp4s': + $info['fileformat'] = 'mp4'; + break; + + default: + // video atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure['sample_description_table'][$i], $atom_structure['sample_description_table'][$i]['data'], 8, + array ( + 'video_temporal_quality' => 4, + 'video_spatial_quality' => 4, + 'video_frame_width' => 2, + 'video_frame_height' => 2 + ) + ); + $atom_structure['sample_description_table'][$i]['video_resolution_x'] = getid3_quicktime::FixedPoint16_16(substr($atom_structure['sample_description_table'][$i]['data'], 20, 4)); + $atom_structure['sample_description_table'][$i]['video_resolution_y'] = getid3_quicktime::FixedPoint16_16(substr($atom_structure['sample_description_table'][$i]['data'], 24, 4)); + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure['sample_description_table'][$i], $atom_structure['sample_description_table'][$i]['data'], 28, + array ( + 'video_data_size' => 4, + 'video_frame_count' => 2, + 'video_encoder_name_len' => 1 + ) + ); + $atom_structure['sample_description_table'][$i]['video_encoder_name'] = substr($atom_structure['sample_description_table'][$i]['data'], 35, $atom_structure['sample_description_table'][$i]['video_encoder_name_len']); + $atom_structure['sample_description_table'][$i]['video_pixel_color_depth'] = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 66, 2)); + $atom_structure['sample_description_table'][$i]['video_color_table_id'] = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 68, 2)); + + $atom_structure['sample_description_table'][$i]['video_pixel_color_type'] = (($atom_structure['sample_description_table'][$i]['video_pixel_color_depth'] > 32) ? 'grayscale' : 'color'); + $atom_structure['sample_description_table'][$i]['video_pixel_color_name'] = $this->QuicktimeColorNameLookup($atom_structure['sample_description_table'][$i]['video_pixel_color_depth']); + + if ($atom_structure['sample_description_table'][$i]['video_pixel_color_name'] != 'invalid') { + $info_quicktime['video']['codec_fourcc'] = $atom_structure['sample_description_table'][$i]['data_format']; + $info_quicktime['video']['codec_fourcc_lookup'] = $this->QuicktimeVideoCodecLookup($atom_structure['sample_description_table'][$i]['data_format']); + $info_quicktime['video']['codec'] = $atom_structure['sample_description_table'][$i]['video_encoder_name']; + $info_quicktime['video']['color_depth'] = $atom_structure['sample_description_table'][$i]['video_pixel_color_depth']; + $info_quicktime['video']['color_depth_name'] = $atom_structure['sample_description_table'][$i]['video_pixel_color_name']; + + $info['video']['codec'] = $info_quicktime['video']['codec']; + $info['video']['bits_per_sample'] = $info_quicktime['video']['color_depth']; + } + $info['video']['lossless'] = false; + $info['video']['pixel_aspect_ratio'] = (float)1; + break; + } + break; + } + switch (strtolower($atom_structure['sample_description_table'][$i]['data_format'])) { + case 'mp4a': + $info['audio']['dataformat'] = $info_quicktime['audio']['codec'] = 'mp4'; + break; + + case '3ivx': + case '3iv1': + case '3iv2': + $info['video']['dataformat'] = '3ivx'; + break; + + case 'xvid': + $info['video']['dataformat'] = 'xvid'; + break; + + case 'mp4v': + $info['video']['dataformat'] = 'mpeg4'; + break; + + case 'divx': + case 'div1': + case 'div2': + case 'div3': + case 'div4': + case 'div5': + case 'div6': + //$TDIVXileInfo['video']['dataformat'] = 'divx'; + break; + + default: + // do nothing + break; + } + unset($atom_structure['sample_description_table'][$i]['data']); + } + break; + + + case 'stts': // Sample Table Time-to-Sample atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, // hardcoded: 0x0000 + 'number_entries' => 4 + ) + ); + + $stts_entries_data_offset = 8; + $frame_rate_calculator_array = array (); + for ($i = 0; $i < $atom_structure['number_entries']; $i++) { + + $atom_structure['time_to_sample_table'][$i]['sample_count'] = getid3_lib::BigEndian2Int(substr($atom_data, $stts_entries_data_offset, 4)); + $stts_entries_data_offset += 4; + + $atom_structure['time_to_sample_table'][$i]['sample_duration'] = getid3_lib::BigEndian2Int(substr($atom_data, $stts_entries_data_offset, 4)); + $stts_entries_data_offset += 4; + + if (!empty($info_quicktime['time_scale']) && (@$atoms_structure['time_to_sample_table'][$i]['sample_duration'] > 0)) { + + $stts_new_framerate = $info_quicktime['time_scale'] / $atom_structure['time_to_sample_table'][$i]['sample_duration']; + if ($stts_new_framerate <= 60) { + // some atoms have durations of "1" giving a very large framerate, which probably is not right + $info['video']['frame_rate'] = max(@$info['video']['frame_rate'], $stts_new_framerate); + } + } + //@$frame_rate_calculator_array[($info_quicktime['time_scale'] / $atom_structure['time_to_sample_table'][$i]['sample_duration'])] += $atom_structure['time_to_sample_table'][$i]['sample_count']; + } + /* + $stts_frames_total = 0; + $stts_seconds_total = 0; + foreach ($frame_rate_calculator_array as $frames_per_second => $frame_count) { + if (($frames_per_second > 60) || ($frames_per_second < 1)) { + // not video FPS information, probably audio information + $stts_frames_total = 0; + $stts_seconds_total = 0; + break; + } + $stts_frames_total += $frame_count; + $stts_seconds_total += $frame_count / $frames_per_second; + } + if (($stts_frames_total > 0) && ($stts_seconds_total > 0)) { + if (($stts_frames_total / $stts_seconds_total) > @$info['video']['frame_rate']) { + $info['video']['frame_rate'] = $stts_frames_total / $stts_seconds_total; + } + } + */ + break; + + + case 'stss': // Sample Table Sync Sample (key frames) atom + /* + $atom_structure['version'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 1)); + $atom_structure['flags_raw'] = getid3_lib::BigEndian2Int(substr($atom_data, 1, 3)); // hardcoded: 0x0000 + $atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data, 4, 4)); + $stss_entries_data_offset = 8; + for ($i = 0; $i < $atom_structure['number_entries']; $i++) { + $atom_structure['time_to_sample_table'][$i] = getid3_lib::BigEndian2Int(substr($atom_data, $stss_entries_data_offset, 4)); + $stss_entries_data_offset += 4; + } + */ + break; + + + case 'stsc': // Sample Table Sample-to-Chunk atom + /* + $atom_structure['version'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 1)); + $atom_structure['flags_raw'] = getid3_lib::BigEndian2Int(substr($atom_data, 1, 3)); // hardcoded: 0x0000 + $atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data, 4, 4)); + $stsc_entries_data_offset = 8; + for ($i = 0; $i < $atom_structure['number_entries']; $i++) { + $atom_structure['sample_to_chunk_table'][$i]['first_chunk'] = getid3_lib::BigEndian2Int(substr($atom_data, $stsc_entries_data_offset, 4)); + $stsc_entries_data_offset += 4; + $atom_structure['sample_to_chunk_table'][$i]['samples_per_chunk'] = getid3_lib::BigEndian2Int(substr($atom_data, $stsc_entries_data_offset, 4)); + $stsc_entries_data_offset += 4; + $atom_structure['sample_to_chunk_table'][$i]['sample_description'] = getid3_lib::BigEndian2Int(substr($atom_data, $stsc_entries_data_offset, 4)); + $stsc_entries_data_offset += 4; + } + */ + break; + + + case 'stsz': // Sample Table SiZe atom + /* + $atom_structure['version'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 1)); + $atom_structure['flags_raw'] = getid3_lib::BigEndian2Int(substr($atom_data, 1, 3)); // hardcoded: 0x0000 + $atom_structure['sample_size'] = getid3_lib::BigEndian2Int(substr($atom_data, 4, 4)); + $atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data, 8, 4)); + $stsz_entries_data_offset = 12; + if ($atom_structure['sample_size'] == 0) { + for ($i = 0; $i < $atom_structure['number_entries']; $i++) { + $atom_structure['sample_size_table'][$i] = getid3_lib::BigEndian2Int(substr($atom_data, $stsz_entries_data_offset, 4)); + $stsz_entries_data_offset += 4; + } + } + */ + break; + + + case 'stco': // Sample Table Chunk Offset atom + /* + $atom_structure['version'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 1)); + $atom_structure['flags_raw'] = getid3_lib::BigEndian2Int(substr($atom_data, 1, 3)); // hardcoded: 0x0000 + $atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data, 4, 4)); + $stco_entries_data_offset = 8; + for ($i = 0; $i < $atom_structure['number_entries']; $i++) { + $atom_structure['chunk_offset_table'][$i] = getid3_lib::BigEndian2Int(substr($atom_data, $stco_entries_data_offset, 4)); + $stco_entries_data_offset += 4; + } + */ + break; + + + case 'dref': // Data REFerence atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, // hardcoded: 0x0000 + 'number_entries' => 4 + ) + ); + + $dref_data_offset = 8; + for ($i = 0; $i < $atom_structure['number_entries']; $i++) { + + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure['data_references'][$i], $atom_data, $dref_data_offset, + array ( + 'size' => 4, + 'type' => -4, + 'version' => 1, + 'flags_raw' => 3 // hardcoded: 0x0000 + ) + ); + $dref_data_offset += 12; + + $atom_structure['data_references'][$i]['data'] = substr($atom_data, $dref_data_offset, ($atom_structure['data_references'][$i]['size'] - 4 - 4 - 1 - 3)); + $dref_data_offset += ($atom_structure['data_references'][$i]['size'] - 4 - 4 - 1 - 3); + + $atom_structure['data_references'][$i]['flags']['self_reference'] = (bool)($atom_structure['data_references'][$i]['flags_raw'] & 0x001); + } + break; + + + case 'gmin': // base Media INformation atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, // hardcoded: 0x0000 + 'graphics_mode' => 2, + 'opcolor_red' => 2, + 'opcolor_green' => 2, + 'opcolor_blue' => 2, + 'balance' => 2, + 'reserved' => 2 + ) + ); + break; + + + case 'smhd': // Sound Media information HeaDer atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, // hardcoded: 0x0000 + 'balance' => 2, + 'reserved' => 2 + ) + ); + break; + + + case 'vmhd': // Video Media information HeaDer atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, + 'graphics_mode' => 2, + 'opcolor_red' => 2, + 'opcolor_green' => 2, + 'opcolor_blue' => 2 + ) + ); + $atom_structure['flags']['no_lean_ahead'] = (bool)($atom_structure['flags_raw'] & 0x001); + break; + + + case 'hdlr': // HanDLeR reference atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, // hardcoded: 0x0000 + 'component_type' => -4, + 'component_subtype' => -4, + 'component_manufacturer' => -4, + 'component_flags_raw' => 4, + 'component_flags_mask' => 4 + ) + ); + + $atom_structure['component_name'] = substr(substr($atom_data, 24), 1); /// Pascal2String + + if (($atom_structure['component_subtype'] == 'STpn') && ($atom_structure['component_manufacturer'] == 'zzzz')) { + $info['video']['dataformat'] = 'quicktimevr'; + } + break; + + + case 'mdhd': // MeDia HeaDer atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, // hardcoded: 0x0000 + 'creation_time' => 4, + 'modify_time' => 4, + 'time_scale' => 4, + 'duration' => 4, + 'language_id' => 2, + 'quality' => 2 + ) + ); + + if ($atom_structure['time_scale'] == 0) { + throw new getid3_exception('Corrupt Quicktime file: mdhd.time_scale == zero'); + } + $info_quicktime['time_scale'] = max(@$info['quicktime']['time_scale'], $atom_structure['time_scale']); + + $atom_structure['creation_time_unix'] = (int)($atom_structure['creation_time'] - 2082844800); // DateMac2Unix() + $atom_structure['modify_time_unix'] = (int)($atom_structure['modify_time'] - 2082844800); // DateMac2Unix() + $atom_structure['playtime_seconds'] = $atom_structure['duration'] / $atom_structure['time_scale']; + $atom_structure['language'] = $this->QuicktimeLanguageLookup($atom_structure['language_id']); + if (empty($info['comments']['language']) || (!in_array($atom_structure['language'], $info['comments']['language']))) { + $info['comments']['language'][] = $atom_structure['language']; + } + break; + + + case 'pnot': // Preview atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'modification_date' => 4, // "standard Macintosh format" + 'version_number' => 2, // hardcoded: 0x00 + 'atom_type' => -4, // usually: 'PICT' + 'atom_index' => 2 // usually: 0x01 + ) + ); + $atom_structure['modification_date_unix'] = (int)($atom_structure['modification_date'] - 2082844800); // DateMac2Unix() + break; + + + case 'crgn': // Clipping ReGioN atom + $atom_structure['region_size'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 2)); // The Region size, Region boundary box, + $atom_structure['boundary_box'] = getid3_lib::BigEndian2Int(substr($atom_data, 2, 8)); // and Clipping region data fields + $atom_structure['clipping_data'] = substr($atom_data, 10); // constitute a QuickDraw region. + break; + + + case 'load': // track LOAD settings atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'preload_start_time' => 4, + 'preload_duration' => 4, + 'preload_flags_raw' => 4, + 'default_hints_raw' => 4 + ) + ); + + $atom_structure['default_hints']['double_buffer'] = (bool)($atom_structure['default_hints_raw'] & 0x0020); + $atom_structure['default_hints']['high_quality'] = (bool)($atom_structure['default_hints_raw'] & 0x0100); + break; + + + case 'tmcd': // TiMe CoDe atom + case 'chap': // CHAPter list atom + case 'sync': // SYNChronization atom + case 'scpt': // tranSCriPT atom + case 'ssrc': // non-primary SouRCe atom + for ($i = 0; $i < (strlen($atom_data) % 4); $i++) { + $atom_structure['track_id'][$i] = getid3_lib::BigEndian2Int(substr($atom_data, $i * 4, 4)); + } + break; + + + case 'elst': // Edit LiST atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, // hardcoded: 0x0000 + 'number_entries' => 4 + ) + ); + + for ($i = 0; $i < $atom_structure['number_entries']; $i++ ) { + $atom_structure['edit_list'][$i]['track_duration'] = getid3_lib::BigEndian2Int(substr($atom_data, 8 + ($i * 12) + 0, 4)); + $atom_structure['edit_list'][$i]['media_time'] = getid3_lib::BigEndian2Int(substr($atom_data, 8 + ($i * 12) + 4, 4)); + $atom_structure['edit_list'][$i]['media_rate'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 8 + ($i * 12) + 8, 4)); + } + break; + + + case 'kmat': // compressed MATte atom + $atom_structure['version'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 1)); + $atom_structure['flags_raw'] = getid3_lib::BigEndian2Int(substr($atom_data, 1, 3)); // hardcoded: 0x0000 + $atom_structure['matte_data_raw'] = substr($atom_data, 4); + break; + + + case 'ctab': // Color TABle atom + $atom_structure['color_table_seed'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 4)); // hardcoded: 0x00000000 + $atom_structure['color_table_flags'] = getid3_lib::BigEndian2Int(substr($atom_data, 4, 2)); // hardcoded: 0x8000 + $atom_structure['color_table_size'] = getid3_lib::BigEndian2Int(substr($atom_data, 6, 2)) + 1; + for ($colortableentry = 0; $colortableentry < $atom_structure['color_table_size']; $colortableentry++) { + $atom_structure['color_table'][$colortableentry]['alpha'] = getid3_lib::BigEndian2Int(substr($atom_data, 8 + ($colortableentry * 8) + 0, 2)); + $atom_structure['color_table'][$colortableentry]['red'] = getid3_lib::BigEndian2Int(substr($atom_data, 8 + ($colortableentry * 8) + 2, 2)); + $atom_structure['color_table'][$colortableentry]['green'] = getid3_lib::BigEndian2Int(substr($atom_data, 8 + ($colortableentry * 8) + 4, 2)); + $atom_structure['color_table'][$colortableentry]['blue'] = getid3_lib::BigEndian2Int(substr($atom_data, 8 + ($colortableentry * 8) + 6, 2)); + } + break; + + + case 'mvhd': // MoVie HeaDer atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, + 'creation_time' => 4, + 'modify_time' => 4, + 'time_scale' => 4, + 'duration' => 4 + ) + ); + + $atom_structure['preferred_rate'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 20, 4)); + $atom_structure['preferred_volume'] = getid3_quicktime::FixedPoint8_8(substr($atom_data, 24, 2)); + $atom_structure['reserved'] = substr($atom_data, 26, 10); + $atom_structure['matrix_a'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 36, 4)); + $atom_structure['matrix_b'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 40, 4)); + $atom_structure['matrix_u'] = getid3_quicktime::FixedPoint2_30(substr($atom_data, 44, 4)); + $atom_structure['matrix_c'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 48, 4)); + $atom_structure['matrix_d'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 52, 4)); + $atom_structure['matrix_v'] = getid3_quicktime::FixedPoint2_30(substr($atom_data, 56, 4)); + $atom_structure['matrix_x'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 60, 4)); + $atom_structure['matrix_y'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 64, 4)); + $atom_structure['matrix_w'] = getid3_quicktime::FixedPoint2_30(substr($atom_data, 68, 4)); + + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 72, + array ( + 'preview_time' => 4, + 'preview_duration' => 4, + 'poster_time' => 4, + 'selection_time' => 4, + 'selection_duration' => 4, + 'current_time' => 4, + 'next_track_id' => 4 + ) + ); + + if ($atom_structure['time_scale'] == 0) { + throw new getid3_exception('Corrupt Quicktime file: mvhd.time_scale == zero'); + } + + $atom_structure['creation_time_unix'] = (int)($atom_structure['creation_time'] - 2082844800); // DateMac2Unix() + $atom_structure['modify_time_unix'] = (int)($atom_structure['modify_time'] - 2082844800); // DateMac2Unix() + $info_quicktime['time_scale'] = max(@$info['quicktime']['time_scale'], $atom_structure['time_scale']); + $info_quicktime['display_scale'] = $atom_structure['matrix_a']; + $info['playtime_seconds'] = $atom_structure['duration'] / $atom_structure['time_scale']; + break; + + + case 'tkhd': // TracK HeaDer atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, + 'creation_time' => 4, + 'modify_time' => 4, + 'trackid' => 4, + 'reserved1' => 4, + 'duration' => 4, + 'reserved2' => 8, + 'layer' => 2, + 'alternate_group' => 2 + ) + ); + + $atom_structure['volume'] = getid3_quicktime::FixedPoint8_8(substr($atom_data, 36, 2)); + $atom_structure['reserved3'] = getid3_lib::BigEndian2Int(substr($atom_data, 38, 2)); + $atom_structure['matrix_a'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 40, 4)); + $atom_structure['matrix_b'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 44, 4)); + $atom_structure['matrix_u'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 48, 4)); + $atom_structure['matrix_c'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 52, 4)); + $atom_structure['matrix_v'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 56, 4)); + $atom_structure['matrix_d'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 60, 4)); + $atom_structure['matrix_x'] = getid3_quicktime::FixedPoint2_30(substr($atom_data, 64, 4)); + $atom_structure['matrix_y'] = getid3_quicktime::FixedPoint2_30(substr($atom_data, 68, 4)); + $atom_structure['matrix_w'] = getid3_quicktime::FixedPoint2_30(substr($atom_data, 72, 4)); + $atom_structure['width'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 76, 4)); + $atom_structure['height'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 80, 4)); + + $atom_structure['flags']['enabled'] = (bool)($atom_structure['flags_raw'] & 0x0001); + $atom_structure['flags']['in_movie'] = (bool)($atom_structure['flags_raw'] & 0x0002); + $atom_structure['flags']['in_preview'] = (bool)($atom_structure['flags_raw'] & 0x0004); + $atom_structure['flags']['in_poster'] = (bool)($atom_structure['flags_raw'] & 0x0008); + $atom_structure['creation_time_unix'] = (int)($atom_structure['creation_time'] - 2082844800); // DateMac2Unix() + $atom_structure['modify_time_unix'] = (int)($atom_structure['modify_time'] - 2082844800); // DateMac2Unix() + + if (!isset($info['video']['resolution_x']) || !isset($info['video']['resolution_y'])) { + $info['video']['resolution_x'] = $atom_structure['width']; + $info['video']['resolution_y'] = $atom_structure['height']; + } + + if ($atom_structure['flags']['enabled'] == 1) { + $info['video']['resolution_x'] = max($info['video']['resolution_x'], $atom_structure['width']); + $info['video']['resolution_y'] = max($info['video']['resolution_y'], $atom_structure['height']); + } + + if (!empty($info['video']['resolution_x']) && !empty($info['video']['resolution_y'])) { + $info_quicktime['video']['resolution_x'] = $info['video']['resolution_x']; + $info_quicktime['video']['resolution_y'] = $info['video']['resolution_y']; + } else { + unset($info['video']['resolution_x']); + unset($info['video']['resolution_y']); + unset($info_quicktime['video']); + } + break; + + + case 'meta': // METAdata atom + // http://www.geocities.com/xhelmboyx/quicktime/formats/qti-layout.txt + $next_tag_position = strpos($atom_data, '©'); + while ($next_tag_position < strlen($atom_data)) { + $meta_item_size = getid3_lib::BigEndian2Int(substr($atom_data, $next_tag_position - 4, 4)) - 4; + if ($meta_item_size == -4) { + break; + } + $meta_item_raw = substr($atom_data, $next_tag_position, $meta_item_size); + $meta_item_key = substr($meta_item_raw, 0, 4); + $meta_item_data = substr($meta_item_raw, 20); + $next_tag_position += $meta_item_size + 4; + + $this->CopyToAppropriateCommentsSection($meta_item_key, $meta_item_data); + } + break; + + case 'ftyp': // FileTYPe (?) atom (for MP4 it seems) + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'signature' => -4, + 'unknown_1' => 4, + 'fourcc' => -4, + ) + ); + break; + + case 'mdat': // Media DATa atom + case 'free': // FREE space atom + case 'skip': // SKIP atom + case 'wide': // 64-bit expansion placeholder atom + // 'mdat' data is too big to deal with, contains no useful metadata + // 'free', 'skip' and 'wide' are just padding, contains no useful data at all + + // When writing QuickTime files, it is sometimes necessary to update an atom's size. + // It is impossible to update a 32-bit atom to a 64-bit atom since the 32-bit atom + // is only 8 bytes in size, and the 64-bit atom requires 16 bytes. Therefore, QuickTime + // puts an 8-byte placeholder atom before any atoms it may have to update the size of. + // In this way, if the atom needs to be converted from a 32-bit to a 64-bit atom, the + // placeholder atom can be overwritten to obtain the necessary 8 extra bytes. + // The placeholder atom has a type of kWideAtomPlaceholderType ( 'wide' ). + break; + + + case 'nsav': // NoSAVe atom + // http://developer.apple.com/technotes/tn/tn2038.html + $atom_structure['data'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 4)); + break; + + case 'ctyp': // Controller TYPe atom (seen on QTVR) + // http://homepages.slingshot.co.nz/~helmboy/quicktime/formats/qtm-layout.txt + // some controller names are: + // 0x00 + 'std' for linear movie + // 'none' for no controls + $atom_structure['ctyp'] = substr($atom_data, 0, 4); + switch ($atom_structure['ctyp']) { + case 'qtvr': + $info['video']['dataformat'] = 'quicktimevr'; + break; + } + break; + + case 'pano': // PANOrama track (seen on QTVR) + $atom_structure['pano'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 4)); + break; + + case 'hint': // HINT track + case 'hinf': // + case 'hinv': // + case 'hnti': // + $info['quicktime']['hinting'] = true; + break; + + case 'imgt': // IMaGe Track reference (kQTVRImageTrackRefType) (seen on QTVR) + for ($i = 0; $i < ($atom_structure['size'] - 8); $i += 4) { + $atom_structure['imgt'][] = getid3_lib::BigEndian2Int(substr($atom_data, $i, 4)); + } + break; + + case 'FXTC': // Something to do with Adobe After Effects (?) + case 'PrmA': + case 'code': + case 'FIEL': // this is NOT "fiel" (Field Ordering) as describe here: http://developer.apple.com/documentation/QuickTime/QTFF/QTFFChap3/chapter_4_section_2.html + // Observed-but-not-handled atom types are just listed here + // to prevent warnings being generated + $atom_structure['data'] = $atom_data; + break; + + default: + $getid3->warning('Unknown QuickTime atom type: "'.$atom_name.'" at offset '.$base_offset); + $atom_structure['data'] = $atom_data; + break; + } + array_pop($atom_hierarchy); + return $atom_structure; + } + + + + private function QuicktimeParseContainerAtom($atom_data, $base_offset, &$atom_hierarchy) { + + if ((strlen($atom_data) == 4) && (getid3_lib::BigEndian2Int($atom_data) == 0x00000000)) { + return false; + } + + $atom_structure = false; + $subatom_offset = 0; + + while ($subatom_offset < strlen($atom_data)) { + + $subatom_size = getid3_lib::BigEndian2Int(substr($atom_data, $subatom_offset + 0, 4)); + $subatom_name = substr($atom_data, $subatom_offset + 4, 4); + $subatom_data = substr($atom_data, $subatom_offset + 8, $subatom_size - 8); + + if ($subatom_size == 0) { + // Furthermore, for historical reasons the list of atoms is optionally + // terminated by a 32-bit integer set to 0. If you are writing a program + // to read user data atoms, you should allow for the terminating 0. + return $atom_structure; + } + + $atom_structure[] = $this->QuicktimeParseAtom($subatom_name, $subatom_size, $subatom_data, $base_offset + $subatom_offset, $atom_hierarchy); + + $subatom_offset += $subatom_size; + } + return $atom_structure; + } + + + + private function CopyToAppropriateCommentsSection($key_name, $data) { + + // http://www.geocities.com/xhelmboyx/quicktime/formats/qtm-layout.txt + + static $translator = array ( + '©cpy' => 'copyright', + '©day' => 'creation_date', + '©dir' => 'director', + '©ed1' => 'edit1', + '©ed2' => 'edit2', + '©ed3' => 'edit3', + '©ed4' => 'edit4', + '©ed5' => 'edit5', + '©ed6' => 'edit6', + '©ed7' => 'edit7', + '©ed8' => 'edit8', + '©ed9' => 'edit9', + '©fmt' => 'format', + '©inf' => 'information', + '©prd' => 'producer', + '©prf' => 'performers', + '©req' => 'system_requirements', + '©src' => 'source_credit', + '©wrt' => 'writer', + '©nam' => 'title', + '©cmt' => 'comment', + '©wrn' => 'warning', + '©hst' => 'host_computer', + '©mak' => 'make', + '©mod' => 'model', + '©PRD' => 'product', + '©swr' => 'software', + '©aut' => 'author', + '©ART' => 'artist', + '©trk' => 'track', + '©alb' => 'album', + '©com' => 'comment', + '©gen' => 'genre', + '©ope' => 'composer', + '©url' => 'url', + '©enc' => 'encoder' + ); + + if (isset($translator[$key_name])) { + $this->getid3->info['quicktime']['comments'][$translator[$key_name]][] = $data; + } + + return true; + } + + + + public static function QuicktimeLanguageLookup($language_id) { + + static $lookup = array ( + 0 => 'English', + 1 => 'French', + 2 => 'German', + 3 => 'Italian', + 4 => 'Dutch', + 5 => 'Swedish', + 6 => 'Spanish', + 7 => 'Danish', + 8 => 'Portuguese', + 9 => 'Norwegian', + 10 => 'Hebrew', + 11 => 'Japanese', + 12 => 'Arabic', + 13 => 'Finnish', + 14 => 'Greek', + 15 => 'Icelandic', + 16 => 'Maltese', + 17 => 'Turkish', + 18 => 'Croatian', + 19 => 'Chinese (Traditional)', + 20 => 'Urdu', + 21 => 'Hindi', + 22 => 'Thai', + 23 => 'Korean', + 24 => 'Lithuanian', + 25 => 'Polish', + 26 => 'Hungarian', + 27 => 'Estonian', + 28 => 'Lettish', + 28 => 'Latvian', + 29 => 'Saamisk', + 29 => 'Lappish', + 30 => 'Faeroese', + 31 => 'Farsi', + 31 => 'Persian', + 32 => 'Russian', + 33 => 'Chinese (Simplified)', + 34 => 'Flemish', + 35 => 'Irish', + 36 => 'Albanian', + 37 => 'Romanian', + 38 => 'Czech', + 39 => 'Slovak', + 40 => 'Slovenian', + 41 => 'Yiddish', + 42 => 'Serbian', + 43 => 'Macedonian', + 44 => 'Bulgarian', + 45 => 'Ukrainian', + 46 => 'Byelorussian', + 47 => 'Uzbek', + 48 => 'Kazakh', + 49 => 'Azerbaijani', + 50 => 'AzerbaijanAr', + 51 => 'Armenian', + 52 => 'Georgian', + 53 => 'Moldavian', + 54 => 'Kirghiz', + 55 => 'Tajiki', + 56 => 'Turkmen', + 57 => 'Mongolian', + 58 => 'MongolianCyr', + 59 => 'Pashto', + 60 => 'Kurdish', + 61 => 'Kashmiri', + 62 => 'Sindhi', + 63 => 'Tibetan', + 64 => 'Nepali', + 65 => 'Sanskrit', + 66 => 'Marathi', + 67 => 'Bengali', + 68 => 'Assamese', + 69 => 'Gujarati', + 70 => 'Punjabi', + 71 => 'Oriya', + 72 => 'Malayalam', + 73 => 'Kannada', + 74 => 'Tamil', + 75 => 'Telugu', + 76 => 'Sinhalese', + 77 => 'Burmese', + 78 => 'Khmer', + 79 => 'Lao', + 80 => 'Vietnamese', + 81 => 'Indonesian', + 82 => 'Tagalog', + 83 => 'MalayRoman', + 84 => 'MalayArabic', + 85 => 'Amharic', + 86 => 'Tigrinya', + 87 => 'Galla', + 87 => 'Oromo', + 88 => 'Somali', + 89 => 'Swahili', + 90 => 'Ruanda', + 91 => 'Rundi', + 92 => 'Chewa', + 93 => 'Malagasy', + 94 => 'Esperanto', + 128 => 'Welsh', + 129 => 'Basque', + 130 => 'Catalan', + 131 => 'Latin', + 132 => 'Quechua', + 133 => 'Guarani', + 134 => 'Aymara', + 135 => 'Tatar', + 136 => 'Uighur', + 137 => 'Dzongkha', + 138 => 'JavaneseRom' + ); + + return (isset($lookup[$language_id]) ? $lookup[$language_id] : 'invalid'); + } + + + + public static function QuicktimeVideoCodecLookup($codec_id) { + + static $lookup = array ( + '3IVX' => '3ivx MPEG-4', + '3IV1' => '3ivx MPEG-4 v1', + '3IV2' => '3ivx MPEG-4 v2', + 'avr ' => 'AVR-JPEG', + 'base' => 'Base', + 'WRLE' => 'BMP', + 'cvid' => 'Cinepak', + 'clou' => 'Cloud', + 'cmyk' => 'CMYK', + 'yuv2' => 'ComponentVideo', + 'yuvu' => 'ComponentVideoSigned', + 'yuvs' => 'ComponentVideoUnsigned', + 'dvc ' => 'DVC-NTSC', + 'dvcp' => 'DVC-PAL', + 'dvpn' => 'DVCPro-NTSC', + 'dvpp' => 'DVCPro-PAL', + 'fire' => 'Fire', + 'flic' => 'FLC', + 'b48r' => '48RGB', + 'gif ' => 'GIF', + 'smc ' => 'Graphics', + 'h261' => 'H261', + 'h263' => 'H263', + 'IV41' => 'Indeo4', + 'jpeg' => 'JPEG', + 'PNTG' => 'MacPaint', + 'msvc' => 'Microsoft Video1', + 'mjpa' => 'Motion JPEG-A', + 'mjpb' => 'Motion JPEG-B', + 'myuv' => 'MPEG YUV420', + 'dmb1' => 'OpenDML JPEG', + 'kpcd' => 'PhotoCD', + '8BPS' => 'Planar RGB', + 'png ' => 'PNG', + 'qdrw' => 'QuickDraw', + 'qdgx' => 'QuickDrawGX', + 'raw ' => 'RAW', + '.SGI' => 'SGI', + 'b16g' => '16Gray', + 'b64a' => '64ARGB', + 'SVQ1' => 'Sorenson Video 1', + 'SVQ1' => 'Sorenson Video 3', + 'syv9' => 'Sorenson YUV9', + 'tga ' => 'Targa', + 'b32a' => '32AlphaGray', + 'tiff' => 'TIFF', + 'path' => 'Vector', + 'rpza' => 'Video', + 'ripl' => 'WaterRipple', + 'WRAW' => 'Windows RAW', + 'y420' => 'YUV420' + ); + + return (isset($lookup[$codec_id]) ? $lookup[$codec_id] : ''); + } + + + + public static function QuicktimeAudioCodecLookup($codec_id) { + + static $lookup = array ( + '.mp3' => 'Fraunhofer MPEG Layer-III alias', + 'aac ' => 'ISO/IEC 14496-3 AAC', + 'agsm' => 'Apple GSM 10:1', + 'alac' => 'Apple Lossless Audio Codec', + 'alaw' => 'A-law 2:1', + 'conv' => 'Sample Format', + 'dvca' => 'DV', + 'dvi ' => 'DV 4:1', + 'eqal' => 'Frequency Equalizer', + 'fl32' => '32-bit Floating Point', + 'fl64' => '64-bit Floating Point', + 'ima4' => 'Interactive Multimedia Association 4:1', + 'in24' => '24-bit Integer', + 'in32' => '32-bit Integer', + 'lpc ' => 'LPC 23:1', + 'MAC3' => 'Macintosh Audio Compression/Expansion (MACE) 3:1', + 'MAC6' => 'Macintosh Audio Compression/Expansion (MACE) 6:1', + 'mixb' => '8-bit Mixer', + 'mixw' => '16-bit Mixer', + 'mp4a' => 'ISO/IEC 14496-3 AAC', + "MS'\x00\x02" => 'Microsoft ADPCM', + "MS'\x00\x11" => 'DV IMA', + "MS\x00\x55" => 'Fraunhofer MPEG Layer III', + 'NONE' => 'No Encoding', + 'Qclp' => 'Qualcomm PureVoice', + 'QDM2' => 'QDesign Music 2', + 'QDMC' => 'QDesign Music 1', + 'ratb' => '8-bit Rate', + 'ratw' => '16-bit Rate', + 'raw ' => 'raw PCM', + 'sour' => 'Sound Source', + 'sowt' => 'signed/two\'s complement (Little Endian)', + 'str1' => 'Iomega MPEG layer II', + 'str2' => 'Iomega MPEG *layer II', + 'str3' => 'Iomega MPEG **layer II', + 'str4' => 'Iomega MPEG ***layer II', + 'twos' => 'signed/two\'s complement (Big Endian)', + 'ulaw' => 'mu-law 2:1', + ); + + return (isset($lookup[$codec_id]) ? $lookup[$codec_id] : ''); + } + + + + public static function QuicktimeDCOMLookup($compression_id) { + + static $lookup = array ( + 'zlib' => 'ZLib Deflate', + 'adec' => 'Apple Compression' + ); + + return (isset($lookup[$compression_id]) ? $lookup[$compression_id] : ''); + } + + + + public static function QuicktimeColorNameLookup($color_depth_id) { + + static $lookup = array ( + 1 => '2-color (monochrome)', + 2 => '4-color', + 4 => '16-color', + 8 => '256-color', + 16 => 'thousands (16-bit color)', + 24 => 'millions (24-bit color)', + 32 => 'millions+ (32-bit color)', + 33 => 'black & white', + 34 => '4-gray', + 36 => '16-gray', + 40 => '256-gray', + ); + + return (isset($lookup[$color_depth_id]) ? $lookup[$color_depth_id] : 'invalid'); + } + + + + public static function NoNullString($null_terminated_string) { + + // remove the single null terminator on null terminated strings + if (substr($null_terminated_string, strlen($null_terminated_string) - 1, 1) === "\x00") { + return substr($null_terminated_string, 0, strlen($null_terminated_string) - 1); + } + + return $null_terminated_string; + } + + + + public static function FixedPoint8_8($raw_data) { + + return getid3_lib::BigEndian2Int($raw_data{0}) + (float)(getid3_lib::BigEndian2Int($raw_data{1}) / 256); + } + + + + public static function FixedPoint16_16($raw_data) { + + return getid3_lib::BigEndian2Int(substr($raw_data, 0, 2)) + (float)(getid3_lib::BigEndian2Int(substr($raw_data, 2, 2)) / 65536); + } + + + + public static function FixedPoint2_30($raw_data) { + + $binary_string = getid3_lib::BigEndian2Bin($raw_data); + return bindec(substr($binary_string, 0, 2)) + (float)(bindec(substr($binary_string, 2, 30)) / 1073741824); + } + +} + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.audio-video.real.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.audio-video.real.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,591 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio-video.real.php | +// | Module for analyzing Real Audio/Video files | +// | dependencies: module.audio-video.riff.php | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio-video.real.php,v 1.4 2006/11/02 10:48:00 ah Exp $ + + + +class getid3_real extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->include_module('audio-video.riff'); + + $getid3->info['fileformat'] = 'real'; + $getid3->info['bitrate'] = 0; + $getid3->info['playtime_seconds'] = 0; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $chunk_counter = 0; + + while (ftell($getid3->fp) < $getid3->info['avdataend']) { + + $chunk_data = fread($getid3->fp, 8); + $chunk_name = substr($chunk_data, 0, 4); + $chunk_size = getid3_lib::BigEndian2Int(substr($chunk_data, 4, 4)); + + if ($chunk_name == '.ra'."\xFD") { + $chunk_data .= fread($getid3->fp, $chunk_size - 8); + + if ($this->ParseOldRAheader(substr($chunk_data, 0, 128), $getid3->info['real']['old_ra_header'])) { + + $getid3->info['audio']['dataformat'] = 'real'; + $getid3->info['audio']['lossless'] = false; + $getid3->info['audio']['sample_rate'] = $getid3->info['real']['old_ra_header']['sample_rate']; + $getid3->info['audio']['bits_per_sample'] = $getid3->info['real']['old_ra_header']['bits_per_sample']; + $getid3->info['audio']['channels'] = $getid3->info['real']['old_ra_header']['channels']; + + $getid3->info['playtime_seconds'] = 60 * ($getid3->info['real']['old_ra_header']['audio_bytes'] / $getid3->info['real']['old_ra_header']['bytes_per_minute']); + $getid3->info['audio']['bitrate'] = 8 * ($getid3->info['real']['old_ra_header']['audio_bytes'] / $getid3->info['playtime_seconds']); + $getid3->info['audio']['codec'] = $this->RealAudioCodecFourCClookup($getid3->info['real']['old_ra_header']['fourcc'], $getid3->info['audio']['bitrate']); + + foreach ($getid3->info['real']['old_ra_header']['comments'] as $key => $value_array) { + + if (strlen(trim($value_array[0])) > 0) { + $getid3->info['real']['comments'][$key][] = trim($value_array[0]); + } + } + return true; + } + + throw new getid3_exception('There was a problem parsing this RealAudio file. Please submit it for analysis to http://www.getid3.org/upload/ or info@getid3.org'); + } + + $getid3->info['real']['chunks'][$chunk_counter] = array (); + $info_real_chunks_current_chunk = &$getid3->info['real']['chunks'][$chunk_counter]; + + $info_real_chunks_current_chunk['name'] = $chunk_name; + $info_real_chunks_current_chunk['offset'] = ftell($getid3->fp) - 8; + $info_real_chunks_current_chunk['length'] = $chunk_size; + + if (($info_real_chunks_current_chunk['offset'] + $info_real_chunks_current_chunk['length']) > $getid3->info['avdataend']) { + $getid3->warning('Chunk "'.$info_real_chunks_current_chunk['name'].'" at offset '.$info_real_chunks_current_chunk['offset'].' claims to be '.$info_real_chunks_current_chunk['length'].' bytes long, which is beyond end of file'); + return false; + } + + if ($chunk_size > (getid3::FREAD_BUFFER_SIZE + 8)) { + $chunk_data .= fread($getid3->fp, getid3::FREAD_BUFFER_SIZE - 8); + fseek($getid3->fp, $info_real_chunks_current_chunk['offset'] + $chunk_size, SEEK_SET); + + } elseif(($chunk_size - 8) > 0) { + $chunk_data .= fread($getid3->fp, $chunk_size - 8); + } + $offset = 8; + + switch ($chunk_name) { + + case '.RMF': // RealMedia File Header + + $info_real_chunks_current_chunk['object_version'] = getid3_lib::BigEndian2Int(substr($chunk_data, $offset, 2)); + $offset += 2; + + switch ($info_real_chunks_current_chunk['object_version']) { + + case 0: + $info_real_chunks_current_chunk['file_version'] = getid3_lib::BigEndian2Int(substr($chunk_data, $offset, 4)); + $offset += 4; + + $info_real_chunks_current_chunk['headers_count'] = getid3_lib::BigEndian2Int(substr($chunk_data, $offset, 4)); + $offset += 4; + break; + + default: + //$getid3->warning('Expected .RMF-object_version to be "0", actual value is "'.$info_real_chunks_current_chunk['object_version'].'" (should not be a problem)'; + break; + + } + break; + + + case 'PROP': // Properties Header + + $info_real_chunks_current_chunk['object_version'] = getid3_lib::BigEndian2Int(substr($chunk_data, $offset, 2)); + $offset += 2; + + if ($info_real_chunks_current_chunk['object_version'] == 0) { + + getid3_lib::ReadSequence('BigEndian2Int', $info_real_chunks_current_chunk, $chunk_data, $offset, + array ( + 'max_bit_rate' => 4, + 'avg_bit_rate' => 4, + 'max_packet_size' => 4, + 'avg_packet_size' => 4, + 'num_packets' => 4, + 'duration' => 4, + 'preroll' => 4, + 'index_offset' => 4, + 'data_offset' => 4, + 'num_streams' => 2, + 'flags_raw' => 2 + ) + ); + $offset += 40; + + $getid3->info['playtime_seconds'] = $info_real_chunks_current_chunk['duration'] / 1000; + if ($info_real_chunks_current_chunk['duration'] > 0) { + $getid3->info['bitrate'] += $info_real_chunks_current_chunk['avg_bit_rate']; + } + + $info_real_chunks_current_chunk['flags']['save_enabled'] = (bool)($info_real_chunks_current_chunk['flags_raw'] & 0x0001); + $info_real_chunks_current_chunk['flags']['perfect_play'] = (bool)($info_real_chunks_current_chunk['flags_raw'] & 0x0002); + $info_real_chunks_current_chunk['flags']['live_broadcast'] = (bool)($info_real_chunks_current_chunk['flags_raw'] & 0x0004); + } + break; + + + case 'MDPR': // Media Properties Header + + $info_real_chunks_current_chunk['object_version'] = getid3_lib::BigEndian2Int(substr($chunk_data, $offset, 2)); + $offset += 2; + + if ($info_real_chunks_current_chunk['object_version'] == 0) { + + getid3_lib::ReadSequence('BigEndian2Int', $info_real_chunks_current_chunk, $chunk_data, $offset, + array ( + 'stream_number' => 2, + 'max_bit_rate' => 4, + 'avg_bit_rate' => 4, + 'max_packet_size' => 4, + 'avg_packet_size' => 4, + 'start_time' => 4, + 'preroll' => 4, + 'duration' => 4, + 'stream_name_size' => 1 + ) + ); + $offset += 31; + + $info_real_chunks_current_chunk['stream_name'] = substr($chunk_data, $offset, $info_real_chunks_current_chunk['stream_name_size']); + $offset += $info_real_chunks_current_chunk['stream_name_size']; + + $info_real_chunks_current_chunk['mime_type_size'] = getid3_lib::BigEndian2Int($chunk_data{$offset++}); + + $info_real_chunks_current_chunk['mime_type'] = substr($chunk_data, $offset, $info_real_chunks_current_chunk['mime_type_size']); + $offset += $info_real_chunks_current_chunk['mime_type_size']; + + $info_real_chunks_current_chunk['type_specific_len'] = getid3_lib::BigEndian2Int(substr($chunk_data, $offset, 4)); + $offset += 4; + + $info_real_chunks_current_chunk['type_specific_data'] = substr($chunk_data, $offset, $info_real_chunks_current_chunk['type_specific_len']); + $offset += $info_real_chunks_current_chunk['type_specific_len']; + + $info_real_chunks_current_chunk_typespecificdata = &$info_real_chunks_current_chunk['type_specific_data']; + + switch ($info_real_chunks_current_chunk['mime_type']) { + + case 'video/x-pn-realvideo': + case 'video/x-pn-multirate-realvideo': + // http://www.freelists.org/archives/matroska-devel/07-2003/msg00010.html + + $info_real_chunks_current_chunk['video_info'] = array (); + $info_real_chunks_current_chunk_video_info = &$info_real_chunks_current_chunk['video_info']; + + getid3_lib::ReadSequence('BigEndian2Int', $info_real_chunks_current_chunk_video_info, $info_real_chunks_current_chunk_typespecificdata, 0, + array ( + 'dwSize' => 4, + 'fourcc1' => -4, + 'fourcc2' => -4, + 'width' => 2, + 'height' => 2, + 'bits_per_sample' => 2, + 'IGNORE-unknown1' => 2, + 'IGNORE-unknown2' => 2, + 'frames_per_second' => 2, + 'IGNORE-unknown3' => 2, + 'IGNORE-unknown4' => 2, + 'IGNORE-unknown5' => 2, + 'IGNORE-unknown6' => 2, + 'IGNORE-unknown7' => 2, + 'IGNORE-unknown8' => 2, + 'IGNORE-unknown9' => 2 + ) + ); + + $info_real_chunks_current_chunk_video_info['codec'] = getid3_riff::RIFFfourccLookup($info_real_chunks_current_chunk_video_info['fourcc2']); + + $getid3->info['video']['resolution_x'] = $info_real_chunks_current_chunk_video_info['width']; + $getid3->info['video']['resolution_y'] = $info_real_chunks_current_chunk_video_info['height']; + $getid3->info['video']['frame_rate'] = (float)$info_real_chunks_current_chunk_video_info['frames_per_second']; + $getid3->info['video']['codec'] = $info_real_chunks_current_chunk_video_info['codec']; + $getid3->info['video']['bits_per_sample'] = $info_real_chunks_current_chunk_video_info['bits_per_sample']; + break; + + + case 'audio/x-pn-realaudio': + case 'audio/x-pn-multirate-realaudio': + + $this->ParseOldRAheader($info_real_chunks_current_chunk_typespecificdata, $info_real_chunks_current_chunk['parsed_audio_data']); + + $getid3->info['audio']['sample_rate'] = $info_real_chunks_current_chunk['parsed_audio_data']['sample_rate']; + $getid3->info['audio']['bits_per_sample'] = $info_real_chunks_current_chunk['parsed_audio_data']['bits_per_sample']; + $getid3->info['audio']['channels'] = $info_real_chunks_current_chunk['parsed_audio_data']['channels']; + + if (!empty($getid3->info['audio']['dataformat'])) { + foreach ($getid3->info['audio'] as $key => $value) { + if ($key != 'streams') { + $getid3->info['audio']['streams'][$info_real_chunks_current_chunk['stream_number']][$key] = $value; + } + } + } + break; + + + case 'logical-fileinfo': + + $info_real_chunks_current_chunk['logical_fileinfo']['logical_fileinfo_length'] = getid3_lib::BigEndian2Int(substr($info_real_chunks_current_chunk_typespecificdata, 0, 4)); + // $info_real_chunks_current_chunk['logical_fileinfo']['IGNORE-unknown1'] = getid3_lib::BigEndian2Int(substr($info_real_chunks_current_chunk_typespecificdata, 4, 4)); + $info_real_chunks_current_chunk['logical_fileinfo']['num_tags'] = getid3_lib::BigEndian2Int(substr($info_real_chunks_current_chunk_typespecificdata, 8, 4)); + // $info_real_chunks_current_chunk['logical_fileinfo']['IGNORE-unknown2'] = getid3_lib::BigEndian2Int(substr($info_real_chunks_current_chunk_typespecificdata, 12, 4)); + break; + + } + + + if (empty($getid3->info['playtime_seconds'])) { + $getid3->info['playtime_seconds'] = max($getid3->info['playtime_seconds'], ($info_real_chunks_current_chunk['duration'] + $info_real_chunks_current_chunk['start_time']) / 1000); + } + + if ($info_real_chunks_current_chunk['duration'] > 0) { + + switch ($info_real_chunks_current_chunk['mime_type']) { + + case 'audio/x-pn-realaudio': + case 'audio/x-pn-multirate-realaudio': + + $getid3->info['audio']['bitrate'] = (isset($getid3->info['audio']['bitrate']) ? $getid3->info['audio']['bitrate'] : 0) + $info_real_chunks_current_chunk['avg_bit_rate']; + $getid3->info['audio']['codec'] = $this->RealAudioCodecFourCClookup($info_real_chunks_current_chunk['parsed_audio_data']['fourcc'], $getid3->info['audio']['bitrate']); + $getid3->info['audio']['dataformat'] = 'real'; + $getid3->info['audio']['lossless'] = false; + break; + + + case 'video/x-pn-realvideo': + case 'video/x-pn-multirate-realvideo': + + $getid3->info['video']['bitrate'] = (isset($getid3->info['video']['bitrate']) ? $getid3->info['video']['bitrate'] : 0) + $info_real_chunks_current_chunk['avg_bit_rate']; + $getid3->info['video']['bitrate_mode'] = 'cbr'; + $getid3->info['video']['dataformat'] = 'real'; + $getid3->info['video']['lossless'] = false; + $getid3->info['video']['pixel_aspect_ratio'] = (float)1; + break; + + + case 'audio/x-ralf-mpeg4-generic': + + $getid3->info['audio']['bitrate'] = (isset($getid3->info['audio']['bitrate']) ? $getid3->info['audio']['bitrate'] : 0) + $info_real_chunks_current_chunk['avg_bit_rate']; + $getid3->info['audio']['codec'] = 'RealAudio Lossless'; + $getid3->info['audio']['dataformat'] = 'real'; + $getid3->info['audio']['lossless'] = true; + break; + + } + + $getid3->info['bitrate'] = (isset($getid3->info['video']['bitrate']) ? $getid3->info['video']['bitrate'] : 0) + (isset($getid3->info['audio']['bitrate']) ? $getid3->info['audio']['bitrate'] : 0); + } + } + break; + + + case 'CONT': // Content Description Header (text comments) + + $info_real_chunks_current_chunk['object_version'] = getid3_lib::BigEndian2Int(substr($chunk_data, $offset, 2)); + $offset += 2; + + if ($info_real_chunks_current_chunk['object_version'] == 0) { + + $info_real_chunks_current_chunk['title_len'] = getid3_lib::BigEndian2Int(substr($chunk_data, $offset, 2)); + $offset += 2; + + $info_real_chunks_current_chunk['title'] = (string) substr($chunk_data, $offset, $info_real_chunks_current_chunk['title_len']); + $offset += $info_real_chunks_current_chunk['title_len']; + + $info_real_chunks_current_chunk['artist_len'] = getid3_lib::BigEndian2Int(substr($chunk_data, $offset, 2)); + $offset += 2; + + $info_real_chunks_current_chunk['artist'] = (string) substr($chunk_data, $offset, $info_real_chunks_current_chunk['artist_len']); + $offset += $info_real_chunks_current_chunk['artist_len']; + + $info_real_chunks_current_chunk['copyright_len'] = getid3_lib::BigEndian2Int(substr($chunk_data, $offset, 2)); + $offset += 2; + + $info_real_chunks_current_chunk['copyright'] = (string) substr($chunk_data, $offset, $info_real_chunks_current_chunk['copyright_len']); + $offset += $info_real_chunks_current_chunk['copyright_len']; + + $info_real_chunks_current_chunk['comment_len'] = getid3_lib::BigEndian2Int(substr($chunk_data, $offset, 2)); + $offset += 2; + + $info_real_chunks_current_chunk['comment'] = (string) substr($chunk_data, $offset, $info_real_chunks_current_chunk['comment_len']); + $offset += $info_real_chunks_current_chunk['comment_len']; + + foreach (array ('title'=>'title', 'artist'=>'artist', 'copyright'=>'copyright', 'comment'=>'comment') as $key => $val) { + if ($info_real_chunks_current_chunk[$key]) { + $getid3->info['real']['comments'][$val][] = trim($info_real_chunks_current_chunk[$key]); + } + } + } + break; + + + case 'DATA': // Data Chunk Header + + // do nothing + break; + + + case 'INDX': // Index Section Header + + $info_real_chunks_current_chunk['object_version'] = getid3_lib::BigEndian2Int(substr($chunk_data, $offset, 2)); + $offset += 2; + + if ($info_real_chunks_current_chunk['object_version'] == 0) { + + getid3_lib::ReadSequence('BigEndian2Int', $info_real_chunks_current_chunk, $chunk_data, $offset, + array ( + 'num_indices' => 4, + 'stream_number' => 2, + 'next_index_header' => 4 + ) + ); + $offset += 10; + + if ($info_real_chunks_current_chunk['next_index_header'] == 0) { + // last index chunk found, ignore rest of file + break 2; + } else { + // non-last index chunk, seek to next index chunk (skipping actual index data) + fseek($getid3->fp, $info_real_chunks_current_chunk['next_index_header'], SEEK_SET); + } + } + break; + + + default: + $getid3->warning('Unhandled RealMedia chunk "'.$chunk_name.'" at offset '.$info_real_chunks_current_chunk['offset']); + break; + } + $chunk_counter++; + } + + if (!empty($getid3->info['audio']['streams'])) { + + $getid3->info['audio']['bitrate'] = 0; + + foreach ($getid3->info['audio']['streams'] as $key => $value_array) { + $getid3->info['audio']['bitrate'] += $value_array['bitrate']; + } + } + + return true; + } + + + + public static function ParseOldRAheader($old_ra_header_data, &$parsed_array) { + + // http://www.freelists.org/archives/matroska-devel/07-2003/msg00010.html + + $parsed_array = array (); + $parsed_array['magic'] = substr($old_ra_header_data, 0, 4); + + if ($parsed_array['magic'] != '.ra'."\xFD") { + return false; + } + + $parsed_array['version1'] = getid3_lib::BigEndian2Int(substr($old_ra_header_data, 4, 2)); + + if ($parsed_array['version1'] < 3) { + + return false; + } + + if ($parsed_array['version1'] == 3) { + + $parsed_array['fourcc1'] = '.ra3'; + $parsed_array['bits_per_sample'] = 16; // hard-coded for old versions? + $parsed_array['sample_rate'] = 8000; // hard-coded for old versions? + + getid3_lib::ReadSequence('BigEndian2Int', $parsed_array, $old_ra_header_data, 6, + array ( + 'header_size' => 2, + 'channels' => 2, // always 1 (?) + 'IGNORE-unknown1' => 2, + 'IGNORE-unknown2' => 2, + 'IGNORE-unknown3' => 2, + 'bytes_per_minute' => 2, + 'audio_bytes' => 4, + ) + ); + + $parsed_array['comments_raw'] = substr($old_ra_header_data, 22, $parsed_array['header_size'] - 22 + 1); // not including null terminator + + $comment_offset = 0; + + foreach (array ('title', 'artist', 'copyright') as $name) { + $comment_length = getid3_lib::BigEndian2Int($parsed_array['comments_raw']{$comment_offset++}); + $parsed_array['comments'][$name][]= substr($parsed_array['comments_raw'], $comment_offset, $comment_length); + $comment_offset += $comment_length; + } + + $comment_offset++; // final null terminator (?) + $comment_offset++; // fourcc length (?) should be 4 + + $parsed_array['fourcc'] = substr($old_ra_header_data, 23 + $comment_offset, 4); + + + } elseif ($parsed_array['version1'] <= 5) { + + getid3_lib::ReadSequence('BigEndian2Int', $parsed_array, $old_ra_header_data, 6, + array ( + 'IGNORE-unknown1' => 2, + 'fourcc1' => -4, + 'file_size' => 4, + 'version2' => 2, + 'header_size' => 4, + 'codec_flavor_id' => 2, + 'coded_frame_size' => 4, + 'audio_bytes' => 4, + 'bytes_per_minute' => 4, + 'IGNORE-unknown5' => 4, + 'sub_packet_h' => 2, + 'frame_size' => 2, + 'sub_packet_size' => 2, + 'IGNORE-unknown6' => 2 + ) + ); + + switch ($parsed_array['version1']) { + + case 4: + + getid3_lib::ReadSequence('BigEndian2Int', $parsed_array, $old_ra_header_data, 48, + array ( + 'sample_rate' => 2, + 'IGNORE-unknown8' => 2, + 'bits_per_sample' => 2, + 'channels' => 2, + 'length_fourcc2' => 1, + 'fourcc2' => -4, + 'length_fourcc3' => 1, + 'fourcc3' => -4, + 'IGNORE-unknown9' => 1, + 'IGNORE-unknown10' => 2, + ) + ); + + $parsed_array['comments_raw'] = substr($old_ra_header_data, 69, $parsed_array['header_size'] - 69 + 16); + + $comment_offset = 0; + + foreach (array ('title', 'artist', 'copyright') as $name) { + $comment_length = getid3_lib::BigEndian2Int($parsed_array['comments_raw']{$comment_offset++}); + $parsed_array['comments'][$name][]= substr($parsed_array['comments_raw'], $comment_offset, $comment_length); + $comment_offset += $comment_length; + } + break; + + + case 5: + + getid3_lib::ReadSequence('BigEndian2Int', $parsed_array, $old_ra_header_data, 48, + array ( + 'sample_rate' => 4, + 'sample_rate2' => 4, + 'bits_per_sample' => 4, + 'channels' => 2, + 'genr' => -4, + 'fourcc3' => -4, + ) + ); + $parsed_array['comments'] = array (); + break; + + } + + $parsed_array['fourcc'] = $parsed_array['fourcc3']; + + } + + foreach ($parsed_array['comments'] as $key => $value) { + + if ($parsed_array['comments'][$key][0] === false) { + $parsed_array['comments'][$key][0] = ''; + } + } + + return true; + } + + + + public static function RealAudioCodecFourCClookup($fourcc, $bitrate) { + + // http://www.its.msstate.edu/net/real/reports/config/tags.stats + // http://www.freelists.org/archives/matroska-devel/06-2003/fullthread18.html + + static $lookup; + + if (empty($lookup)) { + $lookup['14_4'][8000] = 'RealAudio v2 (14.4kbps)'; + $lookup['14.4'][8000] = 'RealAudio v2 (14.4kbps)'; + $lookup['lpcJ'][8000] = 'RealAudio v2 (14.4kbps)'; + $lookup['28_8'][15200] = 'RealAudio v2 (28.8kbps)'; + $lookup['28.8'][15200] = 'RealAudio v2 (28.8kbps)'; + $lookup['sipr'][4933] = 'RealAudio v4 (5kbps Voice)'; + $lookup['sipr'][6444] = 'RealAudio v4 (6.5kbps Voice)'; + $lookup['sipr'][8444] = 'RealAudio v4 (8.5kbps Voice)'; + $lookup['sipr'][16000] = 'RealAudio v4 (16kbps Wideband)'; + $lookup['dnet'][8000] = 'RealAudio v3 (8kbps Music)'; + $lookup['dnet'][16000] = 'RealAudio v3 (16kbps Music Low Response)'; + $lookup['dnet'][15963] = 'RealAudio v3 (16kbps Music Mid/High Response)'; + $lookup['dnet'][20000] = 'RealAudio v3 (20kbps Music Stereo)'; + $lookup['dnet'][32000] = 'RealAudio v3 (32kbps Music Mono)'; + $lookup['dnet'][31951] = 'RealAudio v3 (32kbps Music Stereo)'; + $lookup['dnet'][39965] = 'RealAudio v3 (40kbps Music Mono)'; + $lookup['dnet'][40000] = 'RealAudio v3 (40kbps Music Stereo)'; + $lookup['dnet'][79947] = 'RealAudio v3 (80kbps Music Mono)'; + $lookup['dnet'][80000] = 'RealAudio v3 (80kbps Music Stereo)'; + + $lookup['dnet'][0] = 'RealAudio v3'; + $lookup['sipr'][0] = 'RealAudio v4'; + $lookup['cook'][0] = 'RealAudio G2'; + $lookup['atrc'][0] = 'RealAudio 8'; + } + + $round_bitrate = intval(round($bitrate)); + + if (isset($lookup[$fourcc][$round_bitrate])) { + return $lookup[$fourcc][$round_bitrate]; + } + + if (isset($lookup[$fourcc][0])) { + return $lookup[$fourcc][0]; + } + + return $fourcc; + } + +} + + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.audio-video.riff.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.audio-video.riff.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,2319 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio-video.riff.php | +// | module for analyzing RIFF files: | +// | Wave, AVI, AIFF/AIFC, (MP3,AC3)/RIFF, Wavpack3, 8SVX | +// | dependencies: module.audio.mp3.php (optional) | +// | module.audio.ac3.php (optional) | +// | module.audio.dts.php (optional) | +// | module.audio-video.mpeg.php (optional) | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio-video.riff.php,v 1.10 2006/12/03 20:13:17 ah Exp $ + + + +class getid3_riff extends getid3_handler +{ + + private $endian_function = 'LittleEndian2Int'; + + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->info['riff']['raw'] = array (); + $info_riff = &$getid3->info['riff']; + $info_riff_raw = &$info_riff['raw']; + $info_audio = &$getid3->info['audio']; + $info_video = &$getid3->info['video']; + $info_avdataoffset = &$getid3->info['avdataoffset']; + $info_avdataend = &$getid3->info['avdataend']; + $info_audio_dataformat = &$info_audio['dataformat']; + $info_riff_audio = &$info_riff['audio']; + $info_riff_video = &$info_riff['video']; + + $original['avdataend'] = $info_avdataend; + + $this->fseek($info_avdataoffset, SEEK_SET); + $riff_header = $this->fread(12); + + $riff_sub_type = substr($riff_header, 8, 4); + + switch (substr($riff_header, 0, 4)) { + + case 'FORM': + $getid3->info['fileformat'] = 'aiff'; + $this->endian_function = 'BigEndian2Int'; + $riff_header_size = getid3_lib::BigEndian2Int(substr($riff_header, 4, 4)); + $info_riff[$riff_sub_type] = $this->ParseRIFF($info_avdataoffset + 12, $info_avdataoffset + $riff_header_size); + $info_riff['header_size'] = $riff_header_size; + break; + + + case 'RIFF': + case 'SDSS': // SDSS is identical to RIFF, just renamed. Used by SmartSound QuickTracks (www.smartsound.com) + case 'RMP3': // RMP3 is identical to RIFF, just renamed. Used by [unknown program] when creating RIFF-MP3s + + if ($riff_sub_type == 'RMP3') { + $riff_sub_type = 'WAVE'; + } + + $getid3->info['fileformat'] = 'riff'; + $this->endian_function = 'LittleEndian2Int'; + $riff_header_size = getid3_lib::LittleEndian2Int(substr($riff_header, 4, 4)); + $info_riff[$riff_sub_type] = $this->ParseRIFF($info_avdataoffset + 12, $info_avdataoffset + $riff_header_size); + $info_riff['header_size'] = $riff_header_size; + if ($riff_sub_type == 'WAVE') { + $info_riff_wave = &$info_riff['WAVE']; + } + break; + + + default: + throw new getid3_exception('Cannot parse RIFF (this is maybe not a RIFF / WAV / AVI file?) - expecting "FORM|RIFF|SDSS|RMP3" found "'.$riff_sub_type.'" instead'); + } + + $endian_function = $this->endian_function; + + $stream_index = 0; + switch ($riff_sub_type) { + + case 'WAVE': + + if (empty($info_audio['bitrate_mode'])) { + $info_audio['bitrate_mode'] = 'cbr'; + } + + if (empty($info_audio_dataformat)) { + $info_audio_dataformat = 'wav'; + } + + if (isset($info_riff_wave['data'][0]['offset'])) { + $info_avdataoffset = $info_riff_wave['data'][0]['offset'] + 8; + $info_avdataend = $info_avdataoffset + $info_riff_wave['data'][0]['size']; + } + + if (isset($info_riff_wave['fmt '][0]['data'])) { + + $info_riff_audio[$stream_index] = getid3_riff::RIFFparseWAVEFORMATex($info_riff_wave['fmt '][0]['data']); + $info_audio['wformattag'] = $info_riff_audio[$stream_index]['raw']['wFormatTag']; + $info_riff_raw['fmt '] = $info_riff_audio[$stream_index]['raw']; + unset($info_riff_audio[$stream_index]['raw']); + $info_audio['streams'][$stream_index] = $info_riff_audio[$stream_index]; + + $info_audio = getid3_riff::array_merge_noclobber($info_audio, $info_riff_audio[$stream_index]); + if (substr($info_audio['codec'], 0, strlen('unknown: 0x')) == 'unknown: 0x') { + $getid3->warning('Audio codec = '.$info_audio['codec']); + } + $info_audio['bitrate'] = $info_riff_audio[$stream_index]['bitrate']; + + $getid3->info['playtime_seconds'] = (float)((($info_avdataend - $info_avdataoffset) * 8) / $info_audio['bitrate']); + + $info_audio['lossless'] = false; + + if (isset($info_riff_wave['data'][0]['offset']) && isset($info_riff_raw['fmt ']['wFormatTag'])) { + + switch ($info_riff_raw['fmt ']['wFormatTag']) { + + case 0x0001: // PCM + $info_audio['lossless'] = true; + break; + + case 0x2000: // AC-3 + $info_audio_dataformat = 'ac3'; + break; + + default: + // do nothing + break; + + } + } + + $info_audio['streams'][$stream_index]['wformattag'] = $info_audio['wformattag']; + $info_audio['streams'][$stream_index]['bitrate_mode'] = $info_audio['bitrate_mode']; + $info_audio['streams'][$stream_index]['lossless'] = $info_audio['lossless']; + $info_audio['streams'][$stream_index]['dataformat'] = $info_audio_dataformat; + } + + + if (isset($info_riff_wave['rgad'][0]['data'])) { + + // shortcuts + $rgadData = &$info_riff_wave['rgad'][0]['data']; + $info_riff_raw['rgad'] = array ('track'=>array(), 'album'=>array()); + $info_riff_raw_rgad = &$info_riff_raw['rgad']; + $info_riff_raw_rgad_track = &$info_riff_raw_rgad['track']; + $info_riff_raw_rgad_album = &$info_riff_raw_rgad['album']; + + $info_riff_raw_rgad['fPeakAmplitude'] = getid3_riff::BigEndian2Float(strrev(substr($rgadData, 0, 4))); // LittleEndian2Float() + $info_riff_raw_rgad['nRadioRgAdjust'] = getid3_lib::$endian_function(substr($rgadData, 4, 2)); + $info_riff_raw_rgad['nAudiophileRgAdjust'] = getid3_lib::$endian_function(substr($rgadData, 6, 2)); + + $n_track_rg_adjust_bit_string = str_pad(decbin($info_riff_raw_rgad['nRadioRgAdjust']), 16, '0', STR_PAD_LEFT); + $n_album_rg_adjust_bit_string = str_pad(decbin($info_riff_raw_rgad['nAudiophileRgAdjust']), 16, '0', STR_PAD_LEFT); + + $info_riff_raw_rgad_track['name'] = bindec(substr($n_track_rg_adjust_bit_string, 0, 3)); + $info_riff_raw_rgad_track['originator'] = bindec(substr($n_track_rg_adjust_bit_string, 3, 3)); + $info_riff_raw_rgad_track['signbit'] = bindec($n_track_rg_adjust_bit_string[6]); + $info_riff_raw_rgad_track['adjustment'] = bindec(substr($n_track_rg_adjust_bit_string, 7, 9)); + $info_riff_raw_rgad_album['name'] = bindec(substr($n_album_rg_adjust_bit_string, 0, 3)); + $info_riff_raw_rgad_album['originator'] = bindec(substr($n_album_rg_adjust_bit_string, 3, 3)); + $info_riff_raw_rgad_album['signbit'] = bindec($n_album_rg_adjust_bit_string[6]); + $info_riff_raw_rgad_album['adjustment'] = bindec(substr($n_album_rg_adjust_bit_string, 7, 9)); + + $info_riff['rgad']['peakamplitude'] = $info_riff_raw_rgad['fPeakAmplitude']; + if (($info_riff_raw_rgad_track['name'] != 0) && ($info_riff_raw_rgad_track['originator'] != 0)) { + $info_riff['rgad']['track']['name'] = getid3_lib_replaygain::NameLookup($info_riff_raw_rgad_track['name']); + $info_riff['rgad']['track']['originator'] = getid3_lib_replaygain::OriginatorLookup($info_riff_raw_rgad_track['originator']); + $info_riff['rgad']['track']['adjustment'] = getid3_lib_replaygain::AdjustmentLookup($info_riff_raw_rgad_track['adjustment'], $info_riff_raw_rgad_track['signbit']); + } + + if (($info_riff_raw_rgad_album['name'] != 0) && ($info_riff_raw_rgad_album['originator'] != 0)) { + $info_riff['rgad']['album']['name'] = getid3_lib_replaygain::NameLookup($info_riff_raw_rgad_album['name']); + $info_riff['rgad']['album']['originator'] = getid3_lib_replaygain::OriginatorLookup($info_riff_raw_rgad_album['originator']); + $info_riff['rgad']['album']['adjustment'] = getid3_lib_replaygain::AdjustmentLookup($info_riff_raw_rgad_album['adjustment'], $info_riff_raw_rgad_album['signbit']); + } + } + + if (isset($info_riff_wave['fact'][0]['data'])) { + + $info_riff_raw['fact']['NumberOfSamples'] = getid3_lib::$endian_function(substr($info_riff_wave['fact'][0]['data'], 0, 4)); + + // This should be a good way of calculating exact playtime, but some sample files have had incorrect number of samples, so cannot use this method + // if (!empty($info_riff_raw['fmt ']['nSamplesPerSec'])) { + // $getid3->info['playtime_seconds'] = (float)$info_riff_raw['fact']['NumberOfSamples'] / $info_riff_raw['fmt ']['nSamplesPerSec']; + // } + } + + + if (!empty($info_riff_raw['fmt ']['nAvgBytesPerSec'])) { + $info_audio['bitrate'] = (int)$info_riff_raw['fmt ']['nAvgBytesPerSec'] * 8; + } + + if (isset($info_riff_wave['bext'][0]['data'])) { + + $info_riff_wave_bext_0 = &$info_riff_wave['bext'][0]; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_riff_wave_bext_0, $info_riff_wave_bext_0['data'], 0, + array ( + 'title' => -256, + 'author' => -32, + 'reference' => -32, + 'origin_date' => -10, + 'origin_time' => -8, + 'time_reference' => 8, + 'bwf_version' => 1, + 'reserved' => 254 + ) + ); + + foreach (array ('title', 'author', 'reference') as $key) { + $info_riff_wave_bext_0[$key] = trim($info_riff_wave_bext_0[$key]); + } + + $info_riff_wave_bext_0['coding_history'] = explode("\r\n", trim(substr($info_riff_wave_bext_0['data'], 601))); + + $info_riff_wave_bext_0['origin_date_unix'] = gmmktime(substr($info_riff_wave_bext_0['origin_time'], 0, 2), + substr($info_riff_wave_bext_0['origin_time'], 3, 2), + substr($info_riff_wave_bext_0['origin_time'], 6, 2), + substr($info_riff_wave_bext_0['origin_date'], 5, 2), + substr($info_riff_wave_bext_0['origin_date'], 8, 2), + substr($info_riff_wave_bext_0['origin_date'], 0, 4)); + + $info_riff['comments']['author'][] = $info_riff_wave_bext_0['author']; + $info_riff['comments']['title'][] = $info_riff_wave_bext_0['title']; + } + + if (isset($info_riff_wave['MEXT'][0]['data'])) { + + $info_riff_wave_mext_0 = &$info_riff_wave['MEXT'][0]; + + $info_riff_wave_mext_0['raw']['sound_information'] = getid3_lib::LittleEndian2Int(substr($info_riff_wave_mext_0['data'], 0, 2)); + $info_riff_wave_mext_0['flags']['homogenous'] = (bool)($info_riff_wave_mext_0['raw']['sound_information'] & 0x0001); + if ($info_riff_wave_mext_0['flags']['homogenous']) { + $info_riff_wave_mext_0['flags']['padding'] = ($info_riff_wave_mext_0['raw']['sound_information'] & 0x0002) ? false : true; + $info_riff_wave_mext_0['flags']['22_or_44'] = (bool)($info_riff_wave_mext_0['raw']['sound_information'] & 0x0004); + $info_riff_wave_mext_0['flags']['free_format'] = (bool)($info_riff_wave_mext_0['raw']['sound_information'] & 0x0008); + + $info_riff_wave_mext_0['nominal_frame_size'] = getid3_lib::LittleEndian2Int(substr($info_riff_wave_mext_0['data'], 2, 2)); + } + $info_riff_wave_mext_0['anciliary_data_length'] = getid3_lib::LittleEndian2Int(substr($info_riff_wave_mext_0['data'], 6, 2)); + $info_riff_wave_mext_0['raw']['anciliary_data_def'] = getid3_lib::LittleEndian2Int(substr($info_riff_wave_mext_0['data'], 8, 2)); + $info_riff_wave_mext_0['flags']['anciliary_data_left'] = (bool)($info_riff_wave_mext_0['raw']['anciliary_data_def'] & 0x0001); + $info_riff_wave_mext_0['flags']['anciliary_data_free'] = (bool)($info_riff_wave_mext_0['raw']['anciliary_data_def'] & 0x0002); + $info_riff_wave_mext_0['flags']['anciliary_data_right'] = (bool)($info_riff_wave_mext_0['raw']['anciliary_data_def'] & 0x0004); + } + + if (isset($info_riff_wave['cart'][0]['data'])) { + + $info_riff_wave_cart_0 = &$info_riff_wave['cart'][0]; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_riff_wave_cart_0, $info_riff_wave_cart_0['data'], 0, + array ( + 'version' => -4, + 'title' => -64, + 'artist' => -64, + 'cut_id' => -64, + 'client_id' => -64, + 'category' => -64, + 'classification' => -64, + 'out_cue' => -64, + 'start_date' => -10, + 'start_time' => -8, + 'end_date' => -10, + 'end_time' => -8, + 'producer_app_id' => -64, + 'producer_app_version' => -64, + 'user_defined_text' => -64, + ) + ); + + foreach (array ('artist', 'cut_id', 'client_id', 'category', 'classification', 'out_cue', 'start_date', 'start_time', 'end_date', 'end_time', 'producer_app_id', 'producer_app_version', 'user_defined_text') as $key) { + $info_riff_wave_cart_0[$key] = trim($info_riff_wave_cart_0[$key]); + } + + $info_riff_wave_cart_0['zero_db_reference'] = getid3_lib::LittleEndian2Int(substr($info_riff_wave_cart_0['data'], 680, 4), true); + + for ($i = 0; $i < 8; $i++) { + $info_riff_wave_cart_0['post_time'][$i]['usage_fourcc'] = substr($info_riff_wave_cart_0['data'], 684 + ($i * 8), 4); + $info_riff_wave_cart_0['post_time'][$i]['timer_value'] = getid3_lib::LittleEndian2Int(substr($info_riff_wave_cart_0['data'], 684 + ($i * 8) + 4, 4)); + } + $info_riff_wave_cart_0['url'] = trim(substr($info_riff_wave_cart_0['data'], 748, 1024)); + $info_riff_wave_cart_0['tag_text'] = explode("\r\n", trim(substr($info_riff_wave_cart_0['data'], 1772))); + + $info_riff['comments']['artist'][] = $info_riff_wave_cart_0['artist']; + $info_riff['comments']['title'][] = $info_riff_wave_cart_0['title']; + } + + if (!isset($info_audio['bitrate']) && isset($info_riff_audio[$stream_index]['bitrate'])) { + $info_audio['bitrate'] = $info_riff_audio[$stream_index]['bitrate']; + $getid3->info['playtime_seconds'] = (float)((($info_avdataend - $info_avdataoffset) * 8) / $info_audio['bitrate']); + } + + if (@$getid3->info['wavpack']) { + + if (!$this->data_string_flag) { + + $info_audio_dataformat = 'wavpack'; + $info_audio['bitrate_mode'] = 'vbr'; + $info_audio['encoder'] = 'WavPack v'.$getid3->info['wavpack']['version']; + + // Reset to the way it was - RIFF parsing will have messed this up + $info_avdataend = $original['avdataend']; + $info_audio['bitrate'] = (($info_avdataend - $info_avdataoffset) * 8) / $getid3->info['playtime_seconds']; + + $this->fseek($info_avdataoffset - 44, SEEK_SET); + $riff_data = $this->fread(44); + $orignal_riff_header_size = getid3_lib::LittleEndian2Int(substr($riff_data, 4, 4)) + 8; + $orignal_riff_data_size = getid3_lib::LittleEndian2Int(substr($riff_data, 40, 4)) + 44; + + if ($orignal_riff_header_size > $orignal_riff_data_size) { + $info_avdataend -= ($orignal_riff_header_size - $orignal_riff_data_size); + $this->fseek($info_avdataend, SEEK_SET); + $riff_data .= $this->fread($orignal_riff_header_size - $orignal_riff_data_size); + } + + // move the data chunk after all other chunks (if any) + // so that the RIFF parser doesn't see EOF when trying + // to skip over the data chunk + $riff_data = substr($riff_data, 0, 36).substr($riff_data, 44).substr($riff_data, 36, 8); + + // Save audio info key + $saved_info_audio = $info_audio; + + // Analyze riff_data + $this->AnalyzeString($riff_data); + + // Restore info key + $info_audio = $saved_info_audio; + } + } + + if (isset($info_riff_raw['fmt ']['wFormatTag'])) { + + switch ($info_riff_raw['fmt ']['wFormatTag']) { + + case 0x08AE: // ClearJump LiteWave + $info_audio['bitrate_mode'] = 'vbr'; + $info_audio_dataformat = 'litewave'; + + //typedef struct tagSLwFormat { + // WORD m_wCompFormat; // low byte defines compression method, high byte is compression flags + // DWORD m_dwScale; // scale factor for lossy compression + // DWORD m_dwBlockSize; // number of samples in encoded blocks + // WORD m_wQuality; // alias for the scale factor + // WORD m_wMarkDistance; // distance between marks in bytes + // WORD m_wReserved; + // + // //following paramters are ignored if CF_FILESRC is not set + // DWORD m_dwOrgSize; // original file size in bytes + // WORD m_bFactExists; // indicates if 'fact' chunk exists in the original file + // DWORD m_dwRiffChunkSize; // riff chunk size in the original file + // + // PCMWAVEFORMAT m_OrgWf; // original wave format + // }SLwFormat, *PSLwFormat; + + $info_riff['litewave']['raw'] = array (); + $info_riff_litewave = &$info_riff['litewave']; + $info_riff_litewave_raw = &$info_riff_litewave['raw']; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_riff_litewave_raw, $info_riff_wave['fmt '][0]['data'], 18, + array ( + 'compression_method' => 1, + 'compression_flags' => 1, + 'm_dwScale' => 4, + 'm_dwBlockSize' => 4, + 'm_wQuality' => 2, + 'm_wMarkDistance' => 2, + 'm_wReserved' => 2, + 'm_dwOrgSize' => 4, + 'm_bFactExists' => 2, + 'm_dwRiffChunkSize' => 4 + ) + ); + + //$info_riff_litewave['quality_factor'] = intval(round((2000 - $info_riff_litewave_raw['m_dwScale']) / 20)); + $info_riff_litewave['quality_factor'] = $info_riff_litewave_raw['m_wQuality']; + + $info_riff_litewave['flags']['raw_source'] = ($info_riff_litewave_raw['compression_flags'] & 0x01) ? false : true; + $info_riff_litewave['flags']['vbr_blocksize'] = ($info_riff_litewave_raw['compression_flags'] & 0x02) ? false : true; + $info_riff_litewave['flags']['seekpoints'] = (bool)($info_riff_litewave_raw['compression_flags'] & 0x04); + + $info_audio['lossless'] = (($info_riff_litewave_raw['m_wQuality'] == 100) ? true : false); + $info_audio['encoder_options'] = '-q'.$info_riff_litewave['quality_factor']; + break; + } + } + + if ($info_avdataend > $getid3->info['filesize']) { + + switch (@$info_audio_dataformat) { + + case 'wavpack': // WavPack + case 'lpac': // LPAC + case 'ofr': // OptimFROG + case 'ofs': // OptimFROG DualStream + // lossless compressed audio formats that keep original RIFF headers - skip warning + break; + + + case 'litewave': + + if (($info_avdataend - $getid3->info['filesize']) == 1) { + // LiteWave appears to incorrectly *not* pad actual output file + // to nearest WORD boundary so may appear to be short by one + // byte, in which case - skip warning + } else { + // Short by more than one byte, throw warning + $getid3->warning('Probably truncated file - expecting '.$info_riff[$riff_sub_type]['data'][0]['size'].' bytes of data, only found '.($getid3->info['filesize'] - $info_avdataoffset).' (short by '.($info_riff[$riff_sub_type]['data'][0]['size'] - ($getid3->info['filesize'] - $info_avdataoffset)).' bytes)'); + } + break; + + + default: + + if ((($info_avdataend - $getid3->info['filesize']) == 1) && (($info_riff[$riff_sub_type]['data'][0]['size'] % 2) == 0) && ((($getid3->info['filesize'] - $info_avdataoffset) % 2) == 1)) { + // output file appears to be incorrectly *not* padded to nearest WORD boundary + // Output less severe warning + $getid3->warning('File should probably be padded to nearest WORD boundary, but it is not (expecting '.$info_riff[$riff_sub_type]['data'][0]['size'].' bytes of data, only found '.($getid3->info['filesize'] - $info_avdataoffset).' therefore short by '.($info_riff[$riff_sub_type]['data'][0]['size'] - ($getid3->info['filesize'] - $info_avdataoffset)).' bytes)'); + $info_avdataend = $getid3->info['filesize']; + break; + + } + // Short by more than one byte, throw warning + $getid3->warning('Probably truncated file - expecting '.$info_riff[$riff_sub_type]['data'][0]['size'].' bytes of data, only found '.($getid3->info['filesize'] - $info_avdataoffset).' (short by '.($info_riff[$riff_sub_type]['data'][0]['size'] - ($getid3->info['filesize'] - $info_avdataoffset)).' bytes)'); + $info_avdataend = $getid3->info['filesize']; + break; + } + } + + if (!empty($getid3->info['mpeg']['audio']['LAME']['audio_bytes'])) { + if ((($info_avdataend - $info_avdataoffset) - $getid3->info['mpeg']['audio']['LAME']['audio_bytes']) == 1) { + $info_avdataend--; + $getid3->warning('Extra null byte at end of MP3 data assumed to be RIFF padding and therefore ignored'); + } + } + + if (@$info_audio_dataformat == 'ac3') { + unset($info_audio['bits_per_sample']); + if (!empty($getid3->info['ac3']['bitrate']) && ($getid3->info['ac3']['bitrate'] != $info_audio['bitrate'])) { + $info_audio['bitrate'] = $getid3->info['ac3']['bitrate']; + } + } + break; + + + case 'AVI ': + $info_video['bitrate_mode'] = 'vbr'; // maybe not, but probably + $info_video['dataformat'] = 'avi'; + $getid3->info['mime_type'] = 'video/avi'; + + if (isset($info_riff[$riff_sub_type]['movi']['offset'])) { + $info_avdataoffset = $info_riff[$riff_sub_type]['movi']['offset'] + 8; + $info_avdataend = $info_avdataoffset + $info_riff[$riff_sub_type]['movi']['size']; + if ($info_avdataend > $getid3->info['filesize']) { + $getid3->warning('Probably truncated file - expecting '.$info_riff[$riff_sub_type]['movi']['size'].' bytes of data, only found '.($getid3->info['filesize'] - $info_avdataoffset).' (short by '.($info_riff[$riff_sub_type]['movi']['size'] - ($getid3->info['filesize'] - $info_avdataoffset)).' bytes)'); + $info_avdataend = $getid3->info['filesize']; + } + } + + if (isset($info_riff['AVI ']['hdrl']['avih'][$stream_index]['data'])) { + $avihData = $info_riff['AVI ']['hdrl']['avih'][$stream_index]['data']; + + $info_riff_raw['avih'] = array (); + $info_riff_raw_avih = &$info_riff_raw['avih']; + + getid3_lib::ReadSequence($this->endian_function, $info_riff_raw_avih, $avihData, 0, + array ( + 'dwMicroSecPerFrame' => 4, // frame display rate (or 0L) + 'dwMaxBytesPerSec' => 4, // max. transfer rate + 'dwPaddingGranularity' => 4, // pad to multiples of this size; normally 2K. + 'dwFlags' => 4, // the ever-present flags + 'dwTotalFrames' => 4, // # frames in file + 'dwInitialFrames' => 4, + 'dwStreams' => 4, + 'dwSuggestedBufferSize' => 4, + 'dwWidth' => 4, + 'dwHeight' => 4, + 'dwScale' => 4, + 'dwRate' => 4, + 'dwStart' => 4, + 'dwLength' => 4 + ) + ); + + $info_riff_raw_avih['flags']['hasindex'] = (bool)($info_riff_raw_avih['dwFlags'] & 0x00000010); + $info_riff_raw_avih['flags']['mustuseindex'] = (bool)($info_riff_raw_avih['dwFlags'] & 0x00000020); + $info_riff_raw_avih['flags']['interleaved'] = (bool)($info_riff_raw_avih['dwFlags'] & 0x00000100); + $info_riff_raw_avih['flags']['trustcktype'] = (bool)($info_riff_raw_avih['dwFlags'] & 0x00000800); + $info_riff_raw_avih['flags']['capturedfile'] = (bool)($info_riff_raw_avih['dwFlags'] & 0x00010000); + $info_riff_raw_avih['flags']['copyrighted'] = (bool)($info_riff_raw_avih['dwFlags'] & 0x00020010); + + $info_riff_video[$stream_index] = array (); + $info_riff_video_current = &$info_riff_video[$stream_index]; + + if ($info_riff_raw_avih['dwWidth'] > 0) { + $info_riff_video_current['frame_width'] = $info_riff_raw_avih['dwWidth']; + $info_video['resolution_x'] = $info_riff_video_current['frame_width']; + } + + if ($info_riff_raw_avih['dwHeight'] > 0) { + $info_riff_video_current['frame_height'] = $info_riff_raw_avih['dwHeight']; + $info_video['resolution_y'] = $info_riff_video_current['frame_height']; + } + + if ($info_riff_raw_avih['dwTotalFrames'] > 0) { + $info_riff_video_current['total_frames'] = $info_riff_raw_avih['dwTotalFrames']; + $info_video['total_frames'] = $info_riff_video_current['total_frames']; + } + + $info_riff_video_current['frame_rate'] = round(1000000 / $info_riff_raw_avih['dwMicroSecPerFrame'], 3); + $info_video['frame_rate'] = $info_riff_video_current['frame_rate']; + } + + if (isset($info_riff['AVI ']['hdrl']['strl']['strh'][0]['data'])) { + if (is_array($info_riff['AVI ']['hdrl']['strl']['strh'])) { + for ($i = 0; $i < count($info_riff['AVI ']['hdrl']['strl']['strh']); $i++) { + if (isset($info_riff['AVI ']['hdrl']['strl']['strh'][$i]['data'])) { + $strh_data = $info_riff['AVI ']['hdrl']['strl']['strh'][$i]['data']; + $strh_fcc_type = substr($strh_data, 0, 4); + + if (isset($info_riff['AVI ']['hdrl']['strl']['strf'][$i]['data'])) { + $strf_data = $info_riff['AVI ']['hdrl']['strl']['strf'][$i]['data']; + + // shortcut + $info_riff_raw_strf_strh_fcc_type_stream_index = &$info_riff_raw['strf'][$strh_fcc_type][$stream_index]; + + switch ($strh_fcc_type) { + case 'auds': + $info_audio['bitrate_mode'] = 'cbr'; + $info_audio_dataformat = 'wav'; + if (isset($info_riff_audio) && is_array($info_riff_audio)) { + $stream_index = count($info_riff_audio); + } + + $info_riff_audio[$stream_index] = getid3_riff::RIFFparseWAVEFORMATex($strf_data); + $info_audio['wformattag'] = $info_riff_audio[$stream_index]['raw']['wFormatTag']; + + // shortcut + $info_audio['streams'][$stream_index] = $info_riff_audio[$stream_index]; + $info_audio_streams_currentstream = &$info_audio['streams'][$stream_index]; + + if (@$info_audio_streams_currentstream['bits_per_sample'] === 0) { + unset($info_audio_streams_currentstream['bits_per_sample']); + } + $info_audio_streams_currentstream['wformattag'] = $info_audio_streams_currentstream['raw']['wFormatTag']; + unset($info_audio_streams_currentstream['raw']); + + // shortcut + $info_riff_raw['strf'][$strh_fcc_type][$stream_index] = $info_riff_audio[$stream_index]['raw']; + + unset($info_riff_audio[$stream_index]['raw']); + $info_audio = getid3_riff::array_merge_noclobber($info_audio, $info_riff_audio[$stream_index]); + + $info_audio['lossless'] = false; + switch ($info_riff_raw_strf_strh_fcc_type_stream_index['wFormatTag']) { + + case 0x0001: // PCM + $info_audio_dataformat = 'wav'; + $info_audio['lossless'] = true; + break; + + case 0x0050: // MPEG Layer 2 or Layer 1 + $info_audio_dataformat = 'mp2'; // Assume Layer-2 + break; + + case 0x0055: // MPEG Layer 3 + $info_audio_dataformat = 'mp3'; + break; + + case 0x00FF: // AAC + $info_audio_dataformat = 'aac'; + break; + + case 0x0161: // Windows Media v7 / v8 / v9 + case 0x0162: // Windows Media Professional v9 + case 0x0163: // Windows Media Lossess v9 + $info_audio_dataformat = 'wma'; + break; + + case 0x2000: // AC-3 + $info_audio_dataformat = 'ac3'; + break; + + case 0x2001: // DTS + $info_audio_dataformat = 'dts'; + break; + + default: + $info_audio_dataformat = 'wav'; + break; + } + $info_audio_streams_currentstream['dataformat'] = $info_audio_dataformat; + $info_audio_streams_currentstream['lossless'] = $info_audio['lossless']; + $info_audio_streams_currentstream['bitrate_mode'] = $info_audio['bitrate_mode']; + break; + + + case 'iavs': + case 'vids': + // shortcut + $info_riff_raw['strh'][$i] = array (); + $info_riff_raw_strh_current = &$info_riff_raw['strh'][$i]; + + getid3_lib::ReadSequence($this->endian_function, $info_riff_raw_strh_current, $strh_data, 0, + array ( + 'fccType' => -4, // same as $strh_fcc_type; + 'fccHandler' => -4, + 'dwFlags' => 4, // Contains AVITF_* flags + 'wPriority' => 2, + 'wLanguage' => 2, + 'dwInitialFrames' => 4, + 'dwScale' => 4, + 'dwRate' => 4, + 'dwStart' => 4, + 'dwLength' => 4, + 'dwSuggestedBufferSize' => 4, + 'dwQuality' => 4, + 'dwSampleSize' => 4, + 'rcFrame' => 4 + ) + ); + + $info_riff_video_current['codec'] = getid3_riff::RIFFfourccLookup($info_riff_raw_strh_current['fccHandler']); + $info_video['fourcc'] = $info_riff_raw_strh_current['fccHandler']; + + if (!$info_riff_video_current['codec'] && isset($info_riff_raw_strf_strh_fcc_type_stream_index['fourcc']) && getid3_riff::RIFFfourccLookup($info_riff_raw_strf_strh_fcc_type_stream_index['fourcc'])) { + $info_riff_video_current['codec'] = getid3_riff::RIFFfourccLookup($info_riff_raw_strf_strh_fcc_type_stream_index['fourcc']); + $info_video['fourcc'] = $info_riff_raw_strf_strh_fcc_type_stream_index['fourcc']; + } + + $info_video['codec'] = $info_riff_video_current['codec']; + $info_video['pixel_aspect_ratio'] = (float)1; + + switch ($info_riff_raw_strh_current['fccHandler']) { + + case 'HFYU': // Huffman Lossless Codec + case 'IRAW': // Intel YUV Uncompressed + case 'YUY2': // Uncompressed YUV 4:2:2 + $info_video['lossless'] = true; + break; + + default: + $info_video['lossless'] = false; + break; + } + + switch ($strh_fcc_type) { + + case 'vids': + getid3_lib::ReadSequence($this->endian_function, $info_riff_raw_strf_strh_fcc_type_stream_index, $strf_data, 0, + array ( + 'biSize' => 4, // number of bytes required by the BITMAPINFOHEADER structure + 'biWidth' => 4, // width of the bitmap in pixels + 'biHeight' => 4, // height of the bitmap in pixels. If biHeight is positive, the bitmap is a 'bottom-up' DIB and its origin is the lower left corner. If biHeight is negative, the bitmap is a 'top-down' DIB and its origin is the upper left corner + 'biPlanes' => 2, // number of color planes on the target device. In most cases this value must be set to 1 + 'biBitCount' => 2, // Specifies the number of bits per pixels + 'fourcc' => -4, // + 'biSizeImage' => 4, // size of the bitmap data section of the image (the actual pixel data, excluding BITMAPINFOHEADER and RGBQUAD structures) + 'biXPelsPerMeter' => 4, // horizontal resolution, in pixels per metre, of the target device + 'biYPelsPerMeter' => 4, // vertical resolution, in pixels per metre, of the target device + 'biClrUsed' => 4, // actual number of color indices in the color table used by the bitmap. If this value is zero, the bitmap uses the maximum number of colors corresponding to the value of the biBitCount member for the compression mode specified by biCompression + 'biClrImportant' => 4 // number of color indices that are considered important for displaying the bitmap. If this value is zero, all colors are important + ) + ); + + $info_video['bits_per_sample'] = $info_riff_raw_strf_strh_fcc_type_stream_index['biBitCount']; + + if ($info_riff_video_current['codec'] == 'DV') { + $info_riff_video_current['dv_type'] = 2; + } + break; + + case 'iavs': + $info_riff_video_current['dv_type'] = 1; + break; + } + break; + + default: + $getid3->warning('Unhandled fccType for stream ('.$i.'): "'.$strh_fcc_type.'"'); + break; + + } + } + } + + if (isset($info_riff_raw_strf_strh_fcc_type_stream_index['fourcc']) && getid3_riff::RIFFfourccLookup($info_riff_raw_strf_strh_fcc_type_stream_index['fourcc'])) { + + $info_riff_video_current['codec'] = getid3_riff::RIFFfourccLookup($info_riff_raw_strf_strh_fcc_type_stream_index['fourcc']); + $info_video['codec'] = $info_riff_video_current['codec']; + $info_video['fourcc'] = $info_riff_raw_strf_strh_fcc_type_stream_index['fourcc']; + + switch ($info_riff_raw_strf_strh_fcc_type_stream_index['fourcc']) { + + case 'HFYU': // Huffman Lossless Codec + case 'IRAW': // Intel YUV Uncompressed + case 'YUY2': // Uncompressed YUV 4:2:2 + $info_video['lossless'] = true; + $info_video['bits_per_sample'] = 24; + break; + + default: + $info_video['lossless'] = false; + $info_video['bits_per_sample'] = 24; + break; + } + + } + } + } + } + break; + + + case 'CDDA': + $info_audio['bitrate_mode'] = 'cbr'; + $info_audio_dataformat = 'cda'; + $info_audio['lossless'] = true; + unset($getid3->info['mime_type']); + + $info_avdataoffset = 44; + + if (isset($info_riff['CDDA']['fmt '][0]['data'])) { + + $info_riff_cdda_fmt_0 = &$info_riff['CDDA']['fmt '][0]; + + getid3_lib::ReadSequence($this->endian_function, $info_riff_cdda_fmt_0, $info_riff_cdda_fmt_0['data'], 0, + array ( + 'unknown1' => 2, + 'track_num' => 2, + 'disc_id' => 4, + 'start_offset_frame' => 4, + 'playtime_frames' => 4, + 'unknown6' => 4, + 'unknown7' => 4 + ) + ); + + $info_riff_cdda_fmt_0['start_offset_seconds'] = (float)$info_riff_cdda_fmt_0['start_offset_frame'] / 75; + $info_riff_cdda_fmt_0['playtime_seconds'] = (float)$info_riff_cdda_fmt_0['playtime_frames'] / 75; + $getid3->info['comments']['track'] = $info_riff_cdda_fmt_0['track_num']; + $getid3->info['playtime_seconds'] = $info_riff_cdda_fmt_0['playtime_seconds']; + + // hardcoded data for CD-audio + $info_audio['sample_rate'] = 44100; + $info_audio['channels'] = 2; + $info_audio['bits_per_sample'] = 16; + $info_audio['bitrate'] = $info_audio['sample_rate'] * $info_audio['channels'] * $info_audio['bits_per_sample']; + $info_audio['bitrate_mode'] = 'cbr'; + } + break; + + + case 'AIFF': + case 'AIFC': + $info_audio['bitrate_mode'] = 'cbr'; + $info_audio_dataformat = 'aiff'; + $info_audio['lossless'] = true; + $getid3->info['mime_type'] = 'audio/x-aiff'; + + if (isset($info_riff[$riff_sub_type]['SSND'][0]['offset'])) { + $info_avdataoffset = $info_riff[$riff_sub_type]['SSND'][0]['offset'] + 8; + $info_avdataend = $info_avdataoffset + $info_riff[$riff_sub_type]['SSND'][0]['size']; + if ($info_avdataend > $getid3->info['filesize']) { + if (($info_avdataend == ($getid3->info['filesize'] + 1)) && (($getid3->info['filesize'] % 2) == 1)) { + // structures rounded to 2-byte boundary, but dumb encoders + // forget to pad end of file to make this actually work + } else { + $getid3->warning('Probable truncated AIFF file: expecting '.$info_riff[$riff_sub_type]['SSND'][0]['size'].' bytes of audio data, only '.($getid3->info['filesize'] - $info_avdataoffset).' bytes found'); + } + $info_avdataend = $getid3->info['filesize']; + } + } + + if (isset($info_riff[$riff_sub_type]['COMM'][0]['data'])) { + + // shortcut + $info_riff_RIFFsubtype_COMM_0_data = &$info_riff[$riff_sub_type]['COMM'][0]['data']; + + $info_riff_audio['channels'] = getid3_lib::BigEndianSyncSafe2Int(substr($info_riff_RIFFsubtype_COMM_0_data, 0, 2)); + $info_riff_audio['total_samples'] = getid3_lib::BigEndian2Int( substr($info_riff_RIFFsubtype_COMM_0_data, 2, 4)); + $info_riff_audio['bits_per_sample'] = getid3_lib::BigEndianSyncSafe2Int(substr($info_riff_RIFFsubtype_COMM_0_data, 6, 2)); + $info_riff_audio['sample_rate'] = (int)getid3_riff::BigEndian2Float(substr($info_riff_RIFFsubtype_COMM_0_data, 8, 10)); + + if ($info_riff[$riff_sub_type]['COMM'][0]['size'] > 18) { + $info_riff_audio['codec_fourcc'] = substr($info_riff_RIFFsubtype_COMM_0_data, 18, 4); + $codec_name_size = getid3_lib::BigEndian2Int(substr($info_riff_RIFFsubtype_COMM_0_data, 22, 1)); + $info_riff_audio['codec_name'] = substr($info_riff_RIFFsubtype_COMM_0_data, 23, $codec_name_size); + + switch ($info_riff_audio['codec_name']) { + + case 'NONE': + $info_audio['codec'] = 'Pulse Code Modulation (PCM)'; + $info_audio['lossless'] = true; + break; + + case '': + switch ($info_riff_audio['codec_fourcc']) { + + // http://developer.apple.com/qa/snd/snd07.html + case 'sowt': + $info_riff_audio['codec_name'] = 'Two\'s Compliment Little-Endian PCM'; + $info_audio['lossless'] = true; + break; + + case 'twos': + $info_riff_audio['codec_name'] = 'Two\'s Compliment Big-Endian PCM'; + $info_audio['lossless'] = true; + break; + + default: + break; + } + break; + + default: + $info_audio['codec'] = $info_riff_audio['codec_name']; + $info_audio['lossless'] = false; + break; + } + } + + $info_audio['channels'] = $info_riff_audio['channels']; + + if ($info_riff_audio['bits_per_sample'] > 0) { + $info_audio['bits_per_sample'] = $info_riff_audio['bits_per_sample']; + } + + $info_audio['sample_rate'] = $info_riff_audio['sample_rate']; + $getid3->info['playtime_seconds'] = $info_riff_audio['total_samples'] / $info_audio['sample_rate']; + } + + if (isset($info_riff[$riff_sub_type]['COMT'])) { + + $comment_count = getid3_lib::BigEndian2Int(substr($info_riff[$riff_sub_type]['COMT'][0]['data'], 0, 2)); + $offset = 2; + + for ($i = 0; $i < $comment_count; $i++) { + + $getid3->info['comments_raw'][$i]['timestamp'] = getid3_lib::BigEndian2Int( substr($info_riff[$riff_sub_type]['COMT'][0]['data'], $offset, 4)); + $offset += 4; + + $getid3->info['comments_raw'][$i]['marker_id'] = getid3_lib::BigEndianSyncSafe2Int(substr($info_riff[$riff_sub_type]['COMT'][0]['data'], $offset, 2)); + $offset += 2; + + $comment_length = getid3_lib::BigEndian2Int( substr($info_riff[$riff_sub_type]['COMT'][0]['data'], $offset, 2)); + $offset += 2; + + $getid3->info['comments_raw'][$i]['comment'] = substr($info_riff[$riff_sub_type]['COMT'][0]['data'], $offset, $comment_length); + $offset += $comment_length; + + $getid3->info['comments_raw'][$i]['timestamp_unix'] = getid3_riff::DateMac2Unix($getid3->info['comments_raw'][$i]['timestamp']); + $info_riff['comments']['comment'][] = $getid3->info['comments_raw'][$i]['comment']; + } + } + + foreach (array ('NAME'=>'title', 'author'=>'artist', '(c) '=>'copyright', 'ANNO'=>'comment') as $key => $value) { + if (isset($info_riff[$riff_sub_type][$key][0]['data'])) { + $info_riff['comments'][$value][] = $info_riff[$riff_sub_type][$key][0]['data']; + } + } + break; + + + case '8SVX': + $info_audio['bitrate_mode'] = 'cbr'; + $info_audio_dataformat = '8svx'; + $info_audio['bits_per_sample'] = 8; + $info_audio['channels'] = 1; // overridden below, if need be + $getid3->info['mime_type'] = 'audio/x-aiff'; + + if (isset($info_riff[$riff_sub_type]['BODY'][0]['offset'])) { + $info_avdataoffset = $info_riff[$riff_sub_type]['BODY'][0]['offset'] + 8; + $info_avdataend = $info_avdataoffset + $info_riff[$riff_sub_type]['BODY'][0]['size']; + if ($info_avdataend > $getid3->info['filesize']) { + $getid3->warning('Probable truncated AIFF file: expecting '.$info_riff[$riff_sub_type]['BODY'][0]['size'].' bytes of audio data, only '.($getid3->info['filesize'] - $info_avdataoffset).' bytes found'); + } + } + + if (isset($info_riff[$riff_sub_type]['VHDR'][0]['offset'])) { + // shortcut + $info_riff_riff_sub_type_vhdr_0 = &$info_riff[$riff_sub_type]['VHDR'][0]; + + getid3_lib::ReadSequence('BigEndian2Int', $info_riff_riff_sub_type_vhdr_0, $info_riff_riff_sub_type_vhdr_0['data'], 0, + array ( + 'oneShotHiSamples' => 4, + 'repeatHiSamples' => 4, + 'samplesPerHiCycle' => 4, + 'samplesPerSec' => 2, + 'ctOctave' => 1, + 'sCompression' => 1, + 'Volume' => -4 + ) + ); + + $info_riff_riff_sub_type_vhdr_0['Volume'] = getid3_riff::FixedPoint16_16($info_riff_riff_sub_type_vhdr_0['Volume']); + + $info_audio['sample_rate'] = $info_riff_riff_sub_type_vhdr_0['samplesPerSec']; + + switch ($info_riff_riff_sub_type_vhdr_0['sCompression']) { + case 0: + $info_audio['codec'] = 'Pulse Code Modulation (PCM)'; + $info_audio['lossless'] = true; + $actual_bits_per_sample = 8; + break; + + case 1: + $info_audio['codec'] = 'Fibonacci-delta encoding'; + $info_audio['lossless'] = false; + $actual_bits_per_sample = 4; + break; + + default: + $getid3->warning('Unexpected sCompression value in 8SVX.VHDR chunk - expecting 0 or 1, found "'.sCompression.'"'); + break; + } + } + + if (isset($info_riff[$riff_sub_type]['CHAN'][0]['data'])) { + $ChannelsIndex = getid3_lib::BigEndian2Int(substr($info_riff[$riff_sub_type]['CHAN'][0]['data'], 0, 4)); + switch ($ChannelsIndex) { + case 6: // Stereo + $info_audio['channels'] = 2; + break; + + case 2: // Left channel only + case 4: // Right channel only + $info_audio['channels'] = 1; + break; + + default: + $getid3->warning('Unexpected value in 8SVX.CHAN chunk - expecting 2 or 4 or 6, found "'.$ChannelsIndex.'"'); + break; + } + + } + + foreach (array ('NAME'=>'title', 'author'=>'artist', '(c) '=>'copyright', 'ANNO'=>'comment') as $key => $value) { + if (isset($info_riff[$riff_sub_type][$key][0]['data'])) { + $info_riff['comments'][$value][] = $info_riff[$riff_sub_type][$key][0]['data']; + } + } + + $info_audio['bitrate'] = $info_audio['sample_rate'] * $actual_bits_per_sample * $info_audio['channels']; + if (!empty($info_audio['bitrate'])) { + $getid3->info['playtime_seconds'] = ($info_avdataend - $info_avdataoffset) / ($info_audio['bitrate'] / 8); + } + break; + + + case 'CDXA': + + $getid3->info['mime_type'] = 'video/mpeg'; + if (!empty($info_riff['CDXA']['data'][0]['size'])) { + $GETID3_ERRORARRAY = &$getid3->info['warning']; + + if (!$getid3->include_module_optional('audio-video.mpeg')) { + $getid3->warning('MPEG skipped because mpeg module is missing.'); + } + + else { + + // Clone getid3 - messing with offsets - better safe than sorry + $clone = clone $getid3; + + // Analyse + $mpeg = new getid3_mpeg($clone); + $mpeg->Analyze(); + + // Import from clone and destroy + $getid3->info['audio'] = $clone->info['audio']; + $getid3->info['video'] = $clone->info['video']; + $getid3->info['mpeg'] = $clone->info['mpeg']; + $getid3->info['warning'] = $clone->info['warning']; + + unset($clone); + } + } + + break; + + + default: + throw new getid3_exception('Unknown RIFF type: expecting one of (WAVE|RMP3|AVI |CDDA|AIFF|AIFC|8SVX|CDXA), found "'.$riff_sub_type.'" instead'); + } + + + if (@$info_riff_raw['fmt ']['wFormatTag'] == 1) { + + // http://www.mega-nerd.com/erikd/Blog/Windiots/dts.html + $this->fseek($getid3->info['avdataoffset'], SEEK_SET); + $bytes4 = $this->fread(4); + + // DTSWAV + if (preg_match('/^\xFF\x1F\x00\xE8/s', $bytes4)) { + $info_audio_dataformat = 'dts'; + } + + // DTS, but this probably shouldn't happen + elseif (preg_match('/^\x7F\xFF\x80\x01/s', $bytes4)) { + $info_audio_dataformat = 'dts'; + } + } + + if (@is_array($info_riff_wave['DISP'])) { + $info_riff['comments']['title'][] = trim(substr($info_riff_wave['DISP'][count($info_riff_wave['DISP']) - 1]['data'], 4)); + } + + if (@is_array($info_riff_wave['INFO'])) { + getid3_riff::RIFFCommentsParse($info_riff_wave['INFO'], $info_riff['comments']); + } + + if (isset($info_riff_wave['INFO']) && is_array($info_riff_wave['INFO'])) { + + foreach (array ('IARL' => 'archivallocation', 'IART' => 'artist', 'ICDS' => 'costumedesigner', 'ICMS' => 'commissionedby', 'ICMT' => 'comment', 'ICNT' => 'country', 'ICOP' => 'copyright', 'ICRD' => 'creationdate', 'IDIM' => 'dimensions', 'IDIT' => 'digitizationdate', 'IDPI' => 'resolution', 'IDST' => 'distributor', 'IEDT' => 'editor', 'IENG' => 'engineers', 'IFRM' => 'accountofparts', 'IGNR' => 'genre', 'IKEY' => 'keywords', 'ILGT' => 'lightness', 'ILNG' => 'language', 'IMED' => 'orignalmedium', 'IMUS' => 'composer', 'INAM' => 'title', 'IPDS' => 'productiondesigner', 'IPLT' => 'palette', 'IPRD' => 'product', 'IPRO' => 'producer', 'IPRT' => 'part', 'IRTD' => 'rating', 'ISBJ' => 'subject', 'ISFT' => 'software', 'ISGN' => 'secondarygenre', 'ISHP' => 'sharpness', 'ISRC' => 'sourcesupplier', 'ISRF' => 'digitizationsource', 'ISTD' => 'productionstudio', 'ISTR' => 'starring', 'ITCH' => 'encoded_by', 'IWEB' => 'url', 'IWRI' => 'writer') as $key => $value) { + if (isset($info_riff_wave['INFO'][$key])) { + foreach ($info_riff_wave['INFO'][$key] as $comment_id => $comment_data) { + if (trim($comment_data['data']) != '') { + $info_riff['comments'][$value][] = trim($comment_data['data']); + } + } + } + } + } + + if (empty($info_audio['encoder']) && !empty($getid3->info['mpeg']['audio']['LAME']['short_version'])) { + $info_audio['encoder'] = $getid3->info['mpeg']['audio']['LAME']['short_version']; + } + + if (!isset($getid3->info['playtime_seconds'])) { + $getid3->info['playtime_seconds'] = 0; + } + + if (isset($info_riff_raw['avih']['dwTotalFrames']) && isset($info_riff_raw['avih']['dwMicroSecPerFrame'])) { + $getid3->info['playtime_seconds'] = $info_riff_raw['avih']['dwTotalFrames'] * ($info_riff_raw['avih']['dwMicroSecPerFrame'] / 1000000); + } + + if ($getid3->info['playtime_seconds'] > 0) { + if (isset($info_riff_audio) && isset($info_riff_video)) { + + if (!isset($getid3->info['bitrate'])) { + $getid3->info['bitrate'] = ((($info_avdataend - $info_avdataoffset) / $getid3->info['playtime_seconds']) * 8); + } + + } elseif (isset($info_riff_audio) && !isset($info_riff_video)) { + + if (!isset($info_audio['bitrate'])) { + $info_audio['bitrate'] = ((($info_avdataend - $info_avdataoffset) / $getid3->info['playtime_seconds']) * 8); + } + + } elseif (!isset($info_riff_audio) && isset($info_riff_video)) { + + if (!isset($info_video['bitrate'])) { + $info_video['bitrate'] = ((($info_avdataend - $info_avdataoffset) / $getid3->info['playtime_seconds']) * 8); + } + + } + } + + + if (isset($info_riff_video) && isset($info_audio['bitrate']) && ($info_audio['bitrate'] > 0) && ($getid3->info['playtime_seconds'] > 0)) { + + $getid3->info['bitrate'] = ((($info_avdataend - $info_avdataoffset) / $getid3->info['playtime_seconds']) * 8); + $info_audio['bitrate'] = 0; + $info_video['bitrate'] = $getid3->info['bitrate']; + foreach ($info_riff_audio as $channelnumber => $audioinfoarray) { + $info_video['bitrate'] -= $audioinfoarray['bitrate']; + $info_audio['bitrate'] += $audioinfoarray['bitrate']; + } + if ($info_video['bitrate'] <= 0) { + unset($info_video['bitrate']); + } + if ($info_audio['bitrate'] <= 0) { + unset($info_audio['bitrate']); + } + } + + if (isset($getid3->info['mpeg']['audio'])) { + $info_audio_dataformat = 'mp'.$getid3->info['mpeg']['audio']['layer']; + $info_audio['sample_rate'] = $getid3->info['mpeg']['audio']['sample_rate']; + $info_audio['channels'] = $getid3->info['mpeg']['audio']['channels']; + $info_audio['bitrate'] = $getid3->info['mpeg']['audio']['bitrate']; + $info_audio['bitrate_mode'] = strtolower($getid3->info['mpeg']['audio']['bitrate_mode']); + + if (!empty($getid3->info['mpeg']['audio']['codec'])) { + $info_audio['codec'] = $getid3->info['mpeg']['audio']['codec'].' '.$info_audio['codec']; + } + + if (!empty($info_audio['streams'])) { + foreach ($info_audio['streams'] as $streamnumber => $streamdata) { + if ($streamdata['dataformat'] == $info_audio_dataformat) { + $info_audio['streams'][$streamnumber]['sample_rate'] = $info_audio['sample_rate']; + $info_audio['streams'][$streamnumber]['channels'] = $info_audio['channels']; + $info_audio['streams'][$streamnumber]['bitrate'] = $info_audio['bitrate']; + $info_audio['streams'][$streamnumber]['bitrate_mode'] = $info_audio['bitrate_mode']; + $info_audio['streams'][$streamnumber]['codec'] = $info_audio['codec']; + } + } + } + $info_audio['encoder_options'] = getid3_mp3::GuessEncoderOptions($getid3->info); + } + + + if (!empty($info_riff_raw['fmt ']['wBitsPerSample']) && ($info_riff_raw['fmt ']['wBitsPerSample'] > 0)) { + switch ($info_audio_dataformat) { + case 'ac3': + // ignore bits_per_sample + break; + + default: + $info_audio['bits_per_sample'] = $info_riff_raw['fmt ']['wBitsPerSample']; + break; + } + } + + + if (empty($info_riff_raw)) { + unset($info_riff['raw']); + } + if (empty($info_riff_audio)) { + unset($info_riff['audio']); + } + if (empty($info_riff_video)) { + unset($info_riff['video']); + } + if (empty($info_audio_dataformat)) { + unset($info_audio['dataformat']); + } + if (empty($getid3->info['audio'])) { + unset($getid3->info['audio']); + } + if (empty($info_video)) { + unset($getid3->info['video']); + } + + return true; + } + + + + public function ParseRIFF($start_offset, $max_offset) { + + $getid3 = $this->getid3; + + $info = &$getid3->info; + + $endian_function = $this->endian_function; + + $max_offset = min($max_offset, $info['avdataend']); + + $riff_chunk = false; + + $this->fseek($start_offset, SEEK_SET); + + while ($this->ftell() < $max_offset) { + + $chunk_name = $this->fread(4); + + if (strlen($chunk_name) < 4) { + throw new getid3_exception('Expecting chunk name at offset '.($this->ftell() - 4).' but found nothing. Aborting RIFF parsing.'); + } + + $chunk_size = getid3_lib::$endian_function($this->fread(4)); + + if ($chunk_size == 0) { + continue; + throw new getid3_exception('Chunk size at offset '.($this->ftell() - 4).' is zero. Aborting RIFF parsing.'); + } + + if (($chunk_size % 2) != 0) { + // all structures are packed on word boundaries + $chunk_size++; + } + + switch ($chunk_name) { + + case 'LIST': + $list_name = $this->fread(4); + + switch ($list_name) { + + case 'movi': + case 'rec ': + $riff_chunk[$list_name]['offset'] = $this->ftell() - 4; + $riff_chunk[$list_name]['size'] = $chunk_size; + + static $parsed_audio_stream = false; + + if (!$parsed_audio_stream) { + $where_we_were = $this->ftell(); + $audio_chunk_header = $this->fread(12); + $audio_chunk_stream_num = substr($audio_chunk_header, 0, 2); + $audio_chunk_stream_type = substr($audio_chunk_header, 2, 2); + $audio_chunk_size = getid3_lib::LittleEndian2Int(substr($audio_chunk_header, 4, 4)); + + if ($audio_chunk_stream_type == 'wb') { + $first_four_bytes = substr($audio_chunk_header, 8, 4); + + + //// MPEG + + if (preg_match('/^\xFF[\xE2-\xE7\xF2-\xF7\xFA-\xFF][\x00-\xEB]/s', $first_four_bytes)) { + + if (!$getid3->include_module_optional('audio.mp3')) { + $getid3->warning('MP3 skipped because mp3 module is missing.'); + } + + elseif (getid3_mp3::MPEGaudioHeaderBytesValid($first_four_bytes)) { + + // Clone getid3 - messing with offsets - better safe than sorry + $clone = clone $getid3; + $clone->info['avdataoffset'] = $this->ftell() - 4; + $clone->info['avdataend'] = $this->ftell() + $audio_chunk_size; + + $mp3 = new getid3_mp3($clone); + $mp3->AnalyzeMPEGaudioInfo(); + + // Import from clone and destroy + if (isset($clone->info['mpeg']['audio'])) { + + $info['mpeg']['audio'] = $clone->info['mpeg']['audio']; + + $info['audio']['dataformat'] = 'mp'.$info['mpeg']['audio']['layer']; + $info['audio']['sample_rate'] = $info['mpeg']['audio']['sample_rate']; + $info['audio']['channels'] = $info['mpeg']['audio']['channels']; + $info['audio']['bitrate'] = $info['mpeg']['audio']['bitrate']; + $info['audio']['bitrate_mode'] = strtolower($info['mpeg']['audio']['bitrate_mode']); + $info['bitrate'] = $info['audio']['bitrate']; + + $getid3->warning($clone->warnings()); + unset($clone); + } + } + } + + //// AC3-WAVE + + elseif (preg_match('/^\x0B\x77/s', $first_four_bytes)) { + + if (!$getid3->include_module_optional('audio.ac3')) { + $getid3->warning('AC3 skipped because ac3 module is missing.'); + } + + else { + + // Clone getid3 - messing with offsets - better safe than sorry + $clone = clone $getid3; + $clone->info['avdataoffset'] = $this->ftell() - 4; + $clone->info['avdataend'] = $this->ftell() + $audio_chunk_size; + + // Analyze clone by fp + $ac3 = new getid3_ac3($clone); + $ac3->Analyze(); + + // Import from clone and destroy + $info['audio'] = $clone->info['audio']; + $info['ac3'] = $clone->info['ac3']; + $getid3->warning($clone->warnings()); + unset($clone); + } + } + } + + $parsed_audio_stream = true; + $this->fseek($where_we_were, SEEK_SET); + + } + $this->fseek($chunk_size - 4, SEEK_CUR); + break; + + default: + if (!isset($riff_chunk[$list_name])) { + $riff_chunk[$list_name] = array (); + } + $list_chunk_parent = $list_name; + $list_chunk_max_offset = $this->ftell() - 4 + $chunk_size; + if ($parsed_chunk = $this->ParseRIFF($this->ftell(), $this->ftell() + $chunk_size - 4)) { + $riff_chunk[$list_name] = array_merge_recursive($riff_chunk[$list_name], $parsed_chunk); + } + break; + } + break; + + + default: + + $this_index = 0; + if (isset($riff_chunk[$chunk_name]) && is_array($riff_chunk[$chunk_name])) { + $this_index = count($riff_chunk[$chunk_name]); + } + $riff_chunk[$chunk_name][$this_index]['offset'] = $this->ftell() - 8; + $riff_chunk[$chunk_name][$this_index]['size'] = $chunk_size; + switch ($chunk_name) { + case 'data': + $info['avdataoffset'] = $this->ftell(); + $info['avdataend'] = $info['avdataoffset'] + $chunk_size; + + $riff_data_chunk_contents_test = $this->fread(36); + + + //// This is probably MP3 data + + if ((strlen($riff_data_chunk_contents_test) > 0) && preg_match('/^\xFF[\xE2-\xE7\xF2-\xF7\xFA-\xFF][\x00-\xEB]/s', substr($riff_data_chunk_contents_test, 0, 4))) { + + try { + + if (!$getid3->include_module_optional('audio.mp3')) { + $getid3->warning('MP3 skipped because mp3 module is missing.'); + } + + + // Clone getid3 - messing with offsets - better safe than sorry + $clone = clone $getid3; + + if (getid3_mp3::MPEGaudioHeaderBytesValid(substr($riff_data_chunk_contents_test, 0, 4))) { + + $mp3 = new getid3_mp3($clone); + $mp3->AnalyzeMPEGaudioInfo(); + + // Import from clone and destroy + if (isset($clone->info['mpeg']['audio'])) { + + $info['mpeg']['audio'] = $clone->info['mpeg']['audio']; + + $info['audio']['sample_rate'] = $info['mpeg']['audio']['sample_rate']; + $info['audio']['channels'] = $info['mpeg']['audio']['channels']; + $info['audio']['bitrate'] = $info['mpeg']['audio']['bitrate']; + $info['audio']['bitrate_mode'] = strtolower($info['mpeg']['audio']['bitrate_mode']); + $info['bitrate'] = $info['audio']['bitrate']; + + $getid3->warning($clone->warnings()); + unset($clone); + } + } + } + catch (Exception $e) { + // do nothing - not MP3 data + } + } + + + //// This is probably AC-3 data + + elseif ((strlen($riff_data_chunk_contents_test) > 0) && (substr($riff_data_chunk_contents_test, 0, 2) == "\x0B\x77")) { + + if (!$getid3->include_module_optional('audio.ac3')) { + $getid3->warning('AC3 skipped because ac3 module is missing.'); + } + + else { + + // Clone getid3 - messing with offsets - better safe than sorry + $clone = clone $getid3; + $clone->info['avdataoffset'] = $riff_chunk[$chunk_name][$this_index]['offset']; + $clone->info['avdataend'] = $clone->info['avdataoffset'] + $riff_chunk[$chunk_name][$this_index]['size']; + + // Analyze clone by fp + $ac3 = new getid3_ac3($clone); + $ac3->Analyze(); + + // Import from clone and destroy + $info['audio'] = $clone->info['audio']; + $info['ac3'] = $clone->info['ac3']; + $getid3->warning($clone->warnings()); + unset($clone); + } + } + + + // Dolby Digital WAV + // AC-3 content, but not encoded in same format as normal AC-3 file + // For one thing, byte order is swapped + + elseif ((strlen($riff_data_chunk_contents_test) > 0) && (substr($riff_data_chunk_contents_test, 8, 2) == "\x77\x0B")) { + + if (!$getid3->include_module_optional('audio.ac3')) { + $getid3->warning('AC3 skipped because ac3 module is missing.'); + } + + else { + + // Extract ac3 data to string + $ac3_data = ''; + for ($i = 0; $i < 28; $i += 2) { + // swap byte order + $ac3_data .= substr($riff_data_chunk_contents_test, 8 + $i + 1, 1); + $ac3_data .= substr($riff_data_chunk_contents_test, 8 + $i + 0, 1); + } + + // Clone getid3 - messing with offsets - better safe than sorry + $clone = clone $getid3; + $clone->info['avdataoffset'] = 0; + $clone->info['avdataend'] = 20; + + // Analyse clone by string + $ac3 = new getid3_ac3($clone); + $ac3->AnalyzeString($ac3_data); + + // Import from clone and destroy + $info['audio'] = $clone->info['audio']; + $info['ac3'] = $clone->info['ac3']; + $getid3->warning($clone->warnings()); + unset($clone); + } + } + + + if ((strlen($riff_data_chunk_contents_test) > 0) && (substr($riff_data_chunk_contents_test, 0, 4) == 'wvpk')) { + + // This is WavPack data + $info['wavpack']['offset'] = $riff_chunk[$chunk_name][$this_index]['offset']; + $info['wavpack']['size'] = getid3_lib::LittleEndian2Int(substr($riff_data_chunk_contents_test, 4, 4)); + $this->RIFFparseWavPackHeader(substr($riff_data_chunk_contents_test, 8, 28)); + + } else { + + // This is some other kind of data (quite possibly just PCM) + // do nothing special, just skip it + + } + $this->fseek($riff_chunk[$chunk_name][$this_index]['offset'] + 8 + $chunk_size, SEEK_SET); + break; + + case 'bext': + case 'cart': + case 'fmt ': + case 'MEXT': + case 'DISP': + // always read data in + $riff_chunk[$chunk_name][$this_index]['data'] = $this->fread($chunk_size); + break; + + default: + if (!empty($list_chunk_parent) && (($riff_chunk[$chunk_name][$this_index]['offset'] + $riff_chunk[$chunk_name][$this_index]['size']) <= $list_chunk_max_offset)) { + $riff_chunk[$list_chunk_parent][$chunk_name][$this_index]['offset'] = $riff_chunk[$chunk_name][$this_index]['offset']; + $riff_chunk[$list_chunk_parent][$chunk_name][$this_index]['size'] = $riff_chunk[$chunk_name][$this_index]['size']; + unset($riff_chunk[$chunk_name][$this_index]['offset']); + unset($riff_chunk[$chunk_name][$this_index]['size']); + if (isset($riff_chunk[$chunk_name][$this_index]) && empty($riff_chunk[$chunk_name][$this_index])) { + unset($riff_chunk[$chunk_name][$this_index]); + } + if (isset($riff_chunk[$chunk_name]) && empty($riff_chunk[$chunk_name])) { + unset($riff_chunk[$chunk_name]); + } + $riff_chunk[$list_chunk_parent][$chunk_name][$this_index]['data'] = $this->fread($chunk_size); + } elseif ($chunk_size < 2048) { + // only read data in if smaller than 2kB + $riff_chunk[$chunk_name][$this_index]['data'] = $this->fread($chunk_size); + } else { + $this->fseek($chunk_size, SEEK_CUR); + } + break; + } + break; + + } + + } + + return $riff_chunk; + } + + + + private function RIFFparseWavPackHeader($wavpack3_chunk_data) { + + // typedef struct { + // char ckID [4]; + // long ckSize; + // short version; + // short bits; // added for version 2.00 + // short flags, shift; // added for version 3.00 + // long total_samples, crc, crc2; + // char extension [4], extra_bc, extras [3]; + // } WavpackHeader; + + $this->getid3->info['wavpack'] = array (); + $info_wavpack = &$this->getid3->info['wavpack']; + + $info_wavpack['version'] = getid3_lib::LittleEndian2Int(substr($wavpack3_chunk_data, 0, 2)); + + if ($info_wavpack['version'] >= 2) { + $info_wavpack['bits'] = getid3_lib::LittleEndian2Int(substr($wavpack3_chunk_data, 2, 2)); + } + + if ($info_wavpack['version'] >= 3) { + + getid3_lib::ReadSequence('LittleEndian2Int', $info_wavpack, $wavpack3_chunk_data, 4, + array ( + 'flags_raw' => 2, + 'shift' => 2, + 'total_samples' => 4, + 'crc1' => 4, + 'crc2' => 4, + 'extension' => -4, + 'extra_bc' => 1 + ) + ); + + for ($i = 0; $i < 3; $i++) { + $info_wavpack['extras'][] = getid3_lib::LittleEndian2Int($wavpack3_chunk_data{25 + $i}); + } + + $info_wavpack['flags'] = array (); + $info_wavpack_flags = &$info_wavpack['flags']; + + $info_wavpack_flags['mono'] = (bool)($info_wavpack['flags_raw'] & 0x000001); + $info_wavpack_flags['fast_mode'] = (bool)($info_wavpack['flags_raw'] & 0x000002); + $info_wavpack_flags['raw_mode'] = (bool)($info_wavpack['flags_raw'] & 0x000004); + $info_wavpack_flags['calc_noise'] = (bool)($info_wavpack['flags_raw'] & 0x000008); + $info_wavpack_flags['high_quality'] = (bool)($info_wavpack['flags_raw'] & 0x000010); + $info_wavpack_flags['3_byte_samples'] = (bool)($info_wavpack['flags_raw'] & 0x000020); + $info_wavpack_flags['over_20_bits'] = (bool)($info_wavpack['flags_raw'] & 0x000040); + $info_wavpack_flags['use_wvc'] = (bool)($info_wavpack['flags_raw'] & 0x000080); + $info_wavpack_flags['noiseshaping'] = (bool)($info_wavpack['flags_raw'] & 0x000100); + $info_wavpack_flags['very_fast_mode'] = (bool)($info_wavpack['flags_raw'] & 0x000200); + $info_wavpack_flags['new_high_quality'] = (bool)($info_wavpack['flags_raw'] & 0x000400); + $info_wavpack_flags['cancel_extreme'] = (bool)($info_wavpack['flags_raw'] & 0x000800); + $info_wavpack_flags['cross_decorrelation'] = (bool)($info_wavpack['flags_raw'] & 0x001000); + $info_wavpack_flags['new_decorrelation'] = (bool)($info_wavpack['flags_raw'] & 0x002000); + $info_wavpack_flags['joint_stereo'] = (bool)($info_wavpack['flags_raw'] & 0x004000); + $info_wavpack_flags['extra_decorrelation'] = (bool)($info_wavpack['flags_raw'] & 0x008000); + $info_wavpack_flags['override_noiseshape'] = (bool)($info_wavpack['flags_raw'] & 0x010000); + $info_wavpack_flags['override_jointstereo'] = (bool)($info_wavpack['flags_raw'] & 0x020000); + $info_wavpack_flags['copy_source_filetime'] = (bool)($info_wavpack['flags_raw'] & 0x040000); + $info_wavpack_flags['create_exe'] = (bool)($info_wavpack['flags_raw'] & 0x080000); + } + + return true; + } + + + + public function AnalyzeString(&$string) { + + // Rewrite header_size in header + $new_header_size = getid3_lib::LittleEndian2String(strlen($string), 4); + for ($i = 0; $i < 4; $i++) { + $string{$i + 4} = $new_header_size{$i}; + } + + return parent::AnalyzeString($string); + } + + + + public static function RIFFparseWAVEFORMATex($wave_format_ex_data) { + + $wave_format_ex['raw'] = array (); + $wave_format_ex_raw = &$wave_format_ex['raw']; + + getid3_lib::ReadSequence('LittleEndian2Int', $wave_format_ex_raw, $wave_format_ex_data, 0, + array ( + 'wFormatTag' => 2, + 'nChannels' => 2, + 'nSamplesPerSec' => 4, + 'nAvgBytesPerSec' => 4, + 'nBlockAlign' => 2, + 'wBitsPerSample' => 2 + ) + ); + + if (strlen($wave_format_ex_data) > 16) { + $wave_format_ex_raw['cbSize'] = getid3_lib::LittleEndian2Int(substr($wave_format_ex_data, 16, 2)); + } + + $wave_format_ex['codec'] = getid3_riff::RIFFwFormatTagLookup($wave_format_ex_raw['wFormatTag']); + $wave_format_ex['channels'] = $wave_format_ex_raw['nChannels']; + $wave_format_ex['sample_rate'] = $wave_format_ex_raw['nSamplesPerSec']; + $wave_format_ex['bitrate'] = $wave_format_ex_raw['nAvgBytesPerSec'] * 8; + if (@$wave_format_ex_raw['wBitsPerSample']) { + $wave_format_ex['bits_per_sample'] = $wave_format_ex_raw['wBitsPerSample']; + } + + return $wave_format_ex; + } + + + + public static function RIFFwFormatTagLookup($w_format_tag) { + + static $lookup = array ( + 0x0000 => 'Microsoft Unknown Wave Format', + 0x0001 => 'Pulse Code Modulation (PCM)', + 0x0002 => 'Microsoft ADPCM', + 0x0003 => 'IEEE Float', + 0x0004 => 'Compaq Computer VSELP', + 0x0005 => 'IBM CVSD', + 0x0006 => 'Microsoft A-Law', + 0x0007 => 'Microsoft mu-Law', + 0x0008 => 'Microsoft DTS', + 0x0010 => 'OKI ADPCM', + 0x0011 => 'Intel DVI/IMA ADPCM', + 0x0012 => 'Videologic MediaSpace ADPCM', + 0x0013 => 'Sierra Semiconductor ADPCM', + 0x0014 => 'Antex Electronics G.723 ADPCM', + 0x0015 => 'DSP Solutions DigiSTD', + 0x0016 => 'DSP Solutions DigiFIX', + 0x0017 => 'Dialogic OKI ADPCM', + 0x0018 => 'MediaVision ADPCM', + 0x0019 => 'Hewlett-Packard CU', + 0x0020 => 'Yamaha ADPCM', + 0x0021 => 'Speech Compression Sonarc', + 0x0022 => 'DSP Group TrueSpeech', + 0x0023 => 'Echo Speech EchoSC1', + 0x0024 => 'Audiofile AF36', + 0x0025 => 'Audio Processing Technology APTX', + 0x0026 => 'AudioFile AF10', + 0x0027 => 'Prosody 1612', + 0x0028 => 'LRC', + 0x0030 => 'Dolby AC2', + 0x0031 => 'Microsoft GSM 6.10', + 0x0032 => 'MSNAudio', + 0x0033 => 'Antex Electronics ADPCME', + 0x0034 => 'Control Resources VQLPC', + 0x0035 => 'DSP Solutions DigiREAL', + 0x0036 => 'DSP Solutions DigiADPCM', + 0x0037 => 'Control Resources CR10', + 0x0038 => 'Natural MicroSystems VBXADPCM', + 0x0039 => 'Crystal Semiconductor IMA ADPCM', + 0x003A => 'EchoSC3', + 0x003B => 'Rockwell ADPCM', + 0x003C => 'Rockwell Digit LK', + 0x003D => 'Xebec', + 0x0040 => 'Antex Electronics G.721 ADPCM', + 0x0041 => 'G.728 CELP', + 0x0042 => 'MSG723', + 0x0050 => 'MPEG Layer-2 or Layer-1', + 0x0052 => 'RT24', + 0x0053 => 'PAC', + 0x0055 => 'MPEG Layer-3', + 0x0059 => 'Lucent G.723', + 0x0060 => 'Cirrus', + 0x0061 => 'ESPCM', + 0x0062 => 'Voxware', + 0x0063 => 'Canopus Atrac', + 0x0064 => 'G.726 ADPCM', + 0x0065 => 'G.722 ADPCM', + 0x0066 => 'DSAT', + 0x0067 => 'DSAT Display', + 0x0069 => 'Voxware Byte Aligned', + 0x0070 => 'Voxware AC8', + 0x0071 => 'Voxware AC10', + 0x0072 => 'Voxware AC16', + 0x0073 => 'Voxware AC20', + 0x0074 => 'Voxware MetaVoice', + 0x0075 => 'Voxware MetaSound', + 0x0076 => 'Voxware RT29HW', + 0x0077 => 'Voxware VR12', + 0x0078 => 'Voxware VR18', + 0x0079 => 'Voxware TQ40', + 0x0080 => 'Softsound', + 0x0081 => 'Voxware TQ60', + 0x0082 => 'MSRT24', + 0x0083 => 'G.729A', + 0x0084 => 'MVI MV12', + 0x0085 => 'DF G.726', + 0x0086 => 'DF GSM610', + 0x0088 => 'ISIAudio', + 0x0089 => 'Onlive', + 0x0091 => 'SBC24', + 0x0092 => 'Dolby AC3 SPDIF', + 0x0093 => 'MediaSonic G.723', + 0x0094 => 'Aculab PLC Prosody 8kbps', + 0x0097 => 'ZyXEL ADPCM', + 0x0098 => 'Philips LPCBB', + 0x0099 => 'Packed', + 0x00FF => 'AAC', + 0x0100 => 'Rhetorex ADPCM', + 0x0101 => 'IBM mu-law', + 0x0102 => 'IBM A-law', + 0x0103 => 'IBM AVC Adaptive Differential Pulse Code Modulation (ADPCM)', + 0x0111 => 'Vivo G.723', + 0x0112 => 'Vivo Siren', + 0x0123 => 'Digital G.723', + 0x0125 => 'Sanyo LD ADPCM', + 0x0130 => 'Sipro Lab Telecom ACELP NET', + 0x0131 => 'Sipro Lab Telecom ACELP 4800', + 0x0132 => 'Sipro Lab Telecom ACELP 8V3', + 0x0133 => 'Sipro Lab Telecom G.729', + 0x0134 => 'Sipro Lab Telecom G.729A', + 0x0135 => 'Sipro Lab Telecom Kelvin', + 0x0140 => 'Windows Media Video V8', + 0x0150 => 'Qualcomm PureVoice', + 0x0151 => 'Qualcomm HalfRate', + 0x0155 => 'Ring Zero Systems TUB GSM', + 0x0160 => 'Microsoft Audio 1', + 0x0161 => 'Windows Media Audio V7 / V8 / V9', + 0x0162 => 'Windows Media Audio Professional V9', + 0x0163 => 'Windows Media Audio Lossless V9', + 0x0200 => 'Creative Labs ADPCM', + 0x0202 => 'Creative Labs Fastspeech8', + 0x0203 => 'Creative Labs Fastspeech10', + 0x0210 => 'UHER Informatic GmbH ADPCM', + 0x0220 => 'Quarterdeck', + 0x0230 => 'I-link Worldwide VC', + 0x0240 => 'Aureal RAW Sport', + 0x0250 => 'Interactive Products HSX', + 0x0251 => 'Interactive Products RPELP', + 0x0260 => 'Consistent Software CS2', + 0x0270 => 'Sony SCX', + 0x0300 => 'Fujitsu FM Towns Snd', + 0x0400 => 'BTV Digital', + 0x0401 => 'Intel Music Coder', + 0x0450 => 'QDesign Music', + 0x0680 => 'VME VMPCM', + 0x0681 => 'AT&T Labs TPC', + 0x08AE => 'ClearJump LiteWave', + 0x1000 => 'Olivetti GSM', + 0x1001 => 'Olivetti ADPCM', + 0x1002 => 'Olivetti CELP', + 0x1003 => 'Olivetti SBC', + 0x1004 => 'Olivetti OPR', + 0x1100 => 'Lernout & Hauspie Codec (0x1100)', + 0x1101 => 'Lernout & Hauspie CELP Codec (0x1101)', + 0x1102 => 'Lernout & Hauspie SBC Codec (0x1102)', + 0x1103 => 'Lernout & Hauspie SBC Codec (0x1103)', + 0x1104 => 'Lernout & Hauspie SBC Codec (0x1104)', + 0x1400 => 'Norris', + 0x1401 => 'AT&T ISIAudio', + 0x1500 => 'Soundspace Music Compression', + 0x181C => 'VoxWare RT24 Speech', + 0x1FC4 => 'NCT Soft ALF2CD (www.nctsoft.com)', + 0x2000 => 'Dolby AC3', + 0x2001 => 'Dolby DTS', + 0x2002 => 'WAVE_FORMAT_14_4', + 0x2003 => 'WAVE_FORMAT_28_8', + 0x2004 => 'WAVE_FORMAT_COOK', + 0x2005 => 'WAVE_FORMAT_DNET', + 0x674F => 'Ogg Vorbis 1', + 0x6750 => 'Ogg Vorbis 2', + 0x6751 => 'Ogg Vorbis 3', + 0x676F => 'Ogg Vorbis 1+', + 0x6770 => 'Ogg Vorbis 2+', + 0x6771 => 'Ogg Vorbis 3+', + 0x7A21 => 'GSM-AMR (CBR, no SID)', + 0x7A22 => 'GSM-AMR (VBR, including SID)', + 0xFFFE => 'WAVE_FORMAT_EXTENSIBLE', + 0xFFFF => 'WAVE_FORMAT_DEVELOPMENT' + ); + + return @$lookup[$w_format_tag]; + } + + + + public static function RIFFfourccLookup($four_cc) { + + static $lookup = array ( + 'swot' => 'http://developer.apple.com/qa/snd/snd07.html', + '____' => 'No Codec (____)', + '_BIT' => 'BI_BITFIELDS (Raw RGB)', + '_JPG' => 'JPEG compressed', + '_PNG' => 'PNG compressed W3C/ISO/IEC (RFC-2083)', + '_RAW' => 'Full Frames (Uncompressed)', + '_RGB' => 'Raw RGB Bitmap', + '_RL4' => 'RLE 4bpp RGB', + '_RL8' => 'RLE 8bpp RGB', + '3IV1' => '3ivx MPEG-4 v1', + '3IV2' => '3ivx MPEG-4 v2', + '3IVX' => '3ivx MPEG-4', + 'AASC' => 'Autodesk Animator', + 'ABYR' => 'Kensington ?ABYR?', + 'AEMI' => 'Array Microsystems VideoONE MPEG1-I Capture', + 'AFLC' => 'Autodesk Animator FLC', + 'AFLI' => 'Autodesk Animator FLI', + 'AMPG' => 'Array Microsystems VideoONE MPEG', + 'ANIM' => 'Intel RDX (ANIM)', + 'AP41' => 'AngelPotion Definitive', + 'ASV1' => 'Asus Video v1', + 'ASV2' => 'Asus Video v2', + 'ASVX' => 'Asus Video 2.0 (audio)', + 'AUR2' => 'AuraVision Aura 2 Codec - YUV 4:2:2', + 'AURA' => 'AuraVision Aura 1 Codec - YUV 4:1:1', + 'AVDJ' => 'Independent JPEG Group\'s codec (AVDJ)', + 'AVRN' => 'Independent JPEG Group\'s codec (AVRN)', + 'AYUV' => '4:4:4 YUV (AYUV)', + 'AZPR' => 'Quicktime Apple Video (AZPR)', + 'BGR ' => 'Raw RGB32', + 'BLZ0' => 'FFmpeg MPEG-4', + 'BTVC' => 'Conexant Composite Video', + 'BINK' => 'RAD Game Tools Bink Video', + 'BT20' => 'Conexant Prosumer Video', + 'BTCV' => 'Conexant Composite Video Codec', + 'BW10' => 'Data Translation Broadway MPEG Capture', + 'CC12' => 'Intel YUV12', + 'CDVC' => 'Canopus DV', + 'CFCC' => 'Digital Processing Systems DPS Perception', + 'CGDI' => 'Microsoft Office 97 Camcorder Video', + 'CHAM' => 'Winnov Caviara Champagne', + 'CJPG' => 'Creative WebCam JPEG', + 'CLJR' => 'Cirrus Logic YUV 4:1:1', + 'CMYK' => 'Common Data Format in Printing (Colorgraph)', + 'CPLA' => 'Weitek 4:2:0 YUV Planar', + 'CRAM' => 'Microsoft Video 1 (CRAM)', + 'cvid' => 'Radius Cinepak', + 'CVID' => 'Radius Cinepak', + 'CWLT' => 'Microsoft Color WLT DIB', + 'CYUV' => 'Creative Labs YUV', + 'CYUY' => 'ATI YUV', + 'D261' => 'H.261', + 'D263' => 'H.263', + 'DIB ' => 'Device Independent Bitmap', + 'DIV1' => 'FFmpeg OpenDivX', + 'DIV2' => 'Microsoft MPEG-4 v1/v2', + 'DIV3' => 'DivX ;-) MPEG-4 v3.x Low-Motion', + 'DIV4' => 'DivX ;-) MPEG-4 v3.x Fast-Motion', + 'DIV5' => 'DivX MPEG-4 v5.x', + 'DIV6' => 'DivX ;-) (MS MPEG-4 v3.x)', + 'DIVX' => 'DivX MPEG-4 v4 (OpenDivX / Project Mayo)', + 'divx' => 'DivX MPEG-4', + 'DMB1' => 'Matrox Rainbow Runner hardware MJPEG', + 'DMB2' => 'Paradigm MJPEG', + 'DSVD' => '?DSVD?', + 'DUCK' => 'Duck TrueMotion 1.0', + 'DPS0' => 'DPS/Leitch Reality Motion JPEG', + 'DPSC' => 'DPS/Leitch PAR Motion JPEG', + 'DV25' => 'Matrox DVCPRO codec', + 'DV50' => 'Matrox DVCPRO50 codec', + 'DVC ' => 'IEC 61834 and SMPTE 314M (DVC/DV Video)', + 'DVCP' => 'IEC 61834 and SMPTE 314M (DVC/DV Video)', + 'DVHD' => 'IEC Standard DV 1125 lines @ 30fps / 1250 lines @ 25fps', + 'DVMA' => 'Darim Vision DVMPEG (dummy for MPEG compressor) (www.darvision.com)', + 'DVSL' => 'IEC Standard DV compressed in SD (SDL)', + 'DVAN' => '?DVAN?', + 'DVE2' => 'InSoft DVE-2 Videoconferencing', + 'dvsd' => 'IEC 61834 and SMPTE 314M DVC/DV Video', + 'DVSD' => 'IEC 61834 and SMPTE 314M DVC/DV Video', + 'DVX1' => 'Lucent DVX1000SP Video Decoder', + 'DVX2' => 'Lucent DVX2000S Video Decoder', + 'DVX3' => 'Lucent DVX3000S Video Decoder', + 'DX50' => 'DivX v5', + 'DXT1' => 'Microsoft DirectX Compressed Texture (DXT1)', + 'DXT2' => 'Microsoft DirectX Compressed Texture (DXT2)', + 'DXT3' => 'Microsoft DirectX Compressed Texture (DXT3)', + 'DXT4' => 'Microsoft DirectX Compressed Texture (DXT4)', + 'DXT5' => 'Microsoft DirectX Compressed Texture (DXT5)', + 'DXTC' => 'Microsoft DirectX Compressed Texture (DXTC)', + 'DXTn' => 'Microsoft DirectX Compressed Texture (DXTn)', + 'EM2V' => 'Etymonix MPEG-2 I-frame (www.etymonix.com)', + 'EKQ0' => 'Elsa ?EKQ0?', + 'ELK0' => 'Elsa ?ELK0?', + 'ESCP' => 'Eidos Escape', + 'ETV1' => 'eTreppid Video ETV1', + 'ETV2' => 'eTreppid Video ETV2', + 'ETVC' => 'eTreppid Video ETVC', + 'FLIC' => 'Autodesk FLI/FLC Animation', + 'FRWT' => 'Darim Vision Forward Motion JPEG (www.darvision.com)', + 'FRWU' => 'Darim Vision Forward Uncompressed (www.darvision.com)', + 'FLJP' => 'D-Vision Field Encoded Motion JPEG', + 'FRWA' => 'SoftLab-Nsk Forward Motion JPEG w/ alpha channel', + 'FRWD' => 'SoftLab-Nsk Forward Motion JPEG', + 'FVF1' => 'Iterated Systems Fractal Video Frame', + 'GLZW' => 'Motion LZW (gabest@freemail.hu)', + 'GPEG' => 'Motion JPEG (gabest@freemail.hu)', + 'GWLT' => 'Microsoft Greyscale WLT DIB', + 'H260' => 'Intel ITU H.260 Videoconferencing', + 'H261' => 'Intel ITU H.261 Videoconferencing', + 'H262' => 'Intel ITU H.262 Videoconferencing', + 'H263' => 'Intel ITU H.263 Videoconferencing', + 'H264' => 'Intel ITU H.264 Videoconferencing', + 'H265' => 'Intel ITU H.265 Videoconferencing', + 'H266' => 'Intel ITU H.266 Videoconferencing', + 'H267' => 'Intel ITU H.267 Videoconferencing', + 'H268' => 'Intel ITU H.268 Videoconferencing', + 'H269' => 'Intel ITU H.269 Videoconferencing', + 'HFYU' => 'Huffman Lossless Codec', + 'HMCR' => 'Rendition Motion Compensation Format (HMCR)', + 'HMRR' => 'Rendition Motion Compensation Format (HMRR)', + 'I263' => 'FFmpeg I263 decoder', + 'IF09' => 'Indeo YVU9 ("YVU9 with additional delta-frame info after the U plane")', + 'IUYV' => 'Interlaced version of UYVY (www.leadtools.com)', + 'IY41' => 'Interlaced version of Y41P (www.leadtools.com)', + 'IYU1' => '12 bit format used in mode 2 of the IEEE 1394 Digital Camera 1.04 spec IEEE standard', + 'IYU2' => '24 bit format used in mode 2 of the IEEE 1394 Digital Camera 1.04 spec IEEE standard', + 'IYUV' => 'Planar YUV format (8-bpp Y plane, followed by 8-bpp 2×2 U and V planes)', + 'i263' => 'Intel ITU H.263 Videoconferencing (i263)', + 'I420' => 'Intel Indeo 4', + 'IAN ' => 'Intel Indeo 4 (RDX)', + 'ICLB' => 'InSoft CellB Videoconferencing', + 'IGOR' => 'Power DVD', + 'IJPG' => 'Intergraph JPEG', + 'ILVC' => 'Intel Layered Video', + 'ILVR' => 'ITU-T H.263+', + 'IPDV' => 'I-O Data Device Giga AVI DV Codec', + 'IR21' => 'Intel Indeo 2.1', + 'IRAW' => 'Intel YUV Uncompressed', + 'IV30' => 'Intel Indeo 3.0', + 'IV31' => 'Intel Indeo 3.1', + 'IV32' => 'Ligos Indeo 3.2', + 'IV33' => 'Ligos Indeo 3.3', + 'IV34' => 'Ligos Indeo 3.4', + 'IV35' => 'Ligos Indeo 3.5', + 'IV36' => 'Ligos Indeo 3.6', + 'IV37' => 'Ligos Indeo 3.7', + 'IV38' => 'Ligos Indeo 3.8', + 'IV39' => 'Ligos Indeo 3.9', + 'IV40' => 'Ligos Indeo Interactive 4.0', + 'IV41' => 'Ligos Indeo Interactive 4.1', + 'IV42' => 'Ligos Indeo Interactive 4.2', + 'IV43' => 'Ligos Indeo Interactive 4.3', + 'IV44' => 'Ligos Indeo Interactive 4.4', + 'IV45' => 'Ligos Indeo Interactive 4.5', + 'IV46' => 'Ligos Indeo Interactive 4.6', + 'IV47' => 'Ligos Indeo Interactive 4.7', + 'IV48' => 'Ligos Indeo Interactive 4.8', + 'IV49' => 'Ligos Indeo Interactive 4.9', + 'IV50' => 'Ligos Indeo Interactive 5.0', + 'JBYR' => 'Kensington ?JBYR?', + 'JPEG' => 'Still Image JPEG DIB', + 'JPGL' => 'Pegasus Lossless Motion JPEG', + 'KMVC' => 'Team17 Software Karl Morton\'s Video Codec', + 'LSVM' => 'Vianet Lighting Strike Vmail (Streaming) (www.vianet.com)', + 'LEAD' => 'LEAD Video Codec', + 'Ljpg' => 'LEAD MJPEG Codec', + 'MDVD' => 'Alex MicroDVD Video (hacked MS MPEG-4) (www.tiasoft.de)', + 'MJPA' => 'Morgan Motion JPEG (MJPA) (www.morgan-multimedia.com)', + 'MJPB' => 'Morgan Motion JPEG (MJPB) (www.morgan-multimedia.com)', + 'MMES' => 'Matrox MPEG-2 I-frame', + 'MP2v' => 'Microsoft S-Mpeg 4 version 1 (MP2v)', + 'MP42' => 'Microsoft S-Mpeg 4 version 2 (MP42)', + 'MP43' => 'Microsoft S-Mpeg 4 version 3 (MP43)', + 'MP4S' => 'Microsoft S-Mpeg 4 version 3 (MP4S)', + 'MP4V' => 'FFmpeg MPEG-4', + 'MPG1' => 'FFmpeg MPEG 1/2', + 'MPG2' => 'FFmpeg MPEG 1/2', + 'MPG3' => 'FFmpeg DivX ;-) (MS MPEG-4 v3)', + 'MPG4' => 'Microsoft MPEG-4', + 'MPGI' => 'Sigma Designs MPEG', + 'MPNG' => 'PNG images decoder', + 'MSS1' => 'Microsoft Windows Screen Video', + 'MSZH' => 'LCL (Lossless Codec Library) (www.geocities.co.jp/Playtown-Denei/2837/LRC.htm)', + 'M261' => 'Microsoft H.261', + 'M263' => 'Microsoft H.263', + 'M4S2' => 'Microsoft Fully Compliant MPEG-4 v2 simple profile (M4S2)', + 'm4s2' => 'Microsoft Fully Compliant MPEG-4 v2 simple profile (m4s2)', + 'MC12' => 'ATI Motion Compensation Format (MC12)', + 'MCAM' => 'ATI Motion Compensation Format (MCAM)', + 'MJ2C' => 'Morgan Multimedia Motion JPEG2000', + 'mJPG' => 'IBM Motion JPEG w/ Huffman Tables', + 'MJPG' => 'Microsoft Motion JPEG DIB', + 'MP42' => 'Microsoft MPEG-4 (low-motion)', + 'MP43' => 'Microsoft MPEG-4 (fast-motion)', + 'MP4S' => 'Microsoft MPEG-4 (MP4S)', + 'mp4s' => 'Microsoft MPEG-4 (mp4s)', + 'MPEG' => 'Chromatic Research MPEG-1 Video I-Frame', + 'MPG4' => 'Microsoft MPEG-4 Video High Speed Compressor', + 'MPGI' => 'Sigma Designs MPEG', + 'MRCA' => 'FAST Multimedia Martin Regen Codec', + 'MRLE' => 'Microsoft Run Length Encoding', + 'MSVC' => 'Microsoft Video 1', + 'MTX1' => 'Matrox ?MTX1?', + 'MTX2' => 'Matrox ?MTX2?', + 'MTX3' => 'Matrox ?MTX3?', + 'MTX4' => 'Matrox ?MTX4?', + 'MTX5' => 'Matrox ?MTX5?', + 'MTX6' => 'Matrox ?MTX6?', + 'MTX7' => 'Matrox ?MTX7?', + 'MTX8' => 'Matrox ?MTX8?', + 'MTX9' => 'Matrox ?MTX9?', + 'MV12' => 'Motion Pixels Codec (old)', + 'MWV1' => 'Aware Motion Wavelets', + 'nAVI' => 'SMR Codec (hack of Microsoft MPEG-4) (IRC #shadowrealm)', + 'NT00' => 'NewTek LightWave HDTV YUV w/ Alpha (www.newtek.com)', + 'NUV1' => 'NuppelVideo', + 'NTN1' => 'Nogatech Video Compression 1', + 'NVS0' => 'nVidia GeForce Texture (NVS0)', + 'NVS1' => 'nVidia GeForce Texture (NVS1)', + 'NVS2' => 'nVidia GeForce Texture (NVS2)', + 'NVS3' => 'nVidia GeForce Texture (NVS3)', + 'NVS4' => 'nVidia GeForce Texture (NVS4)', + 'NVS5' => 'nVidia GeForce Texture (NVS5)', + 'NVT0' => 'nVidia GeForce Texture (NVT0)', + 'NVT1' => 'nVidia GeForce Texture (NVT1)', + 'NVT2' => 'nVidia GeForce Texture (NVT2)', + 'NVT3' => 'nVidia GeForce Texture (NVT3)', + 'NVT4' => 'nVidia GeForce Texture (NVT4)', + 'NVT5' => 'nVidia GeForce Texture (NVT5)', + 'PIXL' => 'MiroXL, Pinnacle PCTV', + 'PDVC' => 'I-O Data Device Digital Video Capture DV codec', + 'PGVV' => 'Radius Video Vision', + 'PHMO' => 'IBM Photomotion', + 'PIM1' => 'MPEG Realtime (Pinnacle Cards)', + 'PIM2' => 'Pegasus Imaging ?PIM2?', + 'PIMJ' => 'Pegasus Imaging Lossless JPEG', + 'PVEZ' => 'Horizons Technology PowerEZ', + 'PVMM' => 'PacketVideo Corporation MPEG-4', + 'PVW2' => 'Pegasus Imaging Wavelet Compression', + 'Q1.0' => 'Q-Team\'s QPEG 1.0 (www.q-team.de)', + 'Q1.1' => 'Q-Team\'s QPEG 1.1 (www.q-team.de)', + 'QPEG' => 'Q-Team QPEG 1.0', + 'qpeq' => 'Q-Team QPEG 1.1', + 'RGB ' => 'Raw BGR32', + 'RGBA' => 'Raw RGB w/ Alpha', + 'RMP4' => 'REALmagic MPEG-4 (unauthorized XVID copy) (www.sigmadesigns.com)', + 'ROQV' => 'Id RoQ File Video Decoder', + 'RPZA' => 'Quicktime Apple Video (RPZA)', + 'RUD0' => 'Rududu video codec (http://rududu.ifrance.com/rududu/)', + 'RV10' => 'RealVideo 1.0 (aka RealVideo 5.0)', + 'RV13' => 'RealVideo 1.0 (RV13)', + 'RV20' => 'RealVideo G2', + 'RV30' => 'RealVideo 8', + 'RV40' => 'RealVideo 9', + 'RGBT' => 'Raw RGB w/ Transparency', + 'RLE ' => 'Microsoft Run Length Encoder', + 'RLE4' => 'Run Length Encoded (4bpp, 16-color)', + 'RLE8' => 'Run Length Encoded (8bpp, 256-color)', + 'RT21' => 'Intel Indeo RealTime Video 2.1', + 'rv20' => 'RealVideo G2', + 'rv30' => 'RealVideo 8', + 'RVX ' => 'Intel RDX (RVX )', + 'SMC ' => 'Apple Graphics (SMC )', + 'SP54' => 'Logitech Sunplus Sp54 Codec for Mustek GSmart Mini 2', + 'SPIG' => 'Radius Spigot', + 'SVQ3' => 'Sorenson Video 3 (Apple Quicktime 5)', + 's422' => 'Tekram VideoCap C210 YUV 4:2:2', + 'SDCC' => 'Sun Communication Digital Camera Codec', + 'SFMC' => 'CrystalNet Surface Fitting Method', + 'SMSC' => 'Radius SMSC', + 'SMSD' => 'Radius SMSD', + 'smsv' => 'WorldConnect Wavelet Video', + 'SPIG' => 'Radius Spigot', + 'SPLC' => 'Splash Studios ACM Audio Codec (www.splashstudios.net)', + 'SQZ2' => 'Microsoft VXTreme Video Codec V2', + 'STVA' => 'ST Microelectronics CMOS Imager Data (Bayer)', + 'STVB' => 'ST Microelectronics CMOS Imager Data (Nudged Bayer)', + 'STVC' => 'ST Microelectronics CMOS Imager Data (Bunched)', + 'STVX' => 'ST Microelectronics CMOS Imager Data (Extended CODEC Data Format)', + 'STVY' => 'ST Microelectronics CMOS Imager Data (Extended CODEC Data Format with Correction Data)', + 'SV10' => 'Sorenson Video R1', + 'SVQ1' => 'Sorenson Video', + 'T420' => 'Toshiba YUV 4:2:0', + 'TM2A' => 'Duck TrueMotion Archiver 2.0 (www.duck.com)', + 'TVJP' => 'Pinnacle/Truevision Targa 2000 board (TVJP)', + 'TVMJ' => 'Pinnacle/Truevision Targa 2000 board (TVMJ)', + 'TY0N' => 'Tecomac Low-Bit Rate Codec (www.tecomac.com)', + 'TY2C' => 'Trident Decompression Driver', + 'TLMS' => 'TeraLogic Motion Intraframe Codec (TLMS)', + 'TLST' => 'TeraLogic Motion Intraframe Codec (TLST)', + 'TM20' => 'Duck TrueMotion 2.0', + 'TM2X' => 'Duck TrueMotion 2X', + 'TMIC' => 'TeraLogic Motion Intraframe Codec (TMIC)', + 'TMOT' => 'Horizons Technology TrueMotion S', + 'tmot' => 'Horizons TrueMotion Video Compression', + 'TR20' => 'Duck TrueMotion RealTime 2.0', + 'TSCC' => 'TechSmith Screen Capture Codec', + 'TV10' => 'Tecomac Low-Bit Rate Codec', + 'TY2N' => 'Trident ?TY2N?', + 'U263' => 'UB Video H.263/H.263+/H.263++ Decoder', + 'UMP4' => 'UB Video MPEG 4 (www.ubvideo.com)', + 'UYNV' => 'Nvidia UYVY packed 4:2:2', + 'UYVP' => 'Evans & Sutherland YCbCr 4:2:2 extended precision', + 'UCOD' => 'eMajix.com ClearVideo', + 'ULTI' => 'IBM Ultimotion', + 'UYVY' => 'UYVY packed 4:2:2', + 'V261' => 'Lucent VX2000S', + 'VIFP' => 'VFAPI Reader Codec (www.yks.ne.jp/~hori/)', + 'VIV1' => 'FFmpeg H263+ decoder', + 'VIV2' => 'Vivo H.263', + 'VQC2' => 'Vector-quantised codec 2 (research) http://eprints.ecs.soton.ac.uk/archive/00001310/01/VTC97-js.pdf)', + 'VTLP' => 'Alaris VideoGramPiX', + 'VYU9' => 'ATI YUV (VYU9)', + 'VYUY' => 'ATI YUV (VYUY)', + 'V261' => 'Lucent VX2000S', + 'V422' => 'Vitec Multimedia 24-bit YUV 4:2:2 Format', + 'V655' => 'Vitec Multimedia 16-bit YUV 4:2:2 Format', + 'VCR1' => 'ATI Video Codec 1', + 'VCR2' => 'ATI Video Codec 2', + 'VCR3' => 'ATI VCR 3.0', + 'VCR4' => 'ATI VCR 4.0', + 'VCR5' => 'ATI VCR 5.0', + 'VCR6' => 'ATI VCR 6.0', + 'VCR7' => 'ATI VCR 7.0', + 'VCR8' => 'ATI VCR 8.0', + 'VCR9' => 'ATI VCR 9.0', + 'VDCT' => 'Vitec Multimedia Video Maker Pro DIB', + 'VDOM' => 'VDOnet VDOWave', + 'VDOW' => 'VDOnet VDOLive (H.263)', + 'VDTZ' => 'Darim Vison VideoTizer YUV', + 'VGPX' => 'Alaris VideoGramPiX', + 'VIDS' => 'Vitec Multimedia YUV 4:2:2 CCIR 601 for V422', + 'VIVO' => 'Vivo H.263 v2.00', + 'vivo' => 'Vivo H.263', + 'VIXL' => 'Miro/Pinnacle Video XL', + 'VLV1' => 'VideoLogic/PURE Digital Videologic Capture', + 'VP30' => 'On2 VP3.0', + 'VP31' => 'On2 VP3.1', + 'VX1K' => 'Lucent VX1000S Video Codec', + 'VX2K' => 'Lucent VX2000S Video Codec', + 'VXSP' => 'Lucent VX1000SP Video Codec', + 'WBVC' => 'Winbond W9960', + 'WHAM' => 'Microsoft Video 1 (WHAM)', + 'WINX' => 'Winnov Software Compression', + 'WJPG' => 'AverMedia Winbond JPEG', + 'WMV1' => 'Windows Media Video V7', + 'WMV2' => 'Windows Media Video V8', + 'WMV3' => 'Windows Media Video V9', + 'WNV1' => 'Winnov Hardware Compression', + 'XYZP' => 'Extended PAL format XYZ palette (www.riff.org)', + 'x263' => 'Xirlink H.263', + 'XLV0' => 'NetXL Video Decoder', + 'XMPG' => 'Xing MPEG (I-Frame only)', + 'XVID' => 'XviD MPEG-4 (www.xvid.org)', + 'XXAN' => '?XXAN?', + 'YU92' => 'Intel YUV (YU92)', + 'YUNV' => 'Nvidia Uncompressed YUV 4:2:2', + 'YUVP' => 'Extended PAL format YUV palette (www.riff.org)', + 'Y211' => 'YUV 2:1:1 Packed', + 'Y411' => 'YUV 4:1:1 Packed', + 'Y41B' => 'Weitek YUV 4:1:1 Planar', + 'Y41P' => 'Brooktree PC1 YUV 4:1:1 Packed', + 'Y41T' => 'Brooktree PC1 YUV 4:1:1 with transparency', + 'Y42B' => 'Weitek YUV 4:2:2 Planar', + 'Y42T' => 'Brooktree UYUV 4:2:2 with transparency', + 'Y422' => 'ADS Technologies Copy of UYVY used in Pyro WebCam firewire camera', + 'Y800' => 'Simple, single Y plane for monochrome images', + 'Y8 ' => 'Grayscale video', + 'YC12' => 'Intel YUV 12 codec', + 'YUV8' => 'Winnov Caviar YUV8', + 'YUV9' => 'Intel YUV9', + 'YUY2' => 'Uncompressed YUV 4:2:2', + 'YUYV' => 'Canopus YUV', + 'YV12' => 'YVU12 Planar', + 'YVU9' => 'Intel YVU9 Planar (8-bpp Y plane, followed by 8-bpp 4x4 U and V planes)', + 'YVYU' => 'YVYU 4:2:2 Packed', + 'ZLIB' => 'Lossless Codec Library zlib compression (www.geocities.co.jp/Playtown-Denei/2837/LRC.htm)', + 'ZPEG' => 'Metheus Video Zipper' + ); + + return @$lookup[$four_cc]; + } + + + + public static function RIFFcommentsParse(&$riff_info_aray, &$comments_target_array) { + + static $lookup = array( + 'IARL' => 'archivallocation', + 'IART' => 'artist', + 'ICDS' => 'costumedesigner', + 'ICMS' => 'commissionedby', + 'ICMT' => 'comment', + 'ICNT' => 'country', + 'ICOP' => 'copyright', + 'ICRD' => 'creationdate', + 'IDIM' => 'dimensions', + 'IDIT' => 'digitizationdate', + 'IDPI' => 'resolution', + 'IDST' => 'distributor', + 'IEDT' => 'editor', + 'IENG' => 'engineers', + 'IFRM' => 'accountofparts', + 'IGNR' => 'genre', + 'IKEY' => 'keywords', + 'ILGT' => 'lightness', + 'ILNG' => 'language', + 'IMED' => 'orignalmedium', + 'IMUS' => 'composer', + 'INAM' => 'title', + 'IPDS' => 'productiondesigner', + 'IPLT' => 'palette', + 'IPRD' => 'product', + 'IPRO' => 'producer', + 'IPRT' => 'part', + 'IRTD' => 'rating', + 'ISBJ' => 'subject', + 'ISFT' => 'software', + 'ISGN' => 'secondarygenre', + 'ISHP' => 'sharpness', + 'ISRC' => 'sourcesupplier', + 'ISRF' => 'digitizationsource', + 'ISTD' => 'productionstudio', + 'ISTR' => 'starring', + 'ITCH' => 'encoded_by', + 'IWEB' => 'url', + 'IWRI' => 'writer' + ); + + foreach ($lookup as $key => $value) { + if (isset($riff_info_aray[$key])) { + foreach ($riff_info_aray[$key] as $comment_id => $comment_data) { + if (trim($comment_data['data']) != '') { + @$comments_target_array[$value][] = trim($comment_data['data']); + } + } + } + } + return true; + } + + + + public static function array_merge_noclobber($array1, $array2) { + if (!is_array($array1) || !is_array($array2)) { + return false; + } + $new_array = $array1; + foreach ($array2 as $key => $val) { + if (is_array($val) && isset($new_array[$key]) && is_array($new_array[$key])) { + $new_array[$key] = getid3_riff::array_merge_noclobber($new_array[$key], $val); + } elseif (!isset($new_array[$key])) { + $new_array[$key] = $val; + } + } + return $new_array; + } + + + + public static function DateMac2Unix($mac_date) { + + // Macintosh timestamp: seconds since 00:00h January 1, 1904 + // UNIX timestamp: seconds since 00:00h January 1, 1970 + return (int)($mac_date - 2082844800); + } + + + + public static function FixedPoint16_16($raw_data) { + + return getid3_lib::BigEndian2Int(substr($raw_data, 0, 2)) + (float)(getid3_lib::BigEndian2Int(substr($raw_data, 2, 2)) / 65536); // pow(2, 16) = 65536 + } + + + + function BigEndian2Float($byte_word) { + + // ANSI/IEEE Standard 754-1985, Standard for Binary Floating Point Arithmetic + // http://www.psc.edu/general/software/packages/ieee/ieee.html + // http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/ieee.html + + $bit_word = getid3_lib::BigEndian2Bin($byte_word); + $sign_bit = $bit_word{0}; + + switch (strlen($byte_word) * 8) { + case 32: + $exponent_bits = 8; + $fraction_bits = 23; + break; + + case 64: + $exponent_bits = 11; + $fraction_bits = 52; + break; + + case 80: + // 80-bit Apple SANE format + // http://www.mactech.com/articles/mactech/Vol.06/06.01/SANENormalized/ + $exponent_string = substr($bit_word, 1, 15); + $is_normalized = intval($bit_word{16}); + $fraction_string = substr($bit_word, 17, 63); + $exponent = pow(2, bindec($exponent_string) - 16383); + $fraction = $is_normalized + bindec($fraction_string) / bindec('1'.str_repeat('0', strlen($fraction_string))); + $float_value = $exponent * $fraction; + if ($sign_bit == '1') { + $float_value *= -1; + } + return $float_value; + break; + + default: + return false; + break; + } + $exponent_string = substr($bit_word, 1, $exponent_bits); + $fraction_string = substr($bit_word, $exponent_bits + 1, $fraction_bits); + $exponent = bindec($exponent_string); + $fraction = bindec($fraction_string); + + if (($exponent == (pow(2, $exponent_bits) - 1)) && ($fraction != 0)) { + // Not a Number + $float_value = false; + } elseif (($exponent == (pow(2, $exponent_bits) - 1)) && ($fraction == 0)) { + if ($sign_bit == '1') { + $float_value = '-infinity'; + } else { + $float_value = '+infinity'; + } + } elseif (($exponent == 0) && ($fraction == 0)) { + if ($sign_bit == '1') { + $float_value = -0; + } else { + $float_value = 0; + } + $float_value = ($sign_bit ? 0 : -0); + } elseif (($exponent == 0) && ($fraction != 0)) { + // These are 'unnormalized' values + $float_value = pow(2, (-1 * (pow(2, $exponent_bits - 1) - 2))) * bindec($fraction_string) / bindec('1'.str_repeat('0', strlen($fraction_string))); + if ($sign_bit == '1') { + $float_value *= -1; + } + } elseif ($exponent != 0) { + $float_value = pow(2, ($exponent - (pow(2, $exponent_bits - 1) - 1))) * (1 + bindec($fraction_string) / bindec('1'.str_repeat('0', strlen($fraction_string)))); + if ($sign_bit == '1') { + $float_value *= -1; + } + } + return (float) $float_value; + } +} + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.audio-video.swf.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.audio-video.swf.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,154 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio-video.swf.php | +// | module for analyzing Macromedia Shockwave Flash files. | +// | dependencies: zlib support in PHP | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio-video.swf.php,v 1.2 2006/11/02 10:48:00 ah Exp $ + + + +class getid3_swf extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->info['fileformat'] = 'swf'; + $getid3->info['video']['dataformat'] = 'swf'; + + // http://www.openswf.org/spec/SWFfileformat.html + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + + $swf_file_data = fread($getid3->fp, $getid3->info['avdataend'] - $getid3->info['avdataoffset']); // 8 + 2 + 2 + max(9) bytes NOT including Frame_Size RECT data + + $getid3->info['swf']['header']['signature'] = substr($swf_file_data, 0, 3); + switch ($getid3->info['swf']['header']['signature']) { + + case 'FWS': + $getid3->info['swf']['header']['compressed'] = false; + break; + + case 'CWS': + $getid3->info['swf']['header']['compressed'] = true; + break; + + default: + throw new getid3_exception('Expecting "FWS" or "CWS" at offset '.$getid3->info['avdataoffset'].', found "'.$getid3->info['swf']['header']['signature'].'"'); + } + $getid3->info['swf']['header']['version'] = getid3_lib::LittleEndian2Int($swf_file_data{3}); + $getid3->info['swf']['header']['length'] = getid3_lib::LittleEndian2Int(substr($swf_file_data, 4, 4)); + + if (!function_exists('gzuncompress')) { + throw new getid3_exception('getid3_swf requires --zlib support in PHP.'); + } + + if ($getid3->info['swf']['header']['compressed']) { + + if ($uncompressed_file_data = @gzuncompress(substr($swf_file_data, 8))) { + $swf_file_data = substr($swf_file_data, 0, 8).$uncompressed_file_data; + + } else { + throw new getid3_exception('Error decompressing compressed SWF data'); + } + + } + + $frame_size_bits_per_value = (ord(substr($swf_file_data, 8, 1)) & 0xF8) >> 3; + $frame_size_data_length = ceil((5 + (4 * $frame_size_bits_per_value)) / 8); + $frame_size_data_string = str_pad(decbin(ord($swf_file_data[8]) & 0x07), 3, '0', STR_PAD_LEFT); + + for ($i = 1; $i < $frame_size_data_length; $i++) { + $frame_size_data_string .= str_pad(decbin(ord(substr($swf_file_data, 8 + $i, 1))), 8, '0', STR_PAD_LEFT); + } + + list($x1, $x2, $y1, $y2) = explode("\n", wordwrap($frame_size_data_string, $frame_size_bits_per_value, "\n", 1)); + $getid3->info['swf']['header']['frame_width'] = bindec($x2); + $getid3->info['swf']['header']['frame_height'] = bindec($y2); + + // http://www-lehre.informatik.uni-osnabrueck.de/~fbstark/diplom/docs/swf/Flash_Uncovered.htm + // Next in the header is the frame rate, which is kind of weird. + // It is supposed to be stored as a 16bit integer, but the first byte + // (or last depending on how you look at it) is completely ignored. + // Example: 0x000C -> 0x0C -> 12 So the frame rate is 12 fps. + + // Byte at (8 + $frame_size_data_length) is always zero and ignored + $getid3->info['swf']['header']['frame_rate'] = getid3_lib::LittleEndian2Int($swf_file_data[9 + $frame_size_data_length]); + $getid3->info['swf']['header']['frame_count'] = getid3_lib::LittleEndian2Int(substr($swf_file_data, 10 + $frame_size_data_length, 2)); + + $getid3->info['video']['frame_rate'] = $getid3->info['swf']['header']['frame_rate']; + $getid3->info['video']['resolution_x'] = intval(round($getid3->info['swf']['header']['frame_width'] / 20)); + $getid3->info['video']['resolution_y'] = intval(round($getid3->info['swf']['header']['frame_height'] / 20)); + $getid3->info['video']['pixel_aspect_ratio'] = (float)1; + + if (($getid3->info['swf']['header']['frame_count'] > 0) && ($getid3->info['swf']['header']['frame_rate'] > 0)) { + $getid3->info['playtime_seconds'] = $getid3->info['swf']['header']['frame_count'] / $getid3->info['swf']['header']['frame_rate']; + } + + + // SWF tags + + $current_offset = 12 + $frame_size_data_length; + $swf_data_length = strlen($swf_file_data); + + while ($current_offset < $swf_data_length) { + + $tag_ID_tag_length = getid3_lib::LittleEndian2Int(substr($swf_file_data, $current_offset, 2)); + $tag_ID = ($tag_ID_tag_length & 0xFFFC) >> 6; + $tag_length = ($tag_ID_tag_length & 0x003F); + $current_offset += 2; + if ($tag_length == 0x3F) { + $tag_length = getid3_lib::LittleEndian2Int(substr($swf_file_data, $current_offset, 4)); + $current_offset += 4; + } + + unset($tag_data); + $tag_data['offset'] = $current_offset; + $tag_data['size'] = $tag_length; + $tag_data['id'] = $tag_ID; + $tag_data['data'] = substr($swf_file_data, $current_offset, $tag_length); + switch ($tag_ID) { + + case 0: // end of movie + break 2; + + case 9: // Set background color + $getid3->info['swf']['bgcolor'] = strtoupper(str_pad(dechex(getid3_lib::BigEndian2Int($tag_data['data'])), 6, '0', STR_PAD_LEFT)); + break; + + default: + /* + if ($ReturnAllTagData) { + $getid3->info['swf']['tags'][] = $tag_data; + } + */ + break; + } + + $current_offset += $tag_length; + } + + return true; + } + +} + + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.aac_adif.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.aac_adif.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,311 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.aac_adif.php | +// | Module for analyzing AAC files with ADIF header. | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.aac_adif.php,v 1.3 2006/11/02 10:48:00 ah Exp $ + + + +class getid3_aac_adif extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + // http://faac.sourceforge.net/wiki/index.php?page=ADIF + // http://libmpeg.org/mpeg4/doc/w2203tfs.pdf + // adif_header() { + // adif_id 32 + // copyright_id_present 1 + // if( copyright_id_present ) + // copyright_id 72 + // original_copy 1 + // home 1 + // bitstream_type 1 + // bitrate 23 + // num_program_config_elements 4 + // for (i = 0; i < num_program_config_elements + 1; i++ ) { + // if( bitstream_type == '0' ) + // adif_buffer_fullness 20 + // program_config_element() + // } + // } + + + $getid3->info['fileformat'] = 'aac'; + $getid3->info['audio']['dataformat'] = 'aac'; + $getid3->info['audio']['lossless'] = false; + + $getid3->info['aac']['header'] = array () ; + $info_aac = &$getid3->info['aac']; + $info_aac_header = & $info_aac['header']; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $aac_header_bitstream = getid3_lib::BigEndian2Bin(fread($getid3->fp, 1024)); + + $info_aac['header_type'] = 'ADIF'; + $info_aac_header['mpeg_version'] = 4; + $bit_offset = 32; + + $info_aac_header['copyright'] = $aac_header_bitstream{$bit_offset++} == '1'; + if ($info_aac_header['copyright']) { + $info_aac_header['copyright_id'] = getid3_aac_adif::Bin2String(substr($aac_header_bitstream, $bit_offset, 72)); + $bit_offset += 72; + } + + $info_aac_header['original_copy'] = $aac_header_bitstream{$bit_offset++} == '1'; + $info_aac_header['home'] = $aac_header_bitstream{$bit_offset++} == '1'; + $info_aac_header['is_vbr'] = $aac_header_bitstream{$bit_offset++} == '1'; + + if ($info_aac_header['is_vbr']) { + $getid3->info['audio']['bitrate_mode'] = 'vbr'; + $info_aac_header['bitrate_max'] = bindec(substr($aac_header_bitstream, $bit_offset, 23)); + $bit_offset += 23; + } + else { + $getid3->info['audio']['bitrate_mode'] = 'cbr'; + $info_aac_header['bitrate'] = bindec(substr($aac_header_bitstream, $bit_offset, 23)); + $bit_offset += 23; + $getid3->info['audio']['bitrate'] = $info_aac_header['bitrate']; + } + + $info_aac_header['num_program_configs'] = 1 + bindec(substr($aac_header_bitstream, $bit_offset, 4)); + $bit_offset += 4; + + for ($i = 0; $i < $info_aac_header['num_program_configs']; $i++) { + + // http://www.audiocoding.com/wiki/index.php?page=program_config_element + + // buffer_fullness 20 + + // element_instance_tag 4 + // object_type 2 + // sampling_frequency_index 4 + // num_front_channel_elements 4 + // num_side_channel_elements 4 + // num_back_channel_elements 4 + // num_lfe_channel_elements 2 + // num_assoc_data_elements 3 + // num_valid_cc_elements 4 + // mono_mixdown_present 1 + // mono_mixdown_element_number 4 if mono_mixdown_present == 1 + // stereo_mixdown_present 1 + // stereo_mixdown_element_number 4 if stereo_mixdown_present == 1 + // matrix_mixdown_idx_present 1 + // matrix_mixdown_idx 2 if matrix_mixdown_idx_present == 1 + // pseudo_surround_enable 1 if matrix_mixdown_idx_present == 1 + // for (i = 0; i < num_front_channel_elements; i++) { + // front_element_is_cpe[i] 1 + // front_element_tag_select[i] 4 + // } + // for (i = 0; i < num_side_channel_elements; i++) { + // side_element_is_cpe[i] 1 + // side_element_tag_select[i] 4 + // } + // for (i = 0; i < num_back_channel_elements; i++) { + // back_element_is_cpe[i] 1 + // back_element_tag_select[i] 4 + // } + // for (i = 0; i < num_lfe_channel_elements; i++) { + // lfe_element_tag_select[i] 4 + // } + // for (i = 0; i < num_assoc_data_elements; i++) { + // assoc_data_element_tag_select[i] 4 + // } + // for (i = 0; i < num_valid_cc_elements; i++) { + // cc_element_is_ind_sw[i] 1 + // valid_cc_element_tag_select[i] 4 + // } + // byte_alignment() VAR + // comment_field_bytes 8 + // for (i = 0; i < comment_field_bytes; i++) { + // comment_field_data[i] 8 + // } + + $info_aac['program_configs'][$i] = array (); + $info_aac_program_configs_i = &$info_aac['program_configs'][$i]; + + if (!$info_aac_header['is_vbr']) { + $info_aac_program_configs_i['buffer_fullness'] = bindec(substr($aac_header_bitstream, $bit_offset, 20)); + $bit_offset += 20; + } + + $info_aac_program_configs_i['element_instance_tag'] = bindec(substr($aac_header_bitstream, $bit_offset, 4)); + $info_aac_program_configs_i['object_type'] = bindec(substr($aac_header_bitstream, $bit_offset + 4, 2)); + $info_aac_program_configs_i['sampling_frequency_index'] = bindec(substr($aac_header_bitstream, $bit_offset + 6, 4)); + $info_aac_program_configs_i['num_front_channel_elements'] = bindec(substr($aac_header_bitstream, $bit_offset + 10, 4)); + $info_aac_program_configs_i['num_side_channel_elements'] = bindec(substr($aac_header_bitstream, $bit_offset + 14, 4)); + $info_aac_program_configs_i['num_back_channel_elements'] = bindec(substr($aac_header_bitstream, $bit_offset + 18, 4)); + $info_aac_program_configs_i['num_lfe_channel_elements'] = bindec(substr($aac_header_bitstream, $bit_offset + 22, 2)); + $info_aac_program_configs_i['num_assoc_data_elements'] = bindec(substr($aac_header_bitstream, $bit_offset + 24, 3)); + $info_aac_program_configs_i['num_valid_cc_elements'] = bindec(substr($aac_header_bitstream, $bit_offset + 27, 4)); + $bit_offset += 31; + + $info_aac_program_configs_i['mono_mixdown_present'] = $aac_header_bitstream{$bit_offset++} == 1; + if ($info_aac_program_configs_i['mono_mixdown_present']) { + $info_aac_program_configs_i['mono_mixdown_element_number'] = bindec(substr($aac_header_bitstream, $bit_offset, 4)); + $bit_offset += 4; + } + + $info_aac_program_configs_i['stereo_mixdown_present'] = $aac_header_bitstream{$bit_offset++} == 1; + if ($info_aac_program_configs_i['stereo_mixdown_present']) { + $info_aac_program_configs_i['stereo_mixdown_element_number'] = bindec(substr($aac_header_bitstream, $bit_offset, 4)); + $bit_offset += 4; + } + + $info_aac_program_configs_i['matrix_mixdown_idx_present'] = $aac_header_bitstream{$bit_offset++} == 1; + if ($info_aac_program_configs_i['matrix_mixdown_idx_present']) { + $info_aac_program_configs_i['matrix_mixdown_idx'] = bindec(substr($aac_header_bitstream, $bit_offset, 2)); + $bit_offset += 2; + $info_aac_program_configs_i['pseudo_surround_enable'] = $aac_header_bitstream{$bit_offset++} == 1; + } + + for ($j = 0; $j < $info_aac_program_configs_i['num_front_channel_elements']; $j++) { + $info_aac_program_configs_i['front_element_is_cpe'][$j] = $aac_header_bitstream{$bit_offset++} == 1; + $info_aac_program_configs_i['front_element_tag_select'][$j] = bindec(substr($aac_header_bitstream, $bit_offset, 4)); + $bit_offset += 4; + } + for ($j = 0; $j < $info_aac_program_configs_i['num_side_channel_elements']; $j++) { + $info_aac_program_configs_i['side_element_is_cpe'][$j] = $aac_header_bitstream{$bit_offset++} == 1; + $info_aac_program_configs_i['side_element_tag_select'][$j] = bindec(substr($aac_header_bitstream, $bit_offset, 4)); + $bit_offset += 4; + } + for ($j = 0; $j < $info_aac_program_configs_i['num_back_channel_elements']; $j++) { + $info_aac_program_configs_i['back_element_is_cpe'][$j] = $aac_header_bitstream{$bit_offset++} == 1; + $info_aac_program_configs_i['back_element_tag_select'][$j] = bindec(substr($aac_header_bitstream, $bit_offset, 4)); + $bit_offset += 4; + } + for ($j = 0; $j < $info_aac_program_configs_i['num_lfe_channel_elements']; $j++) { + $info_aac_program_configs_i['lfe_element_tag_select'][$j] = bindec(substr($aac_header_bitstream, $bit_offset, 4)); + $bit_offset += 4; + } + for ($j = 0; $j < $info_aac_program_configs_i['num_assoc_data_elements']; $j++) { + $info_aac_program_configs_i['assoc_data_element_tag_select'][$j] = bindec(substr($aac_header_bitstream, $bit_offset, 4)); + $bit_offset += 4; + } + for ($j = 0; $j < $info_aac_program_configs_i['num_valid_cc_elements']; $j++) { + $info_aac_program_configs_i['cc_element_is_ind_sw'][$j] = $aac_header_bitstream{$bit_offset++} == 1; + $info_aac_program_configs_i['valid_cc_element_tag_select'][$j] = bindec(substr($aac_header_bitstream, $bit_offset, 4)); + $bit_offset += 4; + } + + $bit_offset = ceil($bit_offset / 8) * 8; + + $info_aac_program_configs_i['comment_field_bytes'] = bindec(substr($aac_header_bitstream, $bit_offset, 8)); + $bit_offset += 8; + + $info_aac_program_configs_i['comment_field'] = getid3_aac_adif::Bin2String(substr($aac_header_bitstream, $bit_offset, 8 * $info_aac_program_configs_i['comment_field_bytes'])); + $bit_offset += 8 * $info_aac_program_configs_i['comment_field_bytes']; + + $info_aac_header['profile_text'] = getid3_aac_adif::AACprofileLookup($info_aac_program_configs_i['object_type'], $info_aac_header['mpeg_version']); + $info_aac_program_configs_i['sampling_frequency'] = $getid3->info['audio']['sample_rate'] = getid3_aac_adif::AACsampleRateLookup($info_aac_program_configs_i['sampling_frequency_index']); + $getid3->info['audio']['channels'] = getid3_aac_adif::AACchannelCountCalculate($info_aac_program_configs_i); + + if ($info_aac_program_configs_i['comment_field']) { + $info_aac['comments'][] = $info_aac_program_configs_i['comment_field']; + } + } + + $getid3->info['playtime_seconds'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / $getid3->info['audio']['bitrate']; + $getid3->info['audio']['encoder_options'] = $info_aac['header_type'].' '.$info_aac_header['profile_text']; + + return true; + } + + + + public static function Bin2String($bin_string) { + // return 'hi' for input of '0110100001101001' + $string = ''; + $bin_string_reversed = strrev($bin_string); + for ($i = 0; $i < strlen($bin_string_reversed); $i += 8) { + $string = chr(bindec(strrev(substr($bin_string_reversed, $i, 8)))).$string; + } + return $string; + } + + + + public static function AACsampleRateLookup($samplerate_id) { + + static $lookup = array ( + 0 => 96000, + 1 => 88200, + 2 => 64000, + 3 => 48000, + 4 => 44100, + 5 => 32000, + 6 => 24000, + 7 => 22050, + 8 => 16000, + 9 => 12000, + 10 => 11025, + 11 => 8000, + 12 => 0, + 13 => 0, + 14 => 0, + 15 => 0 + ); + return (isset($lookup[$samplerate_id]) ? $lookup[$samplerate_id] : 'invalid'); + } + + + + public static function AACprofileLookup($profile_id, $mpeg_version) { + + static $lookup = array ( + 2 => array ( + 0 => 'Main profile', + 1 => 'Low Complexity profile (LC)', + 2 => 'Scalable Sample Rate profile (SSR)', + 3 => '(reserved)' + ), + 4 => array ( + 0 => 'AAC_MAIN', + 1 => 'AAC_LC', + 2 => 'AAC_SSR', + 3 => 'AAC_LTP' + ) + ); + return (isset($lookup[$mpeg_version][$profile_id]) ? $lookup[$mpeg_version][$profile_id] : 'invalid'); + } + + + + public static function AACchannelCountCalculate($program_configs) { + + $channels = 0; + + foreach (array ('front', 'side', 'back') as $placement) { + for ($i = 0; $i < $program_configs['num_'.$placement.'_channel_elements']; $i++) { + + // Each element is channel pair (CPE = Channel Pair Element) + $channels += 1 + ($program_configs[$placement.'_element_is_cpe'][$i] ? 1 : 0); + } + } + + return $channels + $program_configs['num_lfe_channel_elements']; + } + +} + + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.aac_adts.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.aac_adts.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,282 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.aac_adts.php | +// | Module for analyzing AAC files with ADTS header. | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.aac_adts.php,v 1.4 2006/11/02 10:48:01 ah Exp $ + + + +class getid3_aac_adts extends getid3_handler +{ + + public $option_max_frames_to_scan = 1000000; + public $option_return_extended_info = false; + + + private $decbin_cache; + private $bitrate_cache; + + + + public function __construct(getID3 $getid3) { + + parent::__construct($getid3); + + // Populate bindec_cache + for ($i = 0; $i < 256; $i++) { + $this->decbin_cache[chr($i)] = str_pad(decbin($i), 8, '0', STR_PAD_LEFT); + } + + // Init cache + $this->bitrate_cache = array (); + + // Fast scanning? + if (!$getid3->option_accurate_results) { + $this->option_max_frames_to_scan = 200; + $getid3->warning('option_accurate_results set to false - bitrate and playing time are not accurate.'); + } + } + + + + public function Analyze() { + + $getid3 = $this->getid3; + + // based loosely on code from AACfile by Jurgen Faul + // http://jfaul.de/atl or http://j-faul.virtualave.net/atl/atl.html + + + // http://faac.sourceforge.net/wiki/index.php?page=ADTS + + // * ADTS Fixed Header: these don't change from frame to frame + // syncword 12 always: '111111111111' + // ID 1 0: MPEG-4, 1: MPEG-2 + // layer 2 always: '00' + // protection_absent 1 + // profile 2 + // sampling_frequency_index 4 + // private_bit 1 + // channel_configuration 3 + // original/copy 1 + // home 1 + // emphasis 2 only if ID == 0 (ie MPEG-4) + + // * ADTS Variable Header: these can change from frame to frame + // copyright_identification_bit 1 + // copyright_identification_start 1 + // aac_frame_length 13 length of the frame including header (in bytes) + // adts_buffer_fullness 11 0x7FF indicates VBR + // no_raw_data_blocks_in_frame 2 + + // * ADTS Error check + // crc_check 16 only if protection_absent == 0 + + $getid3->info['aac']['header'] = array () ; + $info_aac = &$getid3->info['aac']; + $info_aac_header = & $info_aac['header']; + + $byte_offset = $frame_number = 0; + + while (true) { + + // Breaks out when end-of-file encountered, or invalid data found, + // or MaxFramesToScan frames have been scanned + + fseek($getid3->fp, $byte_offset, SEEK_SET); + + // First get substring + $sub_string = fread($getid3->fp, 10); + $sub_string_length = strlen($sub_string); + if ($sub_string_length != 10) { + throw new getid3_exception('Failed to read 10 bytes at offset '.(ftell($getid3->fp) - $sub_string_length).' (only read '.$sub_string_length.' bytes)'); + } + + // Initialise $aac_header_bitstream + $aac_header_bitstream = ''; + + // Loop thru substring chars + for ($i = 0; $i < 10; $i++) { + $aac_header_bitstream .= $this->decbin_cache[$sub_string[$i]]; + } + + $sync_test = bindec(substr($aac_header_bitstream, 0, 12)); + $bit_offset = 12; + + if ($sync_test != 0x0FFF) { + throw new getid3_exception('Synch pattern (0x0FFF) not found at offset '.(ftell($getid3->fp) - 10).' (found 0x0'.strtoupper(dechex($sync_test)).' instead)'); + } + + // Only gather info once - this takes time to do 1000 times! + if ($frame_number > 0) { + + // MPEG-4: 20, // MPEG-2: 18 + $bit_offset += $aac_header_bitstream[$bit_offset] ? 18 : 20; + } + + // Gather info for first frame only - this takes time to do 1000 times! + else { + + $info_aac['header_type'] = 'ADTS'; + $info_aac_header['synch'] = $sync_test; + $getid3->info['fileformat'] = 'aac'; + $getid3->info['audio']['dataformat'] = 'aac'; + + $info_aac_header['mpeg_version'] = $aac_header_bitstream{$bit_offset++} == '0' ? 4 : 2; + $info_aac_header['layer'] = bindec(substr($aac_header_bitstream, $bit_offset, 2)); + $bit_offset += 2; + + if ($info_aac_header['layer'] != 0) { + throw new getid3_exception('Layer error - expected 0x00, found 0x'.dechex($info_aac_header['layer']).' instead'); + } + + $info_aac_header['crc_present'] = $aac_header_bitstream{$bit_offset++} == '0' ? true : false; + + $info_aac_header['profile_id'] = bindec(substr($aac_header_bitstream, $bit_offset, 2)); + $bit_offset += 2; + + $info_aac_header['profile_text'] = getid3_aac_adts::AACprofileLookup($info_aac_header['profile_id'], $info_aac_header['mpeg_version']); + + $info_aac_header['sample_frequency_index'] = bindec(substr($aac_header_bitstream, $bit_offset, 4)); + $bit_offset += 4; + + $info_aac_header['sample_frequency'] = getid3_aac_adts::AACsampleRateLookup($info_aac_header['sample_frequency_index']); + + $getid3->info['audio']['sample_rate'] = $info_aac_header['sample_frequency']; + + $info_aac_header['private'] = $aac_header_bitstream{$bit_offset++} == 1; + + $info_aac_header['channel_configuration'] = $getid3->info['audio']['channels'] = bindec(substr($aac_header_bitstream, $bit_offset, 3)); + $bit_offset += 3; + + $info_aac_header['original'] = $aac_header_bitstream{$bit_offset++} == 1; + $info_aac_header['home'] = $aac_header_bitstream{$bit_offset++} == 1; + + if ($info_aac_header['mpeg_version'] == 4) { + $info_aac_header['emphasis'] = bindec(substr($aac_header_bitstream, $bit_offset, 2)); + $bit_offset += 2; + } + + if ($this->option_return_extended_info) { + + $info_aac[$frame_number]['copyright_id_bit'] = $aac_header_bitstream{$bit_offset++} == 1; + $info_aac[$frame_number]['copyright_id_start'] = $aac_header_bitstream{$bit_offset++} == 1; + + } else { + $bit_offset += 2; + } + } + + $frame_length = bindec(substr($aac_header_bitstream, $bit_offset, 13)); + + if (!isset($this->bitrate_cache[$frame_length])) { + $this->bitrate_cache[$frame_length] = ($info_aac_header['sample_frequency'] / 1024) * $frame_length * 8; + } + @$info_aac['bitrate_distribution'][$this->bitrate_cache[$frame_length]]++; + + $info_aac[$frame_number]['aac_frame_length'] = $frame_length; + $bit_offset += 13; + + $info_aac[$frame_number]['adts_buffer_fullness'] = bindec(substr($aac_header_bitstream, $bit_offset, 11)); + $bit_offset += 11; + + $getid3->info['audio']['bitrate_mode'] = ($info_aac[$frame_number]['adts_buffer_fullness'] == 0x07FF) ? 'vbr' : 'cbr'; + + $info_aac[$frame_number]['num_raw_data_blocks'] = bindec(substr($aac_header_bitstream, $bit_offset, 2)); + $bit_offset += 2; + + if ($info_aac_header['crc_present']) { + $bit_offset += 16; + } + + if (!$this->option_return_extended_info) { + unset($info_aac[$frame_number]); + } + + $byte_offset += $frame_length; + if ((++$frame_number < $this->option_max_frames_to_scan) && (($byte_offset + 10) < $getid3->info['avdataend'])) { + + // keep scanning + + } else { + + $info_aac['frames'] = $frame_number; + $getid3->info['playtime_seconds'] = ($getid3->info['avdataend'] / $byte_offset) * (($frame_number * 1024) / $info_aac_header['sample_frequency']); // (1 / % of file scanned) * (samples / (samples/sec)) = seconds + $getid3->info['audio']['bitrate'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / $getid3->info['playtime_seconds']; + ksort($info_aac['bitrate_distribution']); + + $getid3->info['audio']['encoder_options'] = $info_aac['header_type'].' '.$info_aac_header['profile_text']; + + return true; + } + } + } + + + + public static function AACsampleRateLookup($samplerate_id) { + + static $lookup = array ( + 0 => 96000, + 1 => 88200, + 2 => 64000, + 3 => 48000, + 4 => 44100, + 5 => 32000, + 6 => 24000, + 7 => 22050, + 8 => 16000, + 9 => 12000, + 10 => 11025, + 11 => 8000, + 12 => 0, + 13 => 0, + 14 => 0, + 15 => 0 + ); + return (isset($lookup[$samplerate_id]) ? $lookup[$samplerate_id] : 'invalid'); + } + + + + public static function AACprofileLookup($profile_id, $mpeg_version) { + + static $lookup = array ( + 2 => array ( + 0 => 'Main profile', + 1 => 'Low Complexity profile (LC)', + 2 => 'Scalable Sample Rate profile (SSR)', + 3 => '(reserved)' + ), + 4 => array ( + 0 => 'AAC_MAIN', + 1 => 'AAC_LC', + 2 => 'AAC_SSR', + 3 => 'AAC_LTP' + ) + ); + return (isset($lookup[$mpeg_version][$profile_id]) ? $lookup[$mpeg_version][$profile_id] : 'invalid'); + } + + +} + + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.ac3.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.ac3.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,500 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.ac3.php | +// | Module for analyzing AC-3 (aka Dolby Digital) audio files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.ac3.php,v 1.3 2006/11/02 10:48:01 ah Exp $ + + + +class getid3_ac3 extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + // http://www.atsc.org/standards/a_52a.pdf + + $getid3->info['fileformat'] = 'ac3'; + $getid3->info['audio']['dataformat'] = 'ac3'; + $getid3->info['audio']['bitrate_mode'] = 'cbr'; + $getid3->info['audio']['lossless'] = false; + + $getid3->info['ac3']['raw']['bsi'] = array (); + $info_ac3 = &$getid3->info['ac3']; + $info_ac3_raw = &$info_ac3['raw']; + $info_ac3_raw_bsi = &$info_ac3_raw['bsi']; + + + // An AC-3 serial coded audio bit stream is made up of a sequence of synchronization frames + // Each synchronization frame contains 6 coded audio blocks (AB), each of which represent 256 + // new audio samples per channel. A synchronization information (SI) header at the beginning + // of each frame contains information needed to acquire and maintain synchronization. A + // bit stream information (BSI) header follows SI, and contains parameters describing the coded + // audio service. The coded audio blocks may be followed by an auxiliary data (Aux) field. At the + // end of each frame is an error check field that includes a CRC word for error detection. An + // additional CRC word is located in the SI header, the use of which, by a decoder, is optional. + // + // syncinfo() | bsi() | AB0 | AB1 | AB2 | AB3 | AB4 | AB5 | Aux | CRC + + $this->fseek($getid3->info['avdataoffset'], SEEK_SET); + $ac3_header['syncinfo'] = $this->fread(5); + $info_ac3_raw['synchinfo']['synchword'] = substr($ac3_header['syncinfo'], 0, 2); + + if ($info_ac3_raw['synchinfo']['synchword'] != "\x0B\x77") { + throw new getid3_exception('Expecting "\x0B\x77" at offset '.$getid3->info['avdataoffset'].', found \x'.strtoupper(dechex($ac3_header['syncinfo']{0})).'\x'.strtoupper(dechex($ac3_header['syncinfo']{1})).' instead'); + } + + + // syncinfo() { + // syncword 16 + // crc1 16 + // fscod 2 + // frmsizecod 6 + // } /* end of syncinfo */ + + $info_ac3_raw['synchinfo']['crc1'] = getid3_lib::LittleEndian2Int(substr($ac3_header['syncinfo'], 2, 2)); + $ac3_synchinfo_fscod_frmsizecod = getid3_lib::LittleEndian2Int(substr($ac3_header['syncinfo'], 4, 1)); + $info_ac3_raw['synchinfo']['fscod'] = ($ac3_synchinfo_fscod_frmsizecod & 0xC0) >> 6; + $info_ac3_raw['synchinfo']['frmsizecod'] = ($ac3_synchinfo_fscod_frmsizecod & 0x3F); + + $info_ac3['sample_rate'] = getid3_ac3::AC3sampleRateCodeLookup($info_ac3_raw['synchinfo']['fscod']); + if ($info_ac3_raw['synchinfo']['fscod'] <= 3) { + $getid3->info['audio']['sample_rate'] = $info_ac3['sample_rate']; + } + + $info_ac3['frame_length'] = getid3_ac3::AC3frameSizeLookup($info_ac3_raw['synchinfo']['frmsizecod'], $info_ac3_raw['synchinfo']['fscod']); + $info_ac3['bitrate'] = getid3_ac3::AC3bitrateLookup($info_ac3_raw['synchinfo']['frmsizecod']); + $getid3->info['audio']['bitrate'] = $info_ac3['bitrate']; + + $ac3_header['bsi'] = getid3_lib::BigEndian2Bin($this->fread(15)); + + $info_ac3_raw_bsi['bsid'] = bindec(substr($ac3_header['bsi'], 0, 5)); + if ($info_ac3_raw_bsi['bsid'] > 8) { + // Decoders which can decode version 8 will thus be able to decode version numbers less than 8. + // If this standard is extended by the addition of additional elements or features, a value of bsid greater than 8 will be used. + // Decoders built to this version of the standard will not be able to decode versions with bsid greater than 8. + throw new getid3_exception('Bit stream identification is version '.$info_ac3_raw_bsi['bsid'].', but getID3() only understands up to version 8'); + } + + $info_ac3_raw_bsi['bsmod'] = bindec(substr($ac3_header['bsi'], 5, 3)); + $info_ac3_raw_bsi['acmod'] = bindec(substr($ac3_header['bsi'], 8, 3)); + + $info_ac3['service_type'] = getid3_ac3::AC3serviceTypeLookup($info_ac3_raw_bsi['bsmod'], $info_ac3_raw_bsi['acmod']); + $ac3_coding_mode = getid3_ac3::AC3audioCodingModeLookup($info_ac3_raw_bsi['acmod']); + foreach($ac3_coding_mode as $key => $value) { + $info_ac3[$key] = $value; + } + switch ($info_ac3_raw_bsi['acmod']) { + case 0: + case 1: + $getid3->info['audio']['channelmode'] = 'mono'; + break; + case 3: + case 4: + $getid3->info['audio']['channelmode'] = 'stereo'; + break; + default: + $getid3->info['audio']['channelmode'] = 'surround'; + break; + } + $getid3->info['audio']['channels'] = $info_ac3['num_channels']; + + $offset = 11; + + if ($info_ac3_raw_bsi['acmod'] & 0x01) { + // If the lsb of acmod is a 1, center channel is in use and cmixlev follows in the bit stream. + $info_ac3_raw_bsi['cmixlev'] = bindec(substr($ac3_header['bsi'], $offset, 2)); + $info_ac3['center_mix_level'] = getid3_ac3::AC3centerMixLevelLookup($info_ac3_raw_bsi['cmixlev']); + $offset += 2; + } + + if ($info_ac3_raw_bsi['acmod'] & 0x04) { + // If the msb of acmod is a 1, surround channels are in use and surmixlev follows in the bit stream. + $info_ac3_raw_bsi['surmixlev'] = bindec(substr($ac3_header['bsi'], $offset, 2)); + $info_ac3['surround_mix_level'] = getid3_ac3::AC3surroundMixLevelLookup($info_ac3_raw_bsi['surmixlev']); + $offset += 2; + } + + if ($info_ac3_raw_bsi['acmod'] == 0x02) { + // When operating in the two channel mode, this 2-bit code indicates whether or not the program has been encoded in Dolby Surround. + $info_ac3_raw_bsi['dsurmod'] = bindec(substr($ac3_header['bsi'], $offset, 2)); + $info_ac3['dolby_surround_mode'] = getid3_ac3::AC3dolbySurroundModeLookup($info_ac3_raw_bsi['dsurmod']); + $offset += 2; + } + + $info_ac3_raw_bsi['lfeon'] = $ac3_header['bsi']{$offset++} == '1'; + $info_ac3['lfe_enabled'] = $info_ac3_raw_bsi['lfeon']; + if ($info_ac3_raw_bsi['lfeon']) { + $getid3->info['audio']['channels'] .= '.1'; + } + + $info_ac3['channels_enabled'] = getid3_ac3::AC3channelsEnabledLookup($info_ac3_raw_bsi['acmod'], $info_ac3_raw_bsi['lfeon']); + + // This indicates how far the average dialogue level is below digital 100 percent. Valid values are 1–31. + // The value of 0 is reserved. The values of 1 to 31 are interpreted as -1 dB to -31 dB with respect to digital 100 percent. + $info_ac3_raw_bsi['dialnorm'] = bindec(substr($ac3_header['bsi'], $offset, 5)); + $offset += 5; + $info_ac3['dialogue_normalization'] = '-'.$info_ac3_raw_bsi['dialnorm'].'dB'; + + $info_ac3_raw_bsi['compre_flag'] = $ac3_header['bsi']{$offset++} == '1'; + if ($info_ac3_raw_bsi['compre_flag']) { + $info_ac3_raw_bsi['compr'] = bindec(substr($ac3_header['bsi'], $offset, 8)); + $offset += 8; + + $info_ac3['heavy_compression'] = getid3_ac3::AC3heavyCompression($info_ac3_raw_bsi['compr']); + } + + $info_ac3_raw_bsi['langcode_flag'] = $ac3_header['bsi']{$offset++} == '1'; + if ($info_ac3_raw_bsi['langcode_flag']) { + $info_ac3_raw_bsi['langcod'] = bindec(substr($ac3_header['bsi'], $offset, 8)); + $offset += 8; + } + + $info_ac3_raw_bsi['audprodie'] = $ac3_header['bsi']{$offset++} == '1'; + if ($info_ac3_raw_bsi['audprodie']) { + $info_ac3_raw_bsi['mixlevel'] = bindec(substr($ac3_header['bsi'], $offset, 5)); + $offset += 5; + + $info_ac3_raw_bsi['roomtyp'] = bindec(substr($ac3_header['bsi'], $offset, 2)); + $offset += 2; + + $info_ac3['mixing_level'] = (80 + $info_ac3_raw_bsi['mixlevel']).'dB'; + $info_ac3['room_type'] = getid3_ac3::AC3roomTypeLookup($info_ac3_raw_bsi['roomtyp']); + } + + if ($info_ac3_raw_bsi['acmod'] == 0x00) { + // If acmod is 0, then two completely independent program channels (dual mono) + // are encoded into the bit stream, and are referenced as Ch1, Ch2. In this case, + // a number of additional items are present in BSI or audblk to fully describe Ch2. + + + // This indicates how far the average dialogue level is below digital 100 percent. Valid values are 1–31. + // The value of 0 is reserved. The values of 1 to 31 are interpreted as -1 dB to -31 dB with respect to digital 100 percent. + $info_ac3_raw_bsi['dialnorm2'] = bindec(substr($ac3_header['bsi'], $offset, 5)); + $offset += 5; + + $info_ac3['dialogue_normalization2'] = '-'.$info_ac3_raw_bsi['dialnorm2'].'dB'; + + $info_ac3_raw_bsi['compre_flag2'] = $ac3_header['bsi']{$offset++} == '1'; + if ($info_ac3_raw_bsi['compre_flag2']) { + $info_ac3_raw_bsi['compr2'] = bindec(substr($ac3_header['bsi'], $offset, 8)); + $offset += 8; + + $info_ac3['heavy_compression2'] = getid3_ac3::AC3heavyCompression($info_ac3_raw_bsi['compr2']); + } + + $info_ac3_raw_bsi['langcode_flag2'] = $ac3_header['bsi']{$offset++} == '1'; + if ($info_ac3_raw_bsi['langcode_flag2']) { + $info_ac3_raw_bsi['langcod2'] = bindec(substr($ac3_header['bsi'], $offset, 8)); + $offset += 8; + } + + $info_ac3_raw_bsi['audprodie2'] = $ac3_header['bsi']{$offset++} == '1'; + if ($info_ac3_raw_bsi['audprodie2']) { + $info_ac3_raw_bsi['mixlevel2'] = bindec(substr($ac3_header['bsi'], $offset, 5)); + $offset += 5; + + $info_ac3_raw_bsi['roomtyp2'] = bindec(substr($ac3_header['bsi'], $offset, 2)); + $offset += 2; + + $info_ac3['mixing_level2'] = (80 + $info_ac3_raw_bsi['mixlevel2']).'dB'; + $info_ac3['room_type2'] = getid3_ac3::AC3roomTypeLookup($info_ac3_raw_bsi['roomtyp2']); + } + + } + + $info_ac3_raw_bsi['copyright'] = $ac3_header['bsi']{$offset++} == '1'; + + $info_ac3_raw_bsi['original'] = $ac3_header['bsi']{$offset++} == '1'; + + $info_ac3_raw_bsi['timecode1_flag'] = $ac3_header['bsi']{$offset++} == '1'; + if ($info_ac3_raw_bsi['timecode1_flag']) { + $info_ac3_raw_bsi['timecode1'] = bindec(substr($ac3_header['bsi'], $offset, 14)); + $offset += 14; + } + + $info_ac3_raw_bsi['timecode2_flag'] = $ac3_header['bsi']{$offset++} == '1'; + if ($info_ac3_raw_bsi['timecode2_flag']) { + $info_ac3_raw_bsi['timecode2'] = bindec(substr($ac3_header['bsi'], $offset, 14)); + $offset += 14; + } + + $info_ac3_raw_bsi['addbsi_flag'] = $ac3_header['bsi']{$offset++} == '1'; + if ($info_ac3_raw_bsi['addbsi_flag']) { + $info_ac3_raw_bsi['addbsi_length'] = bindec(substr($ac3_header['bsi'], $offset, 6)); + $offset += 6; + + $ac3_header['bsi'] .= getid3_lib::BigEndian2Bin($this->fread($info_ac3_raw_bsi['addbsi_length'])); + + $info_ac3_raw_bsi['addbsi_data'] = substr($ac3_header['bsi'], 119, $info_ac3_raw_bsi['addbsi_length'] * 8); + } + + return true; + } + + + + public static function AC3sampleRateCodeLookup($fscod) { + + static $lookup = array ( + 0 => 48000, + 1 => 44100, + 2 => 32000, + 3 => 'reserved' // If the reserved code is indicated, the decoder should not attempt to decode audio and should mute. + ); + return (isset($lookup[$fscod]) ? $lookup[$fscod] : false); + } + + + + public static function AC3serviceTypeLookup($bsmod, $acmod) { + + static $lookup = array ( + 0 => 'main audio service: complete main (CM)', + 1 => 'main audio service: music and effects (ME)', + 2 => 'associated service: visually impaired (VI)', + 3 => 'associated service: hearing impaired (HI)', + 4 => 'associated service: dialogue (D)', + 5 => 'associated service: commentary (C)', + 6 => 'associated service: emergency (E)', + 7 => 'main audio service: karaoke' + ); + + if ($bsmod == 7 && $acmod == 1) { + return 'associated service: voice over (VO)'; + } + + return (isset($lookup[$bsmod]) ? $lookup[$bsmod] : false); + } + + + + public static function AC3audioCodingModeLookup($acmod) { + + // array (channel configuration, # channels (not incl LFE), channel order) + static $lookup = array ( + 0 => array ('channel_config'=>'1+1', 'num_channels'=>2, 'channel_order'=>'Ch1,Ch2'), + 1 => array ('channel_config'=>'1/0', 'num_channels'=>1, 'channel_order'=>'C'), + 2 => array ('channel_config'=>'2/0', 'num_channels'=>2, 'channel_order'=>'L,R'), + 3 => array ('channel_config'=>'3/0', 'num_channels'=>3, 'channel_order'=>'L,C,R'), + 4 => array ('channel_config'=>'2/1', 'num_channels'=>3, 'channel_order'=>'L,R,S'), + 5 => array ('channel_config'=>'3/1', 'num_channels'=>4, 'channel_order'=>'L,C,R,S'), + 6 => array ('channel_config'=>'2/2', 'num_channels'=>4, 'channel_order'=>'L,R,SL,SR'), + 7 => array ('channel_config'=>'3/2', 'num_channels'=>5, 'channel_order'=>'L,C,R,SL,SR') + ); + return (isset($lookup[$acmod]) ? $lookup[$acmod] : false); + } + + + + public static function AC3centerMixLevelLookup($cmixlev) { + + static $lookup; + if (!@$lookup) { + $lookup = array ( + 0 => pow(2, -3.0 / 6), // 0.707 (–3.0 dB) + 1 => pow(2, -4.5 / 6), // 0.595 (–4.5 dB) + 2 => pow(2, -6.0 / 6), // 0.500 (–6.0 dB) + 3 => 'reserved' + ); + } + return (isset($lookup[$cmixlev]) ? $lookup[$cmixlev] : false); + } + + + + public static function AC3surroundMixLevelLookup($surmixlev) { + + static $lookup; + if (!@$lookup) { + $lookup = array ( + 0 => pow(2, -3.0 / 6), + 1 => pow(2, -6.0 / 6), + 2 => 0, + 3 => 'reserved' + ); + } + return (isset($lookup[$surmixlev]) ? $lookup[$surmixlev] : false); + } + + + + public static function AC3dolbySurroundModeLookup($dsurmod) { + + static $lookup = array ( + 0 => 'not indicated', + 1 => 'Not Dolby Surround encoded', + 2 => 'Dolby Surround encoded', + 3 => 'reserved' + ); + return (isset($lookup[$dsurmod]) ? $lookup[$dsurmod] : false); + } + + + + public static function AC3channelsEnabledLookup($acmod, $lfeon) { + + return array ( + 'ch1' => $acmod == 0, + 'ch2' => $acmod == 0, + 'left' => $acmod > 1, + 'right' => $acmod > 1, + 'center' => (bool)($acmod & 0x01), + 'surround_mono' => $acmod == 4 || $acmod == 5, + 'surround_left' => $acmod == 6 || $acmod == 7, + 'surround_right' => $acmod == 6 || $acmod == 7, + 'lfe' => $lfeon + ); + } + + + + public static function AC3heavyCompression($compre) { + + // The first four bits indicate gain changes in 6.02dB increments which can be + // implemented with an arithmetic shift operation. The following four bits + // indicate linear gain changes, and require a 5-bit multiply. + // We will represent the two 4-bit fields of compr as follows: + // X0 X1 X2 X3 . Y4 Y5 Y6 Y7 + // The meaning of the X values is most simply described by considering X to represent a 4-bit + // signed integer with values from –8 to +7. The gain indicated by X is then (X + 1) * 6.02 dB. The + // following table shows this in detail. + + // Meaning of 4 msb of compr + // 7 +48.16 dB + // 6 +42.14 dB + // 5 +36.12 dB + // 4 +30.10 dB + // 3 +24.08 dB + // 2 +18.06 dB + // 1 +12.04 dB + // 0 +6.02 dB + // -1 0 dB + // -2 –6.02 dB + // -3 –12.04 dB + // -4 –18.06 dB + // -5 –24.08 dB + // -6 –30.10 dB + // -7 –36.12 dB + // -8 –42.14 dB + + $fourbit = str_pad(decbin(($compre & 0xF0) >> 4), 4, '0', STR_PAD_LEFT); + if ($fourbit{0} == '1') { + $log_gain = -8 + bindec(substr($fourbit, 1)); + } else { + $log_gain = bindec(substr($fourbit, 1)); + } + $log_gain = ($log_gain + 1) * (20 * log10(2)); + + // The value of Y is a linear representation of a gain change of up to –6 dB. Y is considered to + // be an unsigned fractional integer, with a leading value of 1, or: 0.1 Y4 Y5 Y6 Y7 (base 2). Y can + // represent values between 0.111112 (or 31/32) and 0.100002 (or 1/2). Thus, Y can represent gain + // changes from –0.28 dB to –6.02 dB. + + $lin_gain = (16 + ($compre & 0x0F)) / 32; + + // The combination of X and Y values allows compr to indicate gain changes from + // 48.16 – 0.28 = +47.89 dB, to + // –42.14 – 6.02 = –48.16 dB. + + return $log_gain - $lin_gain; + } + + + + public static function AC3roomTypeLookup($roomtyp) { + + static $lookup = array ( + 0 => 'not indicated', + 1 => 'large room, X curve monitor', + 2 => 'small room, flat monitor', + 3 => 'reserved' + ); + return (isset($lookup[$roomtyp]) ? $lookup[$roomtyp] : false); + } + + + + public static function AC3frameSizeLookup($frmsizecod, $fscod) { + + $padding = (bool)($frmsizecod % 2); + $frame_size_id = floor($frmsizecod / 2); + + static $lookup = array ( + 0 => array (128, 138, 192), + 1 => array (40, 160, 174, 240), + 2 => array (48, 192, 208, 288), + 3 => array (56, 224, 242, 336), + 4 => array (64, 256, 278, 384), + 5 => array (80, 320, 348, 480), + 6 => array (96, 384, 416, 576), + 7 => array (112, 448, 486, 672), + 8 => array (128, 512, 556, 768), + 9 => array (160, 640, 696, 960), + 10 => array (192, 768, 834, 1152), + 11 => array (224, 896, 974, 1344), + 12 => array (256, 1024, 1114, 1536), + 13 => array (320, 1280, 1392, 1920), + 14 => array (384, 1536, 1670, 2304), + 15 => array (448, 1792, 1950, 2688), + 16 => array (512, 2048, 2228, 3072), + 17 => array (576, 2304, 2506, 3456), + 18 => array (640, 2560, 2786, 3840) + ); + if (($fscod == 1) && $padding) { + // frame lengths are padded by 1 word (16 bits) at 44100 + $lookup[$frmsizecod] += 2; + } + return (isset($lookup[$frame_size_id][$fscod]) ? $lookup[$frame_size_id][$fscod] : false); + } + + + + public static function AC3bitrateLookup($frmsizecod) { + + static $lookup = array ( + 0 => 32000, + 1 => 40000, + 2 => 48000, + 3 => 56000, + 4 => 64000, + 5 => 80000, + 6 => 96000, + 7 => 112000, + 8 => 128000, + 9 => 160000, + 10 => 192000, + 11 => 224000, + 12 => 256000, + 13 => 320000, + 14 => 384000, + 15 => 448000, + 16 => 512000, + 17 => 576000, + 18 => 640000 + ); + $frame_size_id = floor($frmsizecod / 2); + return (isset($lookup[$frame_size_id]) ? $lookup[$frame_size_id] : false); + } + +} + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.au.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.au.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,184 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.au.php | +// | module for analyzing AU files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.au.php,v 1.2 2006/11/02 10:48:01 ah Exp $ + + + +class getid3_au extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $au_header = fread($getid3->fp, 8); + + // Magic bytes: .snd + + $getid3->info['au'] = array (); + $info_au = &$getid3->info['au']; + + $getid3->info['fileformat'] = 'au'; + $getid3->info['audio']['dataformat'] = 'au'; + $getid3->info['audio']['bitrate_mode'] = 'cbr'; + $info_au['encoding'] = 'ISO-8859-1'; + + $info_au['header_length'] = getid3_lib::BigEndian2Int(substr($au_header, 4, 4)); + $au_header .= fread($getid3->fp, $info_au['header_length'] - 8); + $getid3->info['avdataoffset'] += $info_au['header_length']; + + getid3_lib::ReadSequence('BigEndian2Int', $info_au, $au_header, 8, + array ( + 'data_size' => 4, + 'data_format_id'=> 4, + 'sample_rate' => 4, + 'channels' => 4 + ) + ); + $info_au['comments']['comment'][] = trim(substr($au_header, 24)); + + $info_au['data_format'] = getid3_au::AUdataFormatNameLookup($info_au['data_format_id']); + $info_au['used_bits_per_sample'] = getid3_au::AUdataFormatUsedBitsPerSampleLookup($info_au['data_format_id']); + if ($info_au['bits_per_sample'] = getid3_au::AUdataFormatBitsPerSampleLookup($info_au['data_format_id'])) { + $getid3->info['audio']['bits_per_sample'] = $info_au['bits_per_sample']; + } else { + unset($info_au['bits_per_sample']); + } + + $getid3->info['audio']['sample_rate'] = $info_au['sample_rate']; + $getid3->info['audio']['channels'] = $info_au['channels']; + + if (($getid3->info['avdataoffset'] + $info_au['data_size']) > $getid3->info['avdataend']) { + $getid3->warning('Possible truncated file - expecting "'.$info_au['data_size'].'" bytes of audio data, only found '.($getid3->info['avdataend'] - $getid3->info['avdataoffset']).' bytes"'); + } + + $getid3->info['playtime_seconds'] = $info_au['data_size'] / ($info_au['sample_rate'] * $info_au['channels'] * ($info_au['used_bits_per_sample'] / 8)); + $getid3->info['audio']['bitrate'] = ($info_au['data_size'] * 8) / $getid3->info['playtime_seconds']; + + return true; + } + + + + public static function AUdataFormatNameLookup($id) { + + static $lookup = array ( + 0 => 'unspecified format', + 1 => '8-bit mu-law', + 2 => '8-bit linear', + 3 => '16-bit linear', + 4 => '24-bit linear', + 5 => '32-bit linear', + 6 => 'floating-point', + 7 => 'double-precision float', + 8 => 'fragmented sampled data', + 9 => 'SUN_FORMAT_NESTED', + 10 => 'DSP program', + 11 => '8-bit fixed-point', + 12 => '16-bit fixed-point', + 13 => '24-bit fixed-point', + 14 => '32-bit fixed-point', + + 16 => 'non-audio display data', + 17 => 'SND_FORMAT_MULAW_SQUELCH', + 18 => '16-bit linear with emphasis', + 19 => '16-bit linear with compression', + 20 => '16-bit linear with emphasis + compression', + 21 => 'Music Kit DSP commands', + 22 => 'SND_FORMAT_DSP_COMMANDS_SAMPLES', + 23 => 'CCITT g.721 4-bit ADPCM', + 24 => 'CCITT g.722 ADPCM', + 25 => 'CCITT g.723 3-bit ADPCM', + 26 => 'CCITT g.723 5-bit ADPCM', + 27 => 'A-Law 8-bit' + ); + + return (isset($lookup[$id]) ? $lookup[$id] : false); + } + + + + public static function AUdataFormatBitsPerSampleLookup($id) { + + static $lookup = array ( + 1 => 8, + 2 => 8, + 3 => 16, + 4 => 24, + 5 => 32, + 6 => 32, + 7 => 64, + + 11 => 8, + 12 => 16, + 13 => 24, + 14 => 32, + + 18 => 16, + 19 => 16, + 20 => 16, + + 23 => 16, + + 25 => 16, + 26 => 16, + 27 => 8 + ); + return (isset($lookup[$id]) ? $lookup[$id] : false); + } + + + + public static function AUdataFormatUsedBitsPerSampleLookup($id) { + + static $lookup = array ( + 1 => 8, + 2 => 8, + 3 => 16, + 4 => 24, + 5 => 32, + 6 => 32, + 7 => 64, + + 11 => 8, + 12 => 16, + 13 => 24, + 14 => 32, + + 18 => 16, + 19 => 16, + 20 => 16, + + 23 => 4, + + 25 => 3, + 26 => 5, + 27 => 8, + ); + return (isset($lookup[$id]) ? $lookup[$id] : false); + } + +} + + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.avr.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.avr.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,135 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.avr.php | +// | Module for analyzing AVR audio files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.avr.php,v 1.2 2006/11/02 10:48:01 ah Exp $ + + + +class getid3_avr extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + // http://cui.unige.ch/OSG/info/AudioFormats/ap11.html + // http://www.btinternet.com/~AnthonyJ/Atari/programming/avr_format.html + // offset type length name comments + // --------------------------------------------------------------------- + // 0 char 4 ID format ID == "2BIT" + // 4 char 8 name sample name (unused space filled with 0) + // 12 short 1 mono/stereo 0=mono, -1 (0xFFFF)=stereo + // With stereo, samples are alternated, + // the first voice is the left : + // (LRLRLRLRLRLRLRLRLR...) + // 14 short 1 resolution 8, 12 or 16 (bits) + // 16 short 1 signed or not 0=unsigned, -1 (0xFFFF)=signed + // 18 short 1 loop or not 0=no loop, -1 (0xFFFF)=loop on + // 20 short 1 MIDI note 0xFFnn, where 0 <= nn <= 127 + // 0xFFFF means "no MIDI note defined" + // 22 byte 1 Replay speed Frequence in the Replay software + // 0=5.485 Khz, 1=8.084 Khz, 2=10.971 Khz, + // 3=16.168 Khz, 4=21.942 Khz, 5=32.336 Khz + // 6=43.885 Khz, 7=47.261 Khz + // -1 (0xFF)=no defined Frequence + // 23 byte 3 sample rate in Hertz + // 26 long 1 size in bytes (2 * bytes in stereo) + // 30 long 1 loop begin 0 for no loop + // 34 long 1 loop size equal to 'size' for no loop + // 38 short 2 Reserved, MIDI keyboard split */ + // 40 short 2 Reserved, sample compression */ + // 42 short 2 Reserved */ + // 44 char 20; Additional filename space, used if (name[7] != 0) + // 64 byte 64 user data + // 128 bytes ? sample data (12 bits samples are coded on 16 bits: + // 0000 xxxx xxxx xxxx) + // --------------------------------------------------------------------- + + // Note that all values are in motorola (big-endian) format, and that long is + // assumed to be 4 bytes, and short 2 bytes. + // When reading the samples, you should handle both signed and unsigned data, + // and be prepared to convert 16->8 bit, or mono->stereo if needed. To convert + // 8-bit data between signed/unsigned just add 127 to the sample values. + // Simularly for 16-bit data you should add 32769 + + + // Magic bytes: '2BIT' + + $getid3->info['avr'] = array (); + $info_avr = &$getid3->info['avr']; + + $getid3->info['fileformat'] = 'avr'; + $info_avr['raw']['magic'] = '2BIT'; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $avr_header = fread($getid3->fp, 128); + + $getid3->info['avdataoffset'] += 128; + + $info_avr['sample_name'] = rtrim(substr($avr_header, 4, 8)); + + $info_avr['raw']['mono'] = getid3_lib::BigEndian2Int(substr($avr_header, 12, 2)); + $info_avr['bits_per_sample'] = getid3_lib::BigEndian2Int(substr($avr_header, 14, 2)); + $info_avr['raw']['signed'] = getid3_lib::BigEndian2Int(substr($avr_header, 16, 2)); + $info_avr['raw']['loop'] = getid3_lib::BigEndian2Int(substr($avr_header, 18, 2)); + $info_avr['raw']['midi'] = getid3_lib::BigEndian2Int(substr($avr_header, 20, 2)); + $info_avr['raw']['replay_freq'] = getid3_lib::BigEndian2Int(substr($avr_header, 22, 1)); + $info_avr['sample_rate'] = getid3_lib::BigEndian2Int(substr($avr_header, 23, 3)); + $info_avr['sample_length'] = getid3_lib::BigEndian2Int(substr($avr_header, 26, 4)); + $info_avr['loop_start'] = getid3_lib::BigEndian2Int(substr($avr_header, 30, 4)); + $info_avr['loop_end'] = getid3_lib::BigEndian2Int(substr($avr_header, 34, 4)); + $info_avr['midi_split'] = getid3_lib::BigEndian2Int(substr($avr_header, 38, 2)); + $info_avr['sample_compression'] = getid3_lib::BigEndian2Int(substr($avr_header, 40, 2)); + $info_avr['reserved'] = getid3_lib::BigEndian2Int(substr($avr_header, 42, 2)); + $info_avr['sample_name_extra'] = rtrim(substr($avr_header, 44, 20)); + $info_avr['comment'] = rtrim(substr($avr_header, 64, 64)); + + $info_avr['flags']['stereo'] = (($info_avr['raw']['mono'] == 0) ? false : true); + $info_avr['flags']['signed'] = (($info_avr['raw']['signed'] == 0) ? false : true); + $info_avr['flags']['loop'] = (($info_avr['raw']['loop'] == 0) ? false : true); + + $info_avr['midi_notes'] = array (); + if (($info_avr['raw']['midi'] & 0xFF00) != 0xFF00) { + $info_avr['midi_notes'][] = ($info_avr['raw']['midi'] & 0xFF00) >> 8; + } + if (($info_avr['raw']['midi'] & 0x00FF) != 0x00FF) { + $info_avr['midi_notes'][] = ($info_avr['raw']['midi'] & 0x00FF); + } + + if (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) != ($info_avr['sample_length'] * (($info_avr['bits_per_sample'] == 8) ? 1 : 2))) { + $getid3->warning('Probable truncated file: expecting '.($info_avr['sample_length'] * (($info_avr['bits_per_sample'] == 8) ? 1 : 2)).' bytes of audio data, found '.($getid3->info['avdataend'] - $getid3->info['avdataoffset'])); + } + + $getid3->info['audio']['dataformat'] = 'avr'; + $getid3->info['audio']['lossless'] = true; + $getid3->info['audio']['bitrate_mode'] = 'cbr'; + $getid3->info['audio']['bits_per_sample'] = $info_avr['bits_per_sample']; + $getid3->info['audio']['sample_rate'] = $info_avr['sample_rate']; + $getid3->info['audio']['channels'] = ($info_avr['flags']['stereo'] ? 2 : 1); + $getid3->info['playtime_seconds'] = ($info_avr['sample_length'] / $getid3->info['audio']['channels']) / $info_avr['sample_rate']; + $getid3->info['audio']['bitrate'] = ($info_avr['sample_length'] * (($info_avr['bits_per_sample'] == 8) ? 8 : 16)) / $getid3->info['playtime_seconds']; + + return true; + } +} + + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.bonk.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.bonk.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,235 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.bonk.php | +// | Module for analyzing BONK audio files | +// | dependencies: module.tag.id3v2.php (optional) | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.bonk.php,v 1.3 2006/11/02 10:48:01 ah Exp $ + + + +class getid3_bonk extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->info['bonk'] = array (); + $info_bonk = &$getid3->info['bonk']; + + $info_bonk['dataoffset'] = $getid3->info['avdataoffset']; + $info_bonk['dataend'] = $getid3->info['avdataend']; + + + // Scan-from-end method, for v0.6 and higher + fseek($getid3->fp, $info_bonk['dataend'] - 8, SEEK_SET); + $possible_bonk_tag = fread($getid3->fp, 8); + while (getid3_bonk::BonkIsValidTagName(substr($possible_bonk_tag, 4, 4), true)) { + $bonk_tag_size = getid3_lib::LittleEndian2Int(substr($possible_bonk_tag, 0, 4)); + fseek($getid3->fp, 0 - $bonk_tag_size, SEEK_CUR); + $bonk_tag_offset = ftell($getid3->fp); + $tag_header_test = fread($getid3->fp, 5); + if (($tag_header_test{0} != "\x00") || (substr($possible_bonk_tag, 4, 4) != strtolower(substr($possible_bonk_tag, 4, 4)))) { + throw new getid3_exception('Expecting "Ø'.strtoupper(substr($possible_bonk_tag, 4, 4)).'" at offset '.$bonk_tag_offset.', found "'.$tag_header_test.'"'); + } + $bonk_tag_name = substr($tag_header_test, 1, 4); + + $info_bonk[$bonk_tag_name]['size'] = $bonk_tag_size; + $info_bonk[$bonk_tag_name]['offset'] = $bonk_tag_offset; + $this->HandleBonkTags($bonk_tag_name); + + $next_tag_end_offset = $bonk_tag_offset - 8; + if ($next_tag_end_offset < $info_bonk['dataoffset']) { + if (empty($getid3->info['audio']['encoder'])) { + $getid3->info['audio']['encoder'] = 'Extended BONK v0.9+'; + } + return true; + } + fseek($getid3->fp, $next_tag_end_offset, SEEK_SET); + $possible_bonk_tag = fread($getid3->fp, 8); + } + + // Seek-from-beginning method for v0.4 and v0.5 + if (empty($info_bonk['BONK'])) { + fseek($getid3->fp, $info_bonk['dataoffset'], SEEK_SET); + do { + $tag_header_test = fread($getid3->fp, 5); + switch ($tag_header_test) { + case "\x00".'BONK': + if (empty($getid3->info['audio']['encoder'])) { + $getid3->info['audio']['encoder'] = 'BONK v0.4'; + } + break; + + case "\x00".'INFO': + $getid3->info['audio']['encoder'] = 'Extended BONK v0.5'; + break; + + default: + break 2; + } + $bonk_tag_name = substr($tag_header_test, 1, 4); + $info_bonk[$bonk_tag_name]['size'] = $info_bonk['dataend'] - $info_bonk['dataoffset']; + $info_bonk[$bonk_tag_name]['offset'] = $info_bonk['dataoffset']; + $this->HandleBonkTags($bonk_tag_name); + + } while (true); + } + + + // Parse META block for v0.6 - v0.8 + if (!@$info_bonk['INFO'] && isset($info_bonk['META']['tags']['info'])) { + fseek($getid3->fp, $info_bonk['META']['tags']['info'], SEEK_SET); + $tag_header_test = fread($getid3->fp, 5); + if ($tag_header_test == "\x00".'INFO') { + $getid3->info['audio']['encoder'] = 'Extended BONK v0.6 - v0.8'; + + $bonk_tag_name = substr($tag_header_test, 1, 4); + $info_bonk[$bonk_tag_name]['size'] = $info_bonk['dataend'] - $info_bonk['dataoffset']; + $info_bonk[$bonk_tag_name]['offset'] = $info_bonk['dataoffset']; + $this->HandleBonkTags($bonk_tag_name); + } + } + + if (empty($getid3->info['audio']['encoder'])) { + $getid3->info['audio']['encoder'] = 'Extended BONK v0.9+'; + } + if (empty($info_bonk['BONK'])) { + unset($getid3->info['bonk']); + } + return true; + + } + + + + private function HandleBonkTags(&$bonk_tag_name) { + + // Shortcut to getid3 pointer + $getid3 = $this->getid3; + $info_audio = &$getid3->info['audio']; + + switch ($bonk_tag_name) { + + case 'BONK': + // shortcut + $info_bonk_BONK = &$getid3->info['bonk']['BONK']; + + $bonk_data = "\x00".'BONK'.fread($getid3->fp, 17); + + getid3_lib::ReadSequence('LittleEndian2Int', $info_bonk_BONK, $bonk_data, 5, + array ( + 'version' => 1, + 'number_samples' => 4, + 'sample_rate' => 4, + 'channels' => 1, + 'lossless' => 1, + 'joint_stereo' => 1, + 'number_taps' => 2, + 'downsampling_ratio' => 1, + 'samples_per_packet' => 2 + ) + ); + + $info_bonk_BONK['lossless'] = (bool)$info_bonk_BONK['lossless']; + $info_bonk_BONK['joint_stereo'] = (bool)$info_bonk_BONK['joint_stereo']; + + $getid3->info['avdataoffset'] = $info_bonk_BONK['offset'] + 5 + 17; + $getid3->info['avdataend'] = $info_bonk_BONK['offset'] + $info_bonk_BONK['size']; + + $getid3->info['fileformat'] = 'bonk'; + $info_audio['dataformat'] = 'bonk'; + $info_audio['bitrate_mode'] = 'vbr'; // assumed + $info_audio['channels'] = $info_bonk_BONK['channels']; + $info_audio['sample_rate'] = $info_bonk_BONK['sample_rate']; + $info_audio['channelmode'] = $info_bonk_BONK['joint_stereo'] ? 'joint stereo' : 'stereo'; + $info_audio['lossless'] = $info_bonk_BONK['lossless']; + $info_audio['codec'] = 'bonk'; + + $getid3->info['playtime_seconds'] = $info_bonk_BONK['number_samples'] / ($info_bonk_BONK['sample_rate'] * $info_bonk_BONK['channels']); + if ($getid3->info['playtime_seconds'] > 0) { + $info_audio['bitrate'] = (($getid3->info['bonk']['dataend'] - $getid3->info['bonk']['dataoffset']) * 8) / $getid3->info['playtime_seconds']; + } + break; + + case 'INFO': + // shortcut + $info_bonk_INFO = &$getid3->info['bonk']['INFO']; + + $info_bonk_INFO['version'] = getid3_lib::LittleEndian2Int(fread($getid3->fp, 1)); + $info_bonk_INFO['entries_count'] = 0; + $next_info_data_pair = fread($getid3->fp, 5); + if (!getid3_bonk::BonkIsValidTagName(substr($next_info_data_pair, 1, 4))) { + while (!feof($getid3->fp)) { + $next_info_data_pair = fread($getid3->fp, 5); + if (getid3_bonk::BonkIsValidTagName(substr($next_info_data_pair, 1, 4))) { + fseek($getid3->fp, -5, SEEK_CUR); + break; + } + $info_bonk_INFO['entries_count']++; + } + } + break; + + case 'META': + $bonk_data = "\x00".'META'.fread($getid3->fp, $getid3->info['bonk']['META']['size'] - 5); + $getid3->info['bonk']['META']['version'] = getid3_lib::LittleEndian2Int(substr($bonk_data, 5, 1)); + + $meta_tag_entries = floor(((strlen($bonk_data) - 8) - 6) / 8); // BonkData - xxxxmeta - ØMETA + $offset = 6; + for ($i = 0; $i < $meta_tag_entries; $i++) { + $meta_entry_tag_name = substr($bonk_data, $offset, 4); + $offset += 4; + $meta_entry_tag_offset = getid3_lib::LittleEndian2Int(substr($bonk_data, $offset, 4)); + $offset += 4; + $getid3->info['bonk']['META']['tags'][$meta_entry_tag_name] = $meta_entry_tag_offset; + } + break; + + case ' ID3': + $info_audio['encoder'] = 'Extended BONK v0.9+'; + + // ID3v2 checking is optional + if (class_exists('getid3_id3v2')) { + + $id3v2 = new getid3_id3v2($getid3); + $id3v2->option_starting_offset = $getid3->info['bonk'][' ID3']['offset'] + 2; + $getid3->info['bonk'][' ID3']['valid'] = $id3v2->Analyze(); + } + break; + + default: + $getid3->warning('Unexpected Bonk tag "'.$bonk_tag_name.'" at offset '.$getid3->info['bonk'][$bonk_tag_name]['offset']); + break; + + } + } + + + + public static function BonkIsValidTagName($possible_bonk_tag, $ignore_case=false) { + + $ignore_case = $ignore_case ? 'i' : ''; + return preg_match('/^(BONK|INFO| ID3|META)$/'.$ignore_case, $possible_bonk_tag); + } + +} + + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.dts.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.dts.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,254 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.dts.php | +// | Module for analyzing DTS audio files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.dts.php,v 1.2 2006/11/16 13:14:26 ah Exp $ + + + +// Specs taken from "DTS Coherent Acoustics;Core and Extensions, ETSI TS 102 114 V1.2.1 (2002-12)" +// (http://pda.etsi.org/pda/queryform.asp) +// With thanks to Gambit http://mac.sourceforge.net/atl/ + +class getid3_dts extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->info['dts'] = array (); + $info_dts = &$getid3->info['dts']; + + $getid3->info['fileformat'] = 'dts'; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $header = fread($getid3->fp, 16); + + $fhBS = getid3_lib::BigEndian2Bin(substr($header, 4, 12)); + $bs_offset = 0; + $info_dts['raw']['frame_type'] = bindec(substr($fhBS, $bs_offset, 1)); $bs_offset += 1; + $info_dts['raw']['deficit_samples'] = bindec(substr($fhBS, $bs_offset, 5)); $bs_offset += 5; + $info_dts['flags']['crc_present'] = (bool) bindec(substr($fhBS, $bs_offset, 1)); $bs_offset += 1; + $info_dts['raw']['pcm_sample_blocks'] = bindec(substr($fhBS, $bs_offset, 7)); $bs_offset += 7; + $info_dts['raw']['frame_byte_size'] = bindec(substr($fhBS, $bs_offset, 14)); $bs_offset += 14; + $info_dts['raw']['channel_arrangement'] = bindec(substr($fhBS, $bs_offset, 6)); $bs_offset += 6; + $info_dts['raw']['sample_frequency'] = bindec(substr($fhBS, $bs_offset, 4)); $bs_offset += 4; + $info_dts['raw']['bitrate'] = bindec(substr($fhBS, $bs_offset, 5)); $bs_offset += 5; + $info_dts['flags']['embedded_downmix'] = (bool) bindec(substr($fhBS, $bs_offset, 1)); $bs_offset += 1; + $info_dts['flags']['dynamicrange'] = (bool) bindec(substr($fhBS, $bs_offset, 1)); $bs_offset += 1; + $info_dts['flags']['timestamp'] = (bool) bindec(substr($fhBS, $bs_offset, 1)); $bs_offset += 1; + $info_dts['flags']['auxdata'] = (bool) bindec(substr($fhBS, $bs_offset, 1)); $bs_offset += 1; + $info_dts['flags']['hdcd'] = (bool) bindec(substr($fhBS, $bs_offset, 1)); $bs_offset += 1; + $info_dts['raw']['extension_audio'] = bindec(substr($fhBS, $bs_offset, 3)); $bs_offset += 3; + $info_dts['flags']['extended_coding'] = (bool) bindec(substr($fhBS, $bs_offset, 1)); $bs_offset += 1; + $info_dts['flags']['audio_sync_insertion'] = (bool) bindec(substr($fhBS, $bs_offset, 1)); $bs_offset += 1; + $info_dts['raw']['lfe_effects'] = bindec(substr($fhBS, $bs_offset, 2)); $bs_offset += 2; + $info_dts['flags']['predictor_history'] = (bool) bindec(substr($fhBS, $bs_offset, 1)); $bs_offset += 1; + if ($info_dts['flags']['crc_present']) { + $info_dts['raw']['crc16'] = bindec(substr($fhBS, $bs_offset, 16)); $bs_offset += 16; + } + $info_dts['flags']['mri_perfect_reconst'] = (bool) bindec(substr($fhBS, $bs_offset, 1)); $bs_offset += 1; + $info_dts['raw']['encoder_soft_version'] = bindec(substr($fhBS, $bs_offset, 4)); $bs_offset += 4; + $info_dts['raw']['copy_history'] = bindec(substr($fhBS, $bs_offset, 2)); $bs_offset += 2; + $info_dts['raw']['bits_per_sample'] = bindec(substr($fhBS, $bs_offset, 2)); $bs_offset += 2; + $info_dts['flags']['surround_es'] = (bool) bindec(substr($fhBS, $bs_offset, 1)); $bs_offset += 1; + $info_dts['flags']['front_sum_diff'] = (bool) bindec(substr($fhBS, $bs_offset, 1)); $bs_offset += 1; + $info_dts['flags']['surround_sum_diff'] = (bool) bindec(substr($fhBS, $bs_offset, 1)); $bs_offset += 1; + $info_dts['raw']['dialog_normalization'] = bindec(substr($fhBS, $bs_offset, 4)); $bs_offset += 4; + + + $info_dts['bitrate'] = $this->DTSbitrateLookup($info_dts['raw']['bitrate']); + $info_dts['bits_per_sample'] = $this->DTSbitPerSampleLookup($info_dts['raw']['bits_per_sample']); + $info_dts['sample_rate'] = $this->DTSsampleRateLookup($info_dts['raw']['sample_frequency']); + $info_dts['dialog_normalization'] = $this->DTSdialogNormalization($info_dts['raw']['dialog_normalization'], $info_dts['raw']['encoder_soft_version']); + $info_dts['flags']['lossless'] = (($info_dts['raw']['bitrate'] == 31) ? true : false); + $info_dts['bitrate_mode'] = (($info_dts['raw']['bitrate'] == 30) ? 'vbr' : 'cbr'); + $info_dts['channels'] = $this->DTSnumChannelsLookup($info_dts['raw']['channel_arrangement']); + $info_dts['channel_arrangement'] = $this->DTSchannelArrangementLookup($info_dts['raw']['channel_arrangement']); + + $getid3->info['audio']['dataformat'] = 'dts'; + $getid3->info['audio']['lossless'] = $info_dts['flags']['lossless']; + $getid3->info['audio']['bitrate_mode'] = $info_dts['bitrate_mode']; + $getid3->info['audio']['bits_per_sample'] = $info_dts['bits_per_sample']; + $getid3->info['audio']['sample_rate'] = $info_dts['sample_rate']; + $getid3->info['audio']['channels'] = $info_dts['channels']; + $getid3->info['audio']['bitrate'] = $info_dts['bitrate']; + $getid3->info['playtime_seconds'] = ($getid3->info['avdataend'] - $getid3->info['avdataoffset']) / ($info_dts['bitrate'] / 8); + + return true; + } + + + public static function DTSbitrateLookup($index) { + + static $lookup = array ( + 0 => 32000, + 1 => 56000, + 2 => 64000, + 3 => 96000, + 4 => 112000, + 5 => 128000, + 6 => 192000, + 7 => 224000, + 8 => 256000, + 9 => 320000, + 10 => 384000, + 11 => 448000, + 12 => 512000, + 13 => 576000, + 14 => 640000, + 15 => 768000, + 16 => 960000, + 17 => 1024000, + 18 => 1152000, + 19 => 1280000, + 20 => 1344000, + 21 => 1408000, + 22 => 1411200, + 23 => 1472000, + 24 => 1536000, + 25 => 1920000, + 26 => 2048000, + 27 => 3072000, + 28 => 3840000, + 29 => 'open', + 30 => 'variable', + 31 => 'lossless' + ); + return @$lookup[$index]; + } + + + public static function DTSsampleRateLookup($index) { + + static $lookup = array ( + 0 => 'invalid', + 1 => 8000, + 2 => 16000, + 3 => 32000, + 4 => 'invalid', + 5 => 'invalid', + 6 => 11025, + 7 => 22050, + 8 => 44100, + 9 => 'invalid', + 10 => 'invalid', + 11 => 12000, + 12 => 24000, + 13 => 48000, + 14 => 'invalid', + 15 => 'invalid' + ); + return @$lookup[$index]; + } + + + public static function DTSbitPerSampleLookup($index) { + + static $lookup = array ( + 0 => 16, + 1 => 20, + 2 => 24, + 3 => 24, + ); + return @$lookup[$index]; + } + + + public static function DTSnumChannelsLookup($index) { + + switch ($index) { + case 0: + return 1; + + case 1: + case 2: + case 3: + case 4: + return 2; + + case 5: + case 6: + return 3; + + case 7: + case 8: + return 4; + + case 9: + return 5; + + case 10: + case 11: + case 12: + return 6; + + case 13: + return 7; + + case 14: + case 15: + return 8; + } + return false; + } + + + public static function DTSchannelArrangementLookup($index) { + + static $lookup = array ( + 0 => 'A', + 1 => 'A + B (dual mono)', + 2 => 'L + R (stereo)', + 3 => '(L+R) + (L-R) (sum-difference)', + 4 => 'LT + RT (left and right total)', + 5 => 'C + L + R', + 6 => 'L + R + S', + 7 => 'C + L + R + S', + 8 => 'L + R + SL + SR', + 9 => 'C + L + R + SL + SR', + 10 => 'CL + CR + L + R + SL + SR', + 11 => 'C + L + R+ LR + RR + OV', + 12 => 'CF + CR + LF + RF + LR + RR', + 13 => 'CL + C + CR + L + R + SL + SR', + 14 => 'CL + CR + L + R + SL1 + SL2 + SR1 + SR2', + 15 => 'CL + C+ CR + L + R + SL + S + SR', + ); + return (@$lookup[$index] ? @$lookup[$index] : 'user-defined'); + } + + + public static function DTSdialogNormalization($index, $version) { + + switch ($version) { + case 7: + return 0 - $index; + + case 6: + return 0 - 16 - $index; + } + return false; + } + +} + + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.la.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.la.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,196 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.la.php | +// | Module for analyzing LA udio files | +// | dependencies: module.audio-video.riff.php | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.la.php,v 1.2 2006/11/02 10:48:01 ah Exp $ + + + +class getid3_la extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->include_module('audio-video.riff'); + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $raw_data = fread($getid3->fp, getid3::FREAD_BUFFER_SIZE); + + $getid3->info['fileformat'] = 'la'; + $getid3->info['audio']['dataformat'] = 'la'; + $getid3->info['audio']['lossless'] = true; + + $getid3->info['la']['version_major'] = (int)$raw_data{2}; + $getid3->info['la']['version_minor'] = (int)$raw_data{3}; + $getid3->info['la']['version'] = (float)$getid3->info['la']['version_major'] + ($getid3->info['la']['version_minor'] / 10); + + $getid3->info['la']['uncompressed_size'] = getid3_lib::LittleEndian2Int(substr($raw_data, 4, 4)); + + $wave_chunk = substr($raw_data, 8, 4); + if ($wave_chunk !== 'WAVE') { + throw new getid3_exception('Expected "WAVE" ('.getid3_lib::PrintHexBytes('WAVE').') at offset 8, found "'.$wave_chunk.'" ('.getid3_lib::PrintHexBytes($wave_chunk).') instead.'); + } + + $offset = 12; + + $getid3->info['la']['fmt_size'] = 24; + if ($getid3->info['la']['version'] >= 0.3) { + + $getid3->info['la']['fmt_size'] = getid3_lib::LittleEndian2Int(substr($raw_data, $offset, 4)); + $getid3->info['la']['header_size'] = 49 + $getid3->info['la']['fmt_size'] - 24; + $offset += 4; + + } else { + + // version 0.2 didn't support additional data blocks + $getid3->info['la']['header_size'] = 41; + } + + $fmt_chunk = substr($raw_data, $offset, 4); + if ($fmt_chunk !== 'fmt ') { + throw new getid3_exception('Expected "fmt " ('.getid3_lib::PrintHexBytes('fmt ').') at offset '.$offset.', found "'.$fmt_chunk.'" ('.getid3_lib::PrintHexBytes($fmt_chunk).') instead.'); + } + $offset += 4; + + $fmt_size = getid3_lib::LittleEndian2Int(substr($raw_data, $offset, 4)); + $offset += 4; + + $getid3->info['la']['raw']['format'] = getid3_lib::LittleEndian2Int(substr($raw_data, $offset, 2)); + $offset += 2; + + getid3_lib::ReadSequence('LittleEndian2Int', $getid3->info['la'], $raw_data, $offset, + array ( + 'channels' => 2, + 'sample_rate' => 4, + 'bytes_per_second' => 4, + 'bytes_per_sample' => 2, + 'bits_per_sample' => 2, + 'samples' => 4 + ) + ); + $offset += 18; + + $getid3->info['la']['raw']['flags'] = getid3_lib::LittleEndian2Int($raw_data{$offset++}); + + $getid3->info['la']['flags']['seekable'] = (bool)($getid3->info['la']['raw']['flags'] & 0x01); + if ($getid3->info['la']['version'] >= 0.4) { + $getid3->info['la']['flags']['high_compression'] = (bool)($getid3->info['la']['raw']['flags'] & 0x02); + } + + $getid3->info['la']['original_crc'] = getid3_lib::LittleEndian2Int(substr($raw_data, $offset, 4)); + $offset += 4; + + // mikeØbevin*de + // Basically, the blocksize/seekevery are 61440/19 in La0.4 and 73728/16 + // in earlier versions. A seekpoint is added every blocksize * seekevery + // samples, so 4 * int(totalSamples / (blockSize * seekEvery)) should + // give the number of bytes used for the seekpoints. Of course, if seeking + // is disabled, there are no seekpoints stored. + + if ($getid3->info['la']['version'] >= 0.4) { + $getid3->info['la']['blocksize'] = 61440; + $getid3->info['la']['seekevery'] = 19; + } else { + $getid3->info['la']['blocksize'] = 73728; + $getid3->info['la']['seekevery'] = 16; + } + + $getid3->info['la']['seekpoint_count'] = 0; + if ($getid3->info['la']['flags']['seekable']) { + $getid3->info['la']['seekpoint_count'] = floor($getid3->info['la']['samples'] / ($getid3->info['la']['blocksize'] * $getid3->info['la']['seekevery'])); + + for ($i = 0; $i < $getid3->info['la']['seekpoint_count']; $i++) { + $getid3->info['la']['seekpoints'][] = getid3_lib::LittleEndian2Int(substr($raw_data, $offset, 4)); + $offset += 4; + } + } + + if ($getid3->info['la']['version'] >= 0.3) { + + // Following the main header information, the program outputs all of the + // seekpoints. Following these is what I called the 'footer start', + // i.e. the position immediately after the La audio data is finished. + + $getid3->info['la']['footerstart'] = getid3_lib::LittleEndian2Int(substr($raw_data, $offset, 4)); + $offset += 4; + + if ($getid3->info['la']['footerstart'] > $getid3->info['filesize']) { + $getid3->warning('FooterStart value points to offset '.$getid3->info['la']['footerstart'].' which is beyond end-of-file ('.$getid3->info['filesize'].')'); + $getid3->info['la']['footerstart'] = $getid3->info['filesize']; + } + + } else { + + // La v0.2 didn't have FooterStart value + $getid3->info['la']['footerstart'] = $getid3->info['avdataend']; + + } + + if ($getid3->info['la']['footerstart'] < $getid3->info['avdataend']) { + + // Create riff header + $riff_data = 'WAVE'; + if ($getid3->info['la']['version'] == 0.2) { + $riff_data .= substr($raw_data, 12, 24); + } else { + $riff_data .= substr($raw_data, 16, 24); + } + if ($getid3->info['la']['footerstart'] < $getid3->info['avdataend']) { + fseek($getid3->fp, $getid3->info['la']['footerstart'], SEEK_SET); + $riff_data .= fread($getid3->fp, $getid3->info['avdataend'] - $getid3->info['la']['footerstart']); + } + $riff_data = 'RIFF'.getid3_lib::LittleEndian2String(strlen($riff_data), 4, false).$riff_data; + + // Clone getid3 - messing with offsets - better safe than sorry + $clone = clone $getid3; + + // Analyze clone by string + $riff = new getid3_riff($clone); + $riff->AnalyzeString($riff_data); + + // Import from clone and destroy + $getid3->info['riff'] = $clone->info['riff']; + $getid3->warnings($clone->warnings()); + unset($clone); + } + + // $getid3->info['avdataoffset'] should be zero to begin with, but just in case it's not, include the addition anyway + $getid3->info['avdataend'] = $getid3->info['avdataoffset'] + $getid3->info['la']['footerstart']; + $getid3->info['avdataoffset'] = $getid3->info['avdataoffset'] + $offset; + + $getid3->info['la']['compression_ratio'] = (float)(($getid3->info['avdataend'] - $getid3->info['avdataoffset']) / $getid3->info['la']['uncompressed_size']); + $getid3->info['playtime_seconds'] = (float)($getid3->info['la']['samples'] / $getid3->info['la']['sample_rate']) / $getid3->info['la']['channels']; + + $getid3->info['audio']['bitrate'] = ($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8 / $getid3->info['playtime_seconds']; + $getid3->info['audio']['bits_per_sample'] = $getid3->info['la']['bits_per_sample']; + + $getid3->info['audio']['channels'] = $getid3->info['la']['channels']; + $getid3->info['audio']['sample_rate'] = (int)$getid3->info['la']['sample_rate']; + $getid3->info['audio']['encoder'] = 'LA v'.$getid3->info['la']['version']; + + return true; + } + +} + + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.lpac.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.lpac.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,148 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.lpac.php | +// | Module for analyzing LPAC Audio files | +// | dependencies: module.audio-video.riff.php | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.lpac.php,v 1.2 2006/11/02 10:48:01 ah Exp $ + + + +class getid3_lpac extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->include_module('audio-video.riff'); + + // Magic bytes - 'LPAC' + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $lpac_header = fread($getid3->fp, 14); + + $getid3->info['avdataoffset'] += 14; + + $getid3->info['lpac'] = array (); + $info_lpac = &$getid3->info['lpac']; + + $getid3->info['fileformat'] = 'lpac'; + $getid3->info['audio']['dataformat'] = 'lpac'; + $getid3->info['audio']['lossless'] = true; + $getid3->info['audio']['bitrate_mode'] = 'vbr'; + + $info_lpac['file_version'] = getid3_lib::BigEndian2Int($lpac_header{4}); + $flags['audio_type'] = getid3_lib::BigEndian2Int($lpac_header{5}); + $info_lpac['total_samples'] = getid3_lib::BigEndian2Int(substr($lpac_header, 6, 4)); + $flags['parameters'] = getid3_lib::BigEndian2Int(substr($lpac_header, 10, 4)); + + $info_lpac['flags']['is_wave'] = (bool)($flags['audio_type'] & 0x40); + $info_lpac['flags']['stereo'] = (bool)($flags['audio_type'] & 0x04); + $info_lpac['flags']['24_bit'] = (bool)($flags['audio_type'] & 0x02); + $info_lpac['flags']['16_bit'] = (bool)($flags['audio_type'] & 0x01); + + if ($info_lpac['flags']['24_bit'] && $info_lpac['flags']['16_bit']) { + $getid3->warning('24-bit and 16-bit flags cannot both be set'); + } + + $info_lpac['flags']['fast_compress'] = (bool)($flags['parameters'] & 0x40000000); + $info_lpac['flags']['random_access'] = (bool)($flags['parameters'] & 0x08000000); + $info_lpac['block_length'] = pow(2, (($flags['parameters'] & 0x07000000) >> 24)) * 256; + $info_lpac['flags']['adaptive_prediction_order'] = (bool)($flags['parameters'] & 0x00800000); + $info_lpac['flags']['adaptive_quantization'] = (bool)($flags['parameters'] & 0x00400000); + $info_lpac['flags']['joint_stereo'] = (bool)($flags['parameters'] & 0x00040000); + $info_lpac['quantization'] = ($flags['parameters'] & 0x00001F00) >> 8; + $info_lpac['max_prediction_order'] = ($flags['parameters'] & 0x0000003F); + + if ($info_lpac['flags']['fast_compress'] && ($info_lpac['max_prediction_order'] != 3)) { + $getid3->warning('max_prediction_order expected to be "3" if fast_compress is true, actual value is "'.$info_lpac['max_prediction_order'].'"'); + } + + switch ($info_lpac['file_version']) { + + case 6: + if ($info_lpac['flags']['adaptive_quantization']) { + $getid3->warning('adaptive_quantization expected to be false in LPAC file stucture v6, actually true'); + } + if ($info_lpac['quantization'] != 20) { + $getid3->warning('Quantization expected to be 20 in LPAC file stucture v6, actually '.$info_lpac['flags']['Q']); + } + break; + + + default: + //$getid3->warning('This version of getID3() only supports LPAC file format version 6, this file is version '.$info_lpac['file_version'].' - please report to info@getid3.org'); + break; + } + + // Clone getid3 - messing with something - better safe than sorry + $clone = clone $getid3; + + // Analyze clone by fp + $riff = new getid3_riff($clone); + $riff->Analyze(); + + // Import from clone and destroy + $getid3->info['avdataoffset'] = $clone->info['avdataoffset']; + $getid3->info['riff'] = $clone->info['riff']; + //$info_lpac['comments']['comment'] = $clone->info['comments']; + $getid3->info['audio']['sample_rate'] = $clone->info['audio']['sample_rate']; + $getid3->warnings($clone->warnings()); + unset($clone); + + $getid3->info['audio']['channels'] = ($info_lpac['flags']['stereo'] ? 2 : 1); + + if ($info_lpac['flags']['24_bit']) { + $getid3->info['audio']['bits_per_sample'] = $getid3->info['riff']['audio'][0]['bits_per_sample']; + } elseif ($info_lpac['flags']['16_bit']) { + $getid3->info['audio']['bits_per_sample'] = 16; + } else { + $getid3->info['audio']['bits_per_sample'] = 8; + } + + if ($info_lpac['flags']['fast_compress']) { + // fast + $getid3->info['audio']['encoder_options'] = '-1'; + } else { + switch ($info_lpac['max_prediction_order']) { + case 20: // simple + $getid3->info['audio']['encoder_options'] = '-2'; + break; + case 30: // medium + $getid3->info['audio']['encoder_options'] = '-3'; + break; + case 40: // high + $getid3->info['audio']['encoder_options'] = '-4'; + break; + case 60: // extrahigh + $getid3->info['audio']['encoder_options'] = '-5'; + break; + } + } + + $getid3->info['playtime_seconds'] = $info_lpac['total_samples'] / $getid3->info['audio']['sample_rate']; + $getid3->info['audio']['bitrate'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / $getid3->info['playtime_seconds']; + + return true; + } + +} + + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.midi.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.midi.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,552 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.midi.php | +// | Module for analyzing midi audio files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.midi.php,v 1.5 2006/11/02 10:48:01 ah Exp $ + + + +class getid3_midi extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->info['midi']['raw'] = array (); + $info_midi = &$getid3->info['midi']; + $info_midi_raw = &$info_midi['raw']; + + $getid3->info['fileformat'] = 'midi'; + $getid3->info['audio']['dataformat'] = 'midi'; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $midi_data = fread($getid3->fp, getid3::FREAD_BUFFER_SIZE); + + // Magic bytes: 'MThd' + + getid3_lib::ReadSequence('BigEndian2Int', $info_midi_raw, $midi_data, 4, + array ( + 'headersize' => 4, + 'fileformat' => 2, + 'tracks' => 2, + 'ticksperqnote' => 2 + ) + ); + + $offset = 14; + + for ($i = 0; $i < $info_midi_raw['tracks']; $i++) { + + if ((strlen($midi_data) - $offset) < 8) { + $midi_data .= fread($getid3->fp, getid3::FREAD_BUFFER_SIZE); + } + + $track_id = substr($midi_data, $offset, 4); + $offset += 4; + + if ($track_id != 'MTrk') { + throw new getid3_exception('Expecting "MTrk" at '.$offset.', found '.$track_id.' instead'); + } + + $track_size = getid3_lib::BigEndian2Int(substr($midi_data, $offset, 4)); + $offset += 4; + + $track_data_array[$i] = substr($midi_data, $offset, $track_size); + $offset += $track_size; + } + + if (!isset($track_data_array) || !is_array($track_data_array)) { + throw new getid3_exception('Cannot find MIDI track information'); + } + + + $info_midi['totalticks'] = 0; + $getid3->info['playtime_seconds'] = 0; + $current_ms_per_beat = 500000; // 120 beats per minute; 60,000,000 microseconds per minute -> 500,000 microseconds per beat + $current_beats_per_min = 120; // 120 beats per minute; 60,000,000 microseconds per minute -> 500,000 microseconds per beat + $ms_per_quarter_note_after = array (); + + foreach ($track_data_array as $track_number => $track_data) { + + $events_offset = $last_issued_midi_command = $last_issued_midi_channel = $cumulative_delta_time = $ticks_at_current_bpm = 0; + + while ($events_offset < strlen($track_data)) { + + $event_id = 0; + if (isset($midi_events[$track_number]) && is_array($midi_events[$track_number])) { + $event_id = count($midi_events[$track_number]); + } + $delta_time = 0; + for ($i = 0; $i < 4; $i++) { + $delta_time_byte = ord($track_data{$events_offset++}); + $delta_time = ($delta_time << 7) + ($delta_time_byte & 0x7F); + if ($delta_time_byte & 0x80) { + // another byte follows + } else { + break; + } + } + + $cumulative_delta_time += $delta_time; + $ticks_at_current_bpm += $delta_time; + + $midi_events[$track_number][$event_id]['deltatime'] = $delta_time; + + $midi_event_channel = ord($track_data{$events_offset++}); + + // OK, normal event - MIDI command has MSB set + if ($midi_event_channel & 0x80) { + $last_issued_midi_command = $midi_event_channel >> 4; + $last_issued_midi_channel = $midi_event_channel & 0x0F; + } + + // Running event - assume last command + else { + $events_offset--; + } + + $midi_events[$track_number][$event_id]['eventid'] = $last_issued_midi_command; + $midi_events[$track_number][$event_id]['channel'] = $last_issued_midi_channel; + + switch ($midi_events[$track_number][$event_id]['eventid']) { + + case 0x8: // Note off (key is released) + case 0x9: // Note on (key is pressed) + case 0xA: // Key after-touch + + //$notenumber = ord($track_data{$events_offset++}); + //$velocity = ord($track_data{$events_offset++}); + $events_offset += 2; + break; + + + case 0xB: // Control Change + + //$controllernum = ord($track_data{$events_offset++}); + //$newvalue = ord($track_data{$events_offset++}); + $events_offset += 2; + break; + + + case 0xC: // Program (patch) change + + $new_program_num = ord($track_data{$events_offset++}); + + $info_midi_raw['track'][$track_number]['instrumentid'] = $new_program_num; + $info_midi_raw['track'][$track_number]['instrument'] = $track_number == 10 ? getid3_midi::GeneralMIDIpercussionLookup($new_program_num) : getid3_midi::GeneralMIDIinstrumentLookup($new_program_num); + break; + + + case 0xD: // Channel after-touch + + //$channelnumber = ord($track_data{$events_offset++}); + break; + + + case 0xE: // Pitch wheel change (2000H is normal or no change) + + //$changeLSB = ord($track_data{$events_offset++}); + //$changeMSB = ord($track_data{$events_offset++}); + //$pitchwheelchange = (($changeMSB & 0x7F) << 7) & ($changeLSB & 0x7F); + $events_offset += 2; + break; + + + case 0xF: + + if ($midi_events[$track_number][$event_id]['channel'] == 0xF) { + + $meta_event_command = ord($track_data{$events_offset++}); + $meta_event_length = ord($track_data{$events_offset++}); + $meta_event_data = substr($track_data, $events_offset, $meta_event_length); + $events_offset += $meta_event_length; + + switch ($meta_event_command) { + + case 0x00: // Set track sequence number + + //$track_sequence_number = getid3_lib::BigEndian2Int(substr($meta_event_data, 0, $meta_event_length)); + //$info_midi_raw['events'][$track_number][$event_id]['seqno'] = $track_sequence_number; + break; + + + case 0x01: // Text: generic + + $text_generic = substr($meta_event_data, 0, $meta_event_length); + //$info_midi_raw['events'][$track_number][$event_id]['text'] = $text_generic; + $info_midi['comments']['comment'][] = $text_generic; + break; + + + case 0x02: // Text: copyright + + $text_copyright = substr($meta_event_data, 0, $meta_event_length); + //$info_midi_raw['events'][$track_number][$event_id]['copyright'] = $text_copyright; + $info_midi['comments']['copyright'][] = $text_copyright; + break; + + + case 0x03: // Text: track name + + $text_trackname = substr($meta_event_data, 0, $meta_event_length); + $info_midi_raw['track'][$track_number]['name'] = $text_trackname; + break; + + + case 0x04: // Text: track instrument name + + //$text_instrument = substr($meta_event_data, 0, $meta_event_length); + //$info_midi_raw['events'][$track_number][$event_id]['instrument'] = $text_instrument; + break; + + + case 0x05: // Text: lyrics + + $text_lyrics = substr($meta_event_data, 0, $meta_event_length); + //$info_midi_raw['events'][$track_number][$event_id]['lyrics'] = $text_lyrics; + if (!isset($info_midi['lyrics'])) { + $info_midi['lyrics'] = ''; + } + $info_midi['lyrics'] .= $text_lyrics . "\n"; + break; + + + case 0x06: // Text: marker + + //$text_marker = substr($meta_event_data, 0, $meta_event_length); + //$info_midi_raw['events'][$track_number][$event_id]['marker'] = $text_marker; + break; + + + case 0x07: // Text: cue point + + //$text_cuepoint = substr($meta_event_data, 0, $meta_event_length); + //$info_midi_raw['events'][$track_number][$event_id]['cuepoint'] = $text_cuepoint; + break; + + + case 0x2F: // End Of Track + + //$info_midi_raw['events'][$track_number][$event_id]['EOT'] = $cumulative_delta_time; + break; + + + case 0x51: // Tempo: microseconds / quarter note + + $current_ms_per_beat = getid3_lib::BigEndian2Int(substr($meta_event_data, 0, $meta_event_length)); + $info_midi_raw['events'][$track_number][$cumulative_delta_time]['us_qnote'] = $current_ms_per_beat; + $current_beats_per_min = (1000000 / $current_ms_per_beat) * 60; + $ms_per_quarter_note_after[$cumulative_delta_time] = $current_ms_per_beat; + $ticks_at_current_bpm = 0; + break; + + + case 0x58: // Time signature + $timesig_numerator = getid3_lib::BigEndian2Int($meta_event_data[0]); + $timesig_denominator = pow(2, getid3_lib::BigEndian2Int($meta_event_data[1])); // $02 -> x/4, $03 -> x/8, etc + //$timesig_32inqnote = getid3_lib::BigEndian2Int($meta_event_data[2]); // number of 32nd notes to the quarter note + //$info_midi_raw['events'][$track_number][$event_id]['timesig_32inqnote'] = $timesig_32inqnote; + //$info_midi_raw['events'][$track_number][$event_id]['timesig_numerator'] = $timesig_numerator; + //$info_midi_raw['events'][$track_number][$event_id]['timesig_denominator'] = $timesig_denominator; + //$info_midi_raw['events'][$track_number][$event_id]['timesig_text'] = $timesig_numerator.'/'.$timesig_denominator; + $info_midi['timesignature'][] = $timesig_numerator.'/'.$timesig_denominator; + break; + + + case 0x59: // Keysignature + + $keysig_sharpsflats = getid3_lib::BigEndian2Int($meta_event_data{0}); + if ($keysig_sharpsflats & 0x80) { + // (-7 -> 7 flats, 0 ->key of C, 7 -> 7 sharps) + $keysig_sharpsflats -= 256; + } + + $keysig_majorminor = getid3_lib::BigEndian2Int($meta_event_data{1}); // 0 -> major, 1 -> minor + $keysigs = array (-7=>'Cb', -6=>'Gb', -5=>'Db', -4=>'Ab', -3=>'Eb', -2=>'Bb', -1=>'F', 0=>'C', 1=>'G', 2=>'D', 3=>'A', 4=>'E', 5=>'B', 6=>'F#', 7=>'C#'); + //$info_midi_raw['events'][$track_number][$event_id]['keysig_sharps'] = (($keysig_sharpsflats > 0) ? abs($keysig_sharpsflats) : 0); + //$info_midi_raw['events'][$track_number][$event_id]['keysig_flats'] = (($keysig_sharpsflats < 0) ? abs($keysig_sharpsflats) : 0); + //$info_midi_raw['events'][$track_number][$event_id]['keysig_minor'] = (bool)$keysig_majorminor; + //$info_midi_raw['events'][$track_number][$event_id]['keysig_text'] = $keysigs[$keysig_sharpsflats].' '.($info_midi_raw['events'][$track_number][$event_id]['keysig_minor'] ? 'minor' : 'major'); + + // $keysigs[$keysig_sharpsflats] gets an int key (correct) - $keysigs["$keysig_sharpsflats"] gets a string key (incorrect) + $info_midi['keysignature'][] = $keysigs[$keysig_sharpsflats].' '.((bool)$keysig_majorminor ? 'minor' : 'major'); + break; + + + case 0x7F: // Sequencer specific information + + $custom_data = substr($meta_event_data, 0, $meta_event_length); + break; + + + default: + + $getid3->warning('Unhandled META Event Command: '.$meta_event_command); + } + } + break; + + + default: + $getid3->warning('Unhandled MIDI Event ID: '.$midi_events[$track_number][$event_id]['eventid']); + } + } + + if (($track_number > 0) || (count($track_data_array) == 1)) { + $info_midi['totalticks'] = max($info_midi['totalticks'], $cumulative_delta_time); + } + } + + $previous_tick_offset = null; + + ksort($ms_per_quarter_note_after); + foreach ($ms_per_quarter_note_after as $tick_offset => $ms_per_beat) { + + if (is_null($previous_tick_offset)) { + $prev_ms_per_beat = $ms_per_beat; + $previous_tick_offset = $tick_offset; + continue; + } + + if ($info_midi['totalticks'] > $tick_offset) { + $getid3->info['playtime_seconds'] += (($tick_offset - $previous_tick_offset) / $info_midi_raw['ticksperqnote']) * ($prev_ms_per_beat / 1000000); + + $prev_ms_per_beat = $ms_per_beat; + $previous_tick_offset = $tick_offset; + } + } + + if ($info_midi['totalticks'] > $previous_tick_offset) { + $getid3->info['playtime_seconds'] += (($info_midi['totalticks'] - $previous_tick_offset) / $info_midi_raw['ticksperqnote']) * ($ms_per_beat / 1000000); + } + + if (@$getid3->info['playtime_seconds'] > 0) { + $getid3->info['bitrate'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / $getid3->info['playtime_seconds']; + } + + if (!empty($info_midi['lyrics'])) { + $info_midi['comments']['lyrics'][] = $info_midi['lyrics']; + } + + return true; + } + + + + public static function GeneralMIDIinstrumentLookup($instrument_id) { + + static $lookup = array ( + + 0 => 'Acoustic Grand', + 1 => 'Bright Acoustic', + 2 => 'Electric Grand', + 3 => 'Honky-Tonk', + 4 => 'Electric Piano 1', + 5 => 'Electric Piano 2', + 6 => 'Harpsichord', + 7 => 'Clavier', + 8 => 'Celesta', + 9 => 'Glockenspiel', + 10 => 'Music Box', + 11 => 'Vibraphone', + 12 => 'Marimba', + 13 => 'Xylophone', + 14 => 'Tubular Bells', + 15 => 'Dulcimer', + 16 => 'Drawbar Organ', + 17 => 'Percussive Organ', + 18 => 'Rock Organ', + 19 => 'Church Organ', + 20 => 'Reed Organ', + 21 => 'Accordian', + 22 => 'Harmonica', + 23 => 'Tango Accordian', + 24 => 'Acoustic Guitar (nylon)', + 25 => 'Acoustic Guitar (steel)', + 26 => 'Electric Guitar (jazz)', + 27 => 'Electric Guitar (clean)', + 28 => 'Electric Guitar (muted)', + 29 => 'Overdriven Guitar', + 30 => 'Distortion Guitar', + 31 => 'Guitar Harmonics', + 32 => 'Acoustic Bass', + 33 => 'Electric Bass (finger)', + 34 => 'Electric Bass (pick)', + 35 => 'Fretless Bass', + 36 => 'Slap Bass 1', + 37 => 'Slap Bass 2', + 38 => 'Synth Bass 1', + 39 => 'Synth Bass 2', + 40 => 'Violin', + 41 => 'Viola', + 42 => 'Cello', + 43 => 'Contrabass', + 44 => 'Tremolo Strings', + 45 => 'Pizzicato Strings', + 46 => 'Orchestral Strings', + 47 => 'Timpani', + 48 => 'String Ensemble 1', + 49 => 'String Ensemble 2', + 50 => 'SynthStrings 1', + 51 => 'SynthStrings 2', + 52 => 'Choir Aahs', + 53 => 'Voice Oohs', + 54 => 'Synth Voice', + 55 => 'Orchestra Hit', + 56 => 'Trumpet', + 57 => 'Trombone', + 58 => 'Tuba', + 59 => 'Muted Trumpet', + 60 => 'French Horn', + 61 => 'Brass Section', + 62 => 'SynthBrass 1', + 63 => 'SynthBrass 2', + 64 => 'Soprano Sax', + 65 => 'Alto Sax', + 66 => 'Tenor Sax', + 67 => 'Baritone Sax', + 68 => 'Oboe', + 69 => 'English Horn', + 70 => 'Bassoon', + 71 => 'Clarinet', + 72 => 'Piccolo', + 73 => 'Flute', + 74 => 'Recorder', + 75 => 'Pan Flute', + 76 => 'Blown Bottle', + 77 => 'Shakuhachi', + 78 => 'Whistle', + 79 => 'Ocarina', + 80 => 'Lead 1 (square)', + 81 => 'Lead 2 (sawtooth)', + 82 => 'Lead 3 (calliope)', + 83 => 'Lead 4 (chiff)', + 84 => 'Lead 5 (charang)', + 85 => 'Lead 6 (voice)', + 86 => 'Lead 7 (fifths)', + 87 => 'Lead 8 (bass + lead)', + 88 => 'Pad 1 (new age)', + 89 => 'Pad 2 (warm)', + 90 => 'Pad 3 (polysynth)', + 91 => 'Pad 4 (choir)', + 92 => 'Pad 5 (bowed)', + 93 => 'Pad 6 (metallic)', + 94 => 'Pad 7 (halo)', + 95 => 'Pad 8 (sweep)', + 96 => 'FX 1 (rain)', + 97 => 'FX 2 (soundtrack)', + 98 => 'FX 3 (crystal)', + 99 => 'FX 4 (atmosphere)', + 100 => 'FX 5 (brightness)', + 101 => 'FX 6 (goblins)', + 102 => 'FX 7 (echoes)', + 103 => 'FX 8 (sci-fi)', + 104 => 'Sitar', + 105 => 'Banjo', + 106 => 'Shamisen', + 107 => 'Koto', + 108 => 'Kalimba', + 109 => 'Bagpipe', + 110 => 'Fiddle', + 111 => 'Shanai', + 112 => 'Tinkle Bell', + 113 => 'Agogo', + 114 => 'Steel Drums', + 115 => 'Woodblock', + 116 => 'Taiko Drum', + 117 => 'Melodic Tom', + 118 => 'Synth Drum', + 119 => 'Reverse Cymbal', + 120 => 'Guitar Fret Noise', + 121 => 'Breath Noise', + 122 => 'Seashore', + 123 => 'Bird Tweet', + 124 => 'Telephone Ring', + 125 => 'Helicopter', + 126 => 'Applause', + 127 => 'Gunshot' + ); + + return @$lookup[$instrument_id]; + } + + + + public static function GeneralMIDIpercussionLookup($instrument_id) { + + static $lookup = array ( + + 35 => 'Acoustic Bass Drum', + 36 => 'Bass Drum 1', + 37 => 'Side Stick', + 38 => 'Acoustic Snare', + 39 => 'Hand Clap', + 40 => 'Electric Snare', + 41 => 'Low Floor Tom', + 42 => 'Closed Hi-Hat', + 43 => 'High Floor Tom', + 44 => 'Pedal Hi-Hat', + 45 => 'Low Tom', + 46 => 'Open Hi-Hat', + 47 => 'Low-Mid Tom', + 48 => 'Hi-Mid Tom', + 49 => 'Crash Cymbal 1', + 50 => 'High Tom', + 51 => 'Ride Cymbal 1', + 52 => 'Chinese Cymbal', + 53 => 'Ride Bell', + 54 => 'Tambourine', + 55 => 'Splash Cymbal', + 56 => 'Cowbell', + 57 => 'Crash Cymbal 2', + 59 => 'Ride Cymbal 2', + 60 => 'Hi Bongo', + 61 => 'Low Bongo', + 62 => 'Mute Hi Conga', + 63 => 'Open Hi Conga', + 64 => 'Low Conga', + 65 => 'High Timbale', + 66 => 'Low Timbale', + 67 => 'High Agogo', + 68 => 'Low Agogo', + 69 => 'Cabasa', + 70 => 'Maracas', + 71 => 'Short Whistle', + 72 => 'Long Whistle', + 73 => 'Short Guiro', + 74 => 'Long Guiro', + 75 => 'Claves', + 76 => 'Hi Wood Block', + 77 => 'Low Wood Block', + 78 => 'Mute Cuica', + 79 => 'Open Cuica', + 80 => 'Mute Triangle', + 81 => 'Open Triangle' + ); + + return @$lookup[$instrument_id]; + } + + +} + + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.monkey.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.monkey.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,216 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.monkey.php | +// | Module for analyzing Monkey's Audio files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.monkey.php,v 1.2 2006/11/02 10:48:01 ah Exp $ + + + +class getid3_monkey extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + // based loosely on code from TMonkey by Jurgen Faul + // http://jfaul.de/atl or http://j-faul.virtualave.net/atl/atl.html + + $getid3->info['fileformat'] = 'mac'; + $getid3->info['audio']['dataformat'] = 'mac'; + $getid3->info['audio']['bitrate_mode'] = 'vbr'; + $getid3->info['audio']['lossless'] = true; + + $getid3->info['monkeys_audio']['raw'] = array (); + $info_monkeys_audio = &$getid3->info['monkeys_audio']; + $info_monkeys_audio_raw = &$info_monkeys_audio['raw']; + + // Read file header + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $mac_header_data = fread($getid3->fp, 74); + + $info_monkeys_audio_raw['magic'] = 'MAC '; // Magic bytes + + // Read MAC version + $info_monkeys_audio_raw['nVersion'] = getid3_lib::LittleEndian2Int(substr($mac_header_data, 4, 2)); // appears to be uint32 in 3.98+ + + // Parse MAC Header < v3980 + if ($info_monkeys_audio_raw['nVersion'] < 3980) { + + getid3_lib::ReadSequence("LittleEndian2Int", $info_monkeys_audio_raw, $mac_header_data, 6, + array ( + 'nCompressionLevel' => 2, + 'nFormatFlags' => 2, + 'nChannels' => 2, + 'nSampleRate' => 4, + 'nHeaderDataBytes' => 4, + 'nWAVTerminatingBytes' => 4, + 'nTotalFrames' => 4, + 'nFinalFrameSamples' => 4, + 'nPeakLevel' => 4, + 'IGNORE-1' => 2, + 'nSeekElements' => 2 + ) + ); + } + + // Parse MAC Header >= v3980 + else { + + getid3_lib::ReadSequence("LittleEndian2Int", $info_monkeys_audio_raw, $mac_header_data, 8, + array ( + // APE_DESCRIPTOR + 'nDescriptorBytes' => 4, + 'nHeaderBytes' => 4, + 'nSeekTableBytes' => 4, + 'nHeaderDataBytes' => 4, + 'nAPEFrameDataBytes' => 4, + 'nAPEFrameDataBytesHigh'=> 4, + 'nTerminatingDataBytes' => 4, + + // MD5 - string + 'cFileMD5' => -16, + + // APE_HEADER + 'nCompressionLevel' => 2, + 'nFormatFlags' => 2, + 'nBlocksPerFrame' => 4, + 'nFinalFrameBlocks' => 4, + 'nTotalFrames' => 4, + 'nBitsPerSample' => 2, + 'nChannels' => 2, + 'nSampleRate' => 4 + ) + ); + } + + // Process data + $info_monkeys_audio['flags']['8-bit'] = (bool)($info_monkeys_audio_raw['nFormatFlags'] & 0x0001); + $info_monkeys_audio['flags']['crc-32'] = (bool)($info_monkeys_audio_raw['nFormatFlags'] & 0x0002); + $info_monkeys_audio['flags']['peak_level'] = (bool)($info_monkeys_audio_raw['nFormatFlags'] & 0x0004); + $info_monkeys_audio['flags']['24-bit'] = (bool)($info_monkeys_audio_raw['nFormatFlags'] & 0x0008); + $info_monkeys_audio['flags']['seek_elements'] = (bool)($info_monkeys_audio_raw['nFormatFlags'] & 0x0010); + $info_monkeys_audio['flags']['no_wav_header'] = (bool)($info_monkeys_audio_raw['nFormatFlags'] & 0x0020); + + $info_monkeys_audio['version'] = $info_monkeys_audio_raw['nVersion'] / 1000; + + $info_monkeys_audio['compression'] = getid3_monkey::MonkeyCompressionLevelNameLookup($info_monkeys_audio_raw['nCompressionLevel']); + + $info_monkeys_audio['bits_per_sample'] = ($info_monkeys_audio['flags']['24-bit'] ? 24 : ($info_monkeys_audio['flags']['8-bit'] ? 8 : 16)); + + $info_monkeys_audio['channels'] = $info_monkeys_audio_raw['nChannels']; + + $getid3->info['audio']['channels'] = $info_monkeys_audio['channels']; + + $info_monkeys_audio['sample_rate'] = $info_monkeys_audio_raw['nSampleRate']; + + $getid3->info['audio']['sample_rate'] = $info_monkeys_audio['sample_rate']; + + if ($info_monkeys_audio['flags']['peak_level']) { + $info_monkeys_audio['peak_level'] = $info_monkeys_audio_raw['nPeakLevel']; + $info_monkeys_audio['peak_ratio'] = $info_monkeys_audio['peak_level'] / pow(2, $info_monkeys_audio['bits_per_sample'] - 1); + } + + // MAC >= v3980 + if ($info_monkeys_audio_raw['nVersion'] >= 3980) { + $info_monkeys_audio['samples'] = (($info_monkeys_audio_raw['nTotalFrames'] - 1) * $info_monkeys_audio_raw['nBlocksPerFrame']) + $info_monkeys_audio_raw['nFinalFrameBlocks']; + } + + // MAC < v3980 + else { + $info_monkeys_audio['samples_per_frame'] = getid3_monkey::MonkeySamplesPerFrame($info_monkeys_audio_raw['nVersion'], $info_monkeys_audio_raw['nCompressionLevel']); + $info_monkeys_audio['samples'] = (($info_monkeys_audio_raw['nTotalFrames'] - 1) * $info_monkeys_audio['samples_per_frame']) + $info_monkeys_audio_raw['nFinalFrameSamples']; + } + + $info_monkeys_audio['playtime'] = $info_monkeys_audio['samples'] / $info_monkeys_audio['sample_rate']; + + $getid3->info['playtime_seconds'] = $info_monkeys_audio['playtime']; + + $info_monkeys_audio['compressed_size'] = $getid3->info['avdataend'] - $getid3->info['avdataoffset']; + $info_monkeys_audio['uncompressed_size'] = $info_monkeys_audio['samples'] * $info_monkeys_audio['channels'] * ($info_monkeys_audio['bits_per_sample'] / 8); + $info_monkeys_audio['compression_ratio'] = $info_monkeys_audio['compressed_size'] / ($info_monkeys_audio['uncompressed_size'] + $info_monkeys_audio_raw['nHeaderDataBytes']); + $info_monkeys_audio['bitrate'] = (($info_monkeys_audio['samples'] * $info_monkeys_audio['channels'] * $info_monkeys_audio['bits_per_sample']) / $info_monkeys_audio['playtime']) * $info_monkeys_audio['compression_ratio']; + + $getid3->info['audio']['bitrate'] = $info_monkeys_audio['bitrate']; + + $getid3->info['audio']['bits_per_sample'] = $info_monkeys_audio['bits_per_sample']; + $getid3->info['audio']['encoder'] = 'MAC v'.number_format($info_monkeys_audio['version'], 2); + $getid3->info['audio']['encoder_options'] = ucfirst($info_monkeys_audio['compression']).' compression'; + + // MAC >= v3980 - get avdataoffsets from MAC header + if ($info_monkeys_audio_raw['nVersion'] >= 3980) { + $getid3->info['avdataoffset'] += $info_monkeys_audio_raw['nDescriptorBytes'] + $info_monkeys_audio_raw['nHeaderBytes'] + $info_monkeys_audio_raw['nSeekTableBytes'] + $info_monkeys_audio_raw['nHeaderDataBytes']; + $getid3->info['avdataend'] -= $info_monkeys_audio_raw['nTerminatingDataBytes']; + } + + // MAC < v3980 Add size of MAC header to avdataoffset + else { + $getid3->info['avdataoffset'] += 8; + } + + // Convert md5sum to 32 byte string + if (@$info_monkeys_audio_raw['cFileMD5']) { + if ($info_monkeys_audio_raw['cFileMD5'] !== str_repeat("\x00", 16)) { + $getid3->info['md5_data_source'] = ''; + $md5 = $info_monkeys_audio_raw['cFileMD5']; + for ($i = 0; $i < strlen($md5); $i++) { + $getid3->info['md5_data_source'] .= str_pad(dechex(ord($md5{$i})), 2, '00', STR_PAD_LEFT); + } + if (!preg_match('/^[0-9a-f]{32}$/', $getid3->info['md5_data_source'])) { + unset($getid3->info['md5_data_source']); + } + } + } + + + return true; + } + + + + public static function MonkeyCompressionLevelNameLookup($compression_level) { + + static $lookup = array ( + 0 => 'unknown', + 1000 => 'fast', + 2000 => 'normal', + 3000 => 'high', + 4000 => 'extra-high', + 5000 => 'insane' + ); + return (isset($lookup[$compression_level]) ? $lookup[$compression_level] : 'invalid'); + } + + + + public static function MonkeySamplesPerFrame($version_id, $compression_level) { + + if ($version_id >= 3950) { + return 73728 * 4; + } + if (($version_id >= 3900) || (($version_id >= 3800) && ($compression_level == 4000))) { + return 73728; + } + return 9216; + } + +} + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.mp3.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.mp3.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,1696 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.mp3.php | +// | Module for analyzing MPEG Audio Layer 1,2,3 files. | +// | dependencies: none | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.mp3.php,v 1.10 2006/11/16 22:57:57 ah Exp $ + + + +class getid3_mp3 extends getid3_handler +{ + // Number of frames to scan to determine if MPEG-audio sequence is valid. + // Lower this number to 5-20 for faster scanning + // Increase this number to 50+ for most accurate detection of valid VBR/CBR mpeg-audio streams + const VALID_CHECK_FRAMES = 35; + + + public function Analyze() { + + $this->getAllMPEGInfo($this->getid3->fp, $this->getid3->info); + + return true; + } + + + public function AnalyzeMPEGaudioInfo() { + + $this->getOnlyMPEGaudioInfo($this->getid3->fp, $this->getid3->info, $this->getid3->info['avdataoffset'], false); + } + + + public function getAllMPEGInfo(&$fd, &$info) { + + $this->getOnlyMPEGaudioInfo($fd, $info, 0 + $info['avdataoffset']); + + if (isset($info['mpeg']['audio']['bitrate_mode'])) { + $info['audio']['bitrate_mode'] = strtolower($info['mpeg']['audio']['bitrate_mode']); + } + + if (((isset($info['id3v2']['headerlength']) && ($info['avdataoffset'] > $info['id3v2']['headerlength'])) || (!isset($info['id3v2']) && ($info['avdataoffset'] > 0)))) { + + $synch_offset_warning = 'Unknown data before synch '; + if (isset($info['id3v2']['headerlength'])) { + $synch_offset_warning .= '(ID3v2 header ends at '.$info['id3v2']['headerlength'].', then '.($info['avdataoffset'] - $info['id3v2']['headerlength']).' bytes garbage, '; + } else { + $synch_offset_warning .= '(should be at beginning of file, '; + } + $synch_offset_warning .= 'synch detected at '.$info['avdataoffset'].')'; + if ($info['audio']['bitrate_mode'] == 'cbr') { + + if (!empty($info['id3v2']['headerlength']) && (($info['avdataoffset'] - $info['id3v2']['headerlength']) == $info['mpeg']['audio']['framelength'])) { + + $synch_offset_warning .= '. This is a known problem with some versions of LAME (3.90-3.92) DLL in CBR mode.'; + $info['audio']['codec'] = 'LAME'; + $current_data_lame_version_string = 'LAME3.'; + + } elseif (empty($info['id3v2']['headerlength']) && ($info['avdataoffset'] == $info['mpeg']['audio']['framelength'])) { + + $synch_offset_warning .= '. This is a known problem with some versions of LAME (3.90 - 3.92) DLL in CBR mode.'; + $info['audio']['codec'] = 'LAME'; + $current_data_lame_version_string = 'LAME3.'; + + } + + } + $this->getid3->warning($synch_offset_warning); + + } + + if (isset($info['mpeg']['audio']['LAME'])) { + $info['audio']['codec'] = 'LAME'; + if (!empty($info['mpeg']['audio']['LAME']['long_version'])) { + $info['audio']['encoder'] = rtrim($info['mpeg']['audio']['LAME']['long_version'], "\x00"); + } elseif (!empty($info['mpeg']['audio']['LAME']['short_version'])) { + $info['audio']['encoder'] = rtrim($info['mpeg']['audio']['LAME']['short_version'], "\x00"); + } + } + + $current_data_lame_version_string = (!empty($current_data_lame_version_string) ? $current_data_lame_version_string : @$info['audio']['encoder']); + if (!empty($current_data_lame_version_string) && (substr($current_data_lame_version_string, 0, 6) == 'LAME3.') && !preg_match('[0-9\)]', substr($current_data_lame_version_string, -1))) { + // a version number of LAME that does not end with a number like "LAME3.92" + // or with a closing parenthesis like "LAME3.88 (alpha)" + // or a version of LAME with the LAMEtag-not-filled-in-DLL-mode bug (3.90-3.92) + + // not sure what the actual last frame length will be, but will be less than or equal to 1441 + $possibly_longer_lame_version_frame_length = 1441; + + // Not sure what version of LAME this is - look in padding of last frame for longer version string + $possible_lame_version_string_offset = $info['avdataend'] - $possibly_longer_lame_version_frame_length; + fseek($fd, $possible_lame_version_string_offset); + $possibly_longer_lame_version_data = fread($fd, $possibly_longer_lame_version_frame_length); + switch (substr($current_data_lame_version_string, -1)) { + case 'a': + case 'b': + // "LAME3.94a" will have a longer version string of "LAME3.94 (alpha)" for example + // need to trim off "a" to match longer string + $current_data_lame_version_string = substr($current_data_lame_version_string, 0, -1); + break; + } + if (($possibly_longer_lame_version_string = strstr($possibly_longer_lame_version_data, $current_data_lame_version_string)) !== false) { + if (substr($possibly_longer_lame_version_string, 0, strlen($current_data_lame_version_string)) == $current_data_lame_version_string) { + $possibly_longer_lame_version_new_string = substr($possibly_longer_lame_version_string, 0, strspn($possibly_longer_lame_version_string, 'LAME0123456789., (abcdefghijklmnopqrstuvwxyzJFSOND)')); //"LAME3.90.3" "LAME3.87 (beta 1, Sep 27 2000)" "LAME3.88 (beta)" + if (strlen($possibly_longer_lame_version_new_string) > strlen(@$info['audio']['encoder'])) { + $info['audio']['encoder'] = $possibly_longer_lame_version_new_string; + } + } + } + } + if (!empty($info['audio']['encoder'])) { + $info['audio']['encoder'] = rtrim($info['audio']['encoder'], "\x00 "); + } + + switch (@$info['mpeg']['audio']['layer']) { + case 1: + case 2: + $info['audio']['dataformat'] = 'mp'.$info['mpeg']['audio']['layer']; + break; + } + if (@$info['fileformat'] == 'mp3') { + switch ($info['audio']['dataformat']) { + case 'mp1': + case 'mp2': + case 'mp3': + $info['fileformat'] = $info['audio']['dataformat']; + break; + + default: + $this->getid3->warning('Expecting [audio][dataformat] to be mp1/mp2/mp3 when fileformat == mp3, [audio][dataformat] actually "'.$info['audio']['dataformat'].'"'); + break; + } + } + + $info['mime_type'] = 'audio/mpeg'; + $info['audio']['lossless'] = false; + + // Calculate playtime + if (!isset($info['playtime_seconds']) && isset($info['audio']['bitrate']) && ($info['audio']['bitrate'] > 0)) { + $info['playtime_seconds'] = ($info['avdataend'] - $info['avdataoffset']) * 8 / $info['audio']['bitrate']; + } + + $info['audio']['encoder_options'] = getid3_mp3::GuessEncoderOptions($info); + + return true; + } + + + + public static function GuessEncoderOptions(&$info) { + // shortcuts + if (!empty($info['mpeg']['audio'])) { + $thisfile_mpeg_audio = &$info['mpeg']['audio']; + if (!empty($thisfile_mpeg_audio['LAME'])) { + $thisfile_mpeg_audio_lame = &$thisfile_mpeg_audio['LAME']; + } + } + + $encoder_options = ''; + static $named_preset_bitrates = array (16, 24, 40, 56, 112, 128, 160, 192, 256); + + if ((@$thisfile_mpeg_audio['VBR_method'] == 'Fraunhofer') && !empty($thisfile_mpeg_audio['VBR_quality'])) { + + $encoder_options = 'VBR q'.$thisfile_mpeg_audio['VBR_quality']; + + } elseif (!empty($thisfile_mpeg_audio_lame['preset_used']) && (!in_array($thisfile_mpeg_audio_lame['preset_used_id'], $named_preset_bitrates))) { + + $encoder_options = $thisfile_mpeg_audio_lame['preset_used']; + + } elseif (!empty($thisfile_mpeg_audio_lame['vbr_quality'])) { + + static $known_encoder_values = array (); + if (empty($known_encoder_values)) { + + //$known_encoder_values[abrbitrate_minbitrate][vbr_quality][raw_vbr_method][raw_noise_shaping][raw_stereo_mode][ath_type][lowpass_frequency] = 'preset name'; + $known_encoder_values[0xFF][58][1][1][3][2][20500] = '--alt-preset insane'; // 3.90, 3.90.1, 3.92 + $known_encoder_values[0xFF][58][1][1][3][2][20600] = '--alt-preset insane'; // 3.90.2, 3.90.3, 3.91 + $known_encoder_values[0xFF][57][1][1][3][4][20500] = '--alt-preset insane'; // 3.94, 3.95 + $known_encoder_values['**'][78][3][2][3][2][19500] = '--alt-preset extreme'; // 3.90, 3.90.1, 3.92 + $known_encoder_values['**'][78][3][2][3][2][19600] = '--alt-preset extreme'; // 3.90.2, 3.91 + $known_encoder_values['**'][78][3][1][3][2][19600] = '--alt-preset extreme'; // 3.90.3 + $known_encoder_values['**'][78][4][2][3][2][19500] = '--alt-preset fast extreme'; // 3.90, 3.90.1, 3.92 + $known_encoder_values['**'][78][4][2][3][2][19600] = '--alt-preset fast extreme'; // 3.90.2, 3.90.3, 3.91 + $known_encoder_values['**'][78][3][2][3][4][19000] = '--alt-preset standard'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 + $known_encoder_values['**'][78][3][1][3][4][19000] = '--alt-preset standard'; // 3.90.3 + $known_encoder_values['**'][78][4][2][3][4][19000] = '--alt-preset fast standard'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 + $known_encoder_values['**'][78][4][1][3][4][19000] = '--alt-preset fast standard'; // 3.90.3 + $known_encoder_values['**'][88][4][1][3][3][19500] = '--r3mix'; // 3.90, 3.90.1, 3.92 + $known_encoder_values['**'][88][4][1][3][3][19600] = '--r3mix'; // 3.90.2, 3.90.3, 3.91 + $known_encoder_values['**'][67][4][1][3][4][18000] = '--r3mix'; // 3.94, 3.95 + $known_encoder_values['**'][68][3][2][3][4][18000] = '--alt-preset medium'; // 3.90.3 + $known_encoder_values['**'][68][4][2][3][4][18000] = '--alt-preset fast medium'; // 3.90.3 + + $known_encoder_values[0xFF][99][1][1][1][2][0] = '--preset studio'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 + $known_encoder_values[0xFF][58][2][1][3][2][20600] = '--preset studio'; // 3.90.3, 3.93.1 + $known_encoder_values[0xFF][58][2][1][3][2][20500] = '--preset studio'; // 3.93 + $known_encoder_values[0xFF][57][2][1][3][4][20500] = '--preset studio'; // 3.94, 3.95 + $known_encoder_values[0xC0][88][1][1][1][2][0] = '--preset cd'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 + $known_encoder_values[0xC0][58][2][2][3][2][19600] = '--preset cd'; // 3.90.3, 3.93.1 + $known_encoder_values[0xC0][58][2][2][3][2][19500] = '--preset cd'; // 3.93 + $known_encoder_values[0xC0][57][2][1][3][4][19500] = '--preset cd'; // 3.94, 3.95 + $known_encoder_values[0xA0][78][1][1][3][2][18000] = '--preset hifi'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 + $known_encoder_values[0xA0][58][2][2][3][2][18000] = '--preset hifi'; // 3.90.3, 3.93, 3.93.1 + $known_encoder_values[0xA0][57][2][1][3][4][18000] = '--preset hifi'; // 3.94, 3.95 + $known_encoder_values[0x80][67][1][1][3][2][18000] = '--preset tape'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 + $known_encoder_values[0x80][67][1][1][3][2][15000] = '--preset radio'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 + $known_encoder_values[0x70][67][1][1][3][2][15000] = '--preset fm'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 + $known_encoder_values[0x70][58][2][2][3][2][16000] = '--preset tape/radio/fm'; // 3.90.3, 3.93, 3.93.1 + $known_encoder_values[0x70][57][2][1][3][4][16000] = '--preset tape/radio/fm'; // 3.94, 3.95 + $known_encoder_values[0x38][58][2][2][0][2][10000] = '--preset voice'; // 3.90.3, 3.93, 3.93.1 + $known_encoder_values[0x38][57][2][1][0][4][15000] = '--preset voice'; // 3.94, 3.95 + $known_encoder_values[0x38][57][2][1][0][4][16000] = '--preset voice'; // 3.94a14 + $known_encoder_values[0x28][65][1][1][0][2][7500] = '--preset mw-us'; // 3.90, 3.90.1, 3.92 + $known_encoder_values[0x28][65][1][1][0][2][7600] = '--preset mw-us'; // 3.90.2, 3.91 + $known_encoder_values[0x28][58][2][2][0][2][7000] = '--preset mw-us'; // 3.90.3, 3.93, 3.93.1 + $known_encoder_values[0x28][57][2][1][0][4][10500] = '--preset mw-us'; // 3.94, 3.95 + $known_encoder_values[0x28][57][2][1][0][4][11200] = '--preset mw-us'; // 3.94a14 + $known_encoder_values[0x28][57][2][1][0][4][8800] = '--preset mw-us'; // 3.94a15 + $known_encoder_values[0x18][58][2][2][0][2][4000] = '--preset phon+/lw/mw-eu/sw'; // 3.90.3, 3.93.1 + $known_encoder_values[0x18][58][2][2][0][2][3900] = '--preset phon+/lw/mw-eu/sw'; // 3.93 + $known_encoder_values[0x18][57][2][1][0][4][5900] = '--preset phon+/lw/mw-eu/sw'; // 3.94, 3.95 + $known_encoder_values[0x18][57][2][1][0][4][6200] = '--preset phon+/lw/mw-eu/sw'; // 3.94a14 + $known_encoder_values[0x18][57][2][1][0][4][3200] = '--preset phon+/lw/mw-eu/sw'; // 3.94a15 + $known_encoder_values[0x10][58][2][2][0][2][3800] = '--preset phone'; // 3.90.3, 3.93.1 + $known_encoder_values[0x10][58][2][2][0][2][3700] = '--preset phone'; // 3.93 + $known_encoder_values[0x10][57][2][1][0][4][5600] = '--preset phone'; // 3.94, 3.95 + } + + if (isset($known_encoder_values[$thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate']][$thisfile_mpeg_audio_lame['vbr_quality']][$thisfile_mpeg_audio_lame['raw']['vbr_method']][$thisfile_mpeg_audio_lame['raw']['noise_shaping']][$thisfile_mpeg_audio_lame['raw']['stereo_mode']][$thisfile_mpeg_audio_lame['ath_type']][$thisfile_mpeg_audio_lame['lowpass_frequency']])) { + + $encoder_options = $known_encoder_values[$thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate']][$thisfile_mpeg_audio_lame['vbr_quality']][$thisfile_mpeg_audio_lame['raw']['vbr_method']][$thisfile_mpeg_audio_lame['raw']['noise_shaping']][$thisfile_mpeg_audio_lame['raw']['stereo_mode']][$thisfile_mpeg_audio_lame['ath_type']][$thisfile_mpeg_audio_lame['lowpass_frequency']]; + + } elseif (isset($known_encoder_values['**'][$thisfile_mpeg_audio_lame['vbr_quality']][$thisfile_mpeg_audio_lame['raw']['vbr_method']][$thisfile_mpeg_audio_lame['raw']['noise_shaping']][$thisfile_mpeg_audio_lame['raw']['stereo_mode']][$thisfile_mpeg_audio_lame['ath_type']][$thisfile_mpeg_audio_lame['lowpass_frequency']])) { + + $encoder_options = $known_encoder_values['**'][$thisfile_mpeg_audio_lame['vbr_quality']][$thisfile_mpeg_audio_lame['raw']['vbr_method']][$thisfile_mpeg_audio_lame['raw']['noise_shaping']][$thisfile_mpeg_audio_lame['raw']['stereo_mode']][$thisfile_mpeg_audio_lame['ath_type']][$thisfile_mpeg_audio_lame['lowpass_frequency']]; + + } elseif ($info['audio']['bitrate_mode'] == 'vbr') { + + // http://gabriel.mp3-tech.org/mp3infotag.html + // int Quality = (100 - 10 * gfp->VBR_q - gfp->quality)h + + + $lame_v_value = 10 - ceil($thisfile_mpeg_audio_lame['vbr_quality'] / 10); + $lame_q_value = 100 - $thisfile_mpeg_audio_lame['vbr_quality'] - ($lame_v_value * 10); + $encoder_options = '-V'.$lame_v_value.' -q'.$lame_q_value; + + } elseif ($info['audio']['bitrate_mode'] == 'cbr') { + + $encoder_options = strtoupper($info['audio']['bitrate_mode']).ceil($info['audio']['bitrate'] / 1000); + + } else { + + $encoder_options = strtoupper($info['audio']['bitrate_mode']); + + } + + } elseif (!empty($thisfile_mpeg_audio_lame['bitrate_abr'])) { + + $encoder_options = 'ABR'.$thisfile_mpeg_audio_lame['bitrate_abr']; + + } elseif (!empty($info['audio']['bitrate'])) { + + if ($info['audio']['bitrate_mode'] == 'cbr') { + $encoder_options = strtoupper($info['audio']['bitrate_mode']).ceil($info['audio']['bitrate'] / 1000); + } else { + $encoder_options = strtoupper($info['audio']['bitrate_mode']); + } + + } + if (!empty($thisfile_mpeg_audio_lame['bitrate_min'])) { + $encoder_options .= ' -b'.$thisfile_mpeg_audio_lame['bitrate_min']; + } + + if (@$thisfile_mpeg_audio_lame['encoding_flags']['nogap_prev'] || @$thisfile_mpeg_audio_lame['encoding_flags']['nogap_next']) { + $encoder_options .= ' --nogap'; + } + + if (!empty($thisfile_mpeg_audio_lame['lowpass_frequency'])) { + $exploded_options = explode(' ', $encoder_options, 4); + if ($exploded_options[0] == '--r3mix') { + $exploded_options[1] = 'r3mix'; + } + switch ($exploded_options[0]) { + case '--preset': + case '--alt-preset': + case '--r3mix': + if ($exploded_options[1] == 'fast') { + $exploded_options[1] .= ' '.$exploded_options[2]; + } + switch ($exploded_options[1]) { + case 'portable': + case 'medium': + case 'standard': + case 'extreme': + case 'insane': + case 'fast portable': + case 'fast medium': + case 'fast standard': + case 'fast extreme': + case 'fast insane': + case 'r3mix': + static $expected_lowpass = array ( + 'insane|20500' => 20500, + 'insane|20600' => 20600, // 3.90.2, 3.90.3, 3.91 + 'medium|18000' => 18000, + 'fast medium|18000' => 18000, + 'extreme|19500' => 19500, // 3.90, 3.90.1, 3.92, 3.95 + 'extreme|19600' => 19600, // 3.90.2, 3.90.3, 3.91, 3.93.1 + 'fast extreme|19500' => 19500, // 3.90, 3.90.1, 3.92, 3.95 + 'fast extreme|19600' => 19600, // 3.90.2, 3.90.3, 3.91, 3.93.1 + 'standard|19000' => 19000, + 'fast standard|19000' => 19000, + 'r3mix|19500' => 19500, // 3.90, 3.90.1, 3.92 + 'r3mix|19600' => 19600, // 3.90.2, 3.90.3, 3.91 + 'r3mix|18000' => 18000, // 3.94, 3.95 + ); + if (!isset($expected_lowpass[$exploded_options[1].'|'.$thisfile_mpeg_audio_lame['lowpass_frequency']]) && ($thisfile_mpeg_audio_lame['lowpass_frequency'] < 22050) && (round($thisfile_mpeg_audio_lame['lowpass_frequency'] / 1000) < round($thisfile_mpeg_audio['sample_rate'] / 2000))) { + $encoder_options .= ' --lowpass '.$thisfile_mpeg_audio_lame['lowpass_frequency']; + } + break; + + default: + break; + } + break; + } + } + + if (isset($thisfile_mpeg_audio_lame['raw']['source_sample_freq'])) { + if (($thisfile_mpeg_audio['sample_rate'] == 44100) && ($thisfile_mpeg_audio_lame['raw']['source_sample_freq'] != 1)) { + $encoder_options .= ' --resample 44100'; + } elseif (($thisfile_mpeg_audio['sample_rate'] == 48000) && ($thisfile_mpeg_audio_lame['raw']['source_sample_freq'] != 2)) { + $encoder_options .= ' --resample 48000'; + } elseif ($thisfile_mpeg_audio['sample_rate'] < 44100) { + switch ($thisfile_mpeg_audio_lame['raw']['source_sample_freq']) { + case 0: // <= 32000 + // may or may not be same as source frequency - ignore + break; + case 1: // 44100 + case 2: // 48000 + case 3: // 48000+ + $exploded_options = explode(' ', $encoder_options, 4); + switch ($exploded_options[0]) { + case '--preset': + case '--alt-preset': + switch ($exploded_options[1]) { + case 'fast': + case 'portable': + case 'medium': + case 'standard': + case 'extreme': + case 'insane': + $encoder_options .= ' --resample '.$thisfile_mpeg_audio['sample_rate']; + break; + + default: + static $expected_resampled_rate = array ( + 'phon+/lw/mw-eu/sw|16000' => 16000, + 'mw-us|24000' => 24000, // 3.95 + 'mw-us|32000' => 32000, // 3.93 + 'mw-us|16000' => 16000, // 3.92 + 'phone|16000' => 16000, + 'phone|11025' => 11025, // 3.94a15 + 'radio|32000' => 32000, // 3.94a15 + 'fm/radio|32000' => 32000, // 3.92 + 'fm|32000' => 32000, // 3.90 + 'voice|32000' => 32000); + if (!isset($expected_resampled_rate[$exploded_options[1].'|'.$thisfile_mpeg_audio['sample_rate']])) { + $encoder_options .= ' --resample '.$thisfile_mpeg_audio['sample_rate']; + } + break; + } + break; + + case '--r3mix': + default: + $encoder_options .= ' --resample '.$thisfile_mpeg_audio['sample_rate']; + break; + } + break; + } + } + } + if (empty($encoder_options) && !empty($info['audio']['bitrate']) && !empty($info['audio']['bitrate_mode'])) { + //$encoder_options = strtoupper($info['audio']['bitrate_mode']).ceil($info['audio']['bitrate'] / 1000); + $encoder_options = strtoupper($info['audio']['bitrate_mode']); + } + + return $encoder_options; + } + + + + public function decodeMPEGaudioHeader($fd, $offset, &$info, $recursive_search=true, $scan_as_cbr=false, $fast_mpeg_header_scan=false) { + + static $mpeg_audio_version_lookup; + static $mpeg_audio_layer_lookup; + static $mpeg_audio_bitrate_lookup; + static $mpeg_audio_frequency_lookup; + static $mpeg_audio_channel_mode_lookup; + static $mpeg_audio_mode_extension_lookup; + static $mpeg_audio_emphasis_lookup; + if (empty($mpeg_audio_version_lookup)) { + $mpeg_audio_version_lookup = getid3_mp3::MPEGaudioVersionarray(); + $mpeg_audio_layer_lookup = getid3_mp3::MPEGaudioLayerarray(); + $mpeg_audio_bitrate_lookup = getid3_mp3::MPEGaudioBitratearray(); + $mpeg_audio_frequency_lookup = getid3_mp3::MPEGaudioFrequencyarray(); + $mpeg_audio_channel_mode_lookup = getid3_mp3::MPEGaudioChannelModearray(); + $mpeg_audio_mode_extension_lookup = getid3_mp3::MPEGaudioModeExtensionarray(); + $mpeg_audio_emphasis_lookup = getid3_mp3::MPEGaudioEmphasisarray(); + } + + if ($offset >= $info['avdataend']) { + + // non-fatal error: 'end of file encounter looking for MPEG synch' + return; + + } + fseek($fd, $offset, SEEK_SET); + $header_string = fread($fd, 226); // LAME header at offset 36 + 190 bytes of Xing/LAME data + + // MP3 audio frame structure: + // $aa $aa $aa $aa [$bb $bb] $cc... + // where $aa..$aa is the four-byte mpeg-audio header (below) + // $bb $bb is the optional 2-byte CRC + // and $cc... is the audio data + + $head4 = substr($header_string, 0, 4); + + if (isset($mpeg_audio_header_decode_cache[$head4])) { + $mpeg_header_raw_array= $mpeg_audio_header_decode_cache[$head4]; + } else { + $mpeg_header_raw_array = getid3_mp3::MPEGaudioHeaderDecode($head4); + $mpeg_audio_header_decode_cache[$head4] = $mpeg_header_raw_array; + } + + // Not in cache + if (!isset($mpeg_audio_header_valid_cache[$head4])) { + $mpeg_audio_header_valid_cache[$head4] = getid3_mp3::MPEGaudioHeaderValid($mpeg_header_raw_array, false, false); + } + + // shortcut + if (!isset($info['mpeg']['audio'])) { + $info['mpeg']['audio'] = array (); + } + $thisfile_mpeg_audio = &$info['mpeg']['audio']; + + + if ($mpeg_audio_header_valid_cache[$head4]) { + $thisfile_mpeg_audio['raw'] = $mpeg_header_raw_array; + } else { + + // non-fatal error: Invalid MPEG audio header at offset $offset + return; + } + + if (!$fast_mpeg_header_scan) { + + $thisfile_mpeg_audio['version'] = $mpeg_audio_version_lookup[$thisfile_mpeg_audio['raw']['version']]; + $thisfile_mpeg_audio['layer'] = $mpeg_audio_layer_lookup[$thisfile_mpeg_audio['raw']['layer']]; + + $thisfile_mpeg_audio['channelmode'] = $mpeg_audio_channel_mode_lookup[$thisfile_mpeg_audio['raw']['channelmode']]; + $thisfile_mpeg_audio['channels'] = (($thisfile_mpeg_audio['channelmode'] == 'mono') ? 1 : 2); + $thisfile_mpeg_audio['sample_rate'] = $mpeg_audio_frequency_lookup[$thisfile_mpeg_audio['version']][$thisfile_mpeg_audio['raw']['sample_rate']]; + $thisfile_mpeg_audio['protection'] = !$thisfile_mpeg_audio['raw']['protection']; + $thisfile_mpeg_audio['private'] = (bool) $thisfile_mpeg_audio['raw']['private']; + $thisfile_mpeg_audio['modeextension'] = $mpeg_audio_mode_extension_lookup[$thisfile_mpeg_audio['layer']][$thisfile_mpeg_audio['raw']['modeextension']]; + $thisfile_mpeg_audio['copyright'] = (bool) $thisfile_mpeg_audio['raw']['copyright']; + $thisfile_mpeg_audio['original'] = (bool) $thisfile_mpeg_audio['raw']['original']; + $thisfile_mpeg_audio['emphasis'] = $mpeg_audio_emphasis_lookup[$thisfile_mpeg_audio['raw']['emphasis']]; + + $info['audio']['channels'] = $thisfile_mpeg_audio['channels']; + $info['audio']['sample_rate'] = $thisfile_mpeg_audio['sample_rate']; + + if ($thisfile_mpeg_audio['protection']) { + $thisfile_mpeg_audio['crc'] = getid3_lib::BigEndian2Int(substr($header_string, 4, 2)); + } + + } + + if ($thisfile_mpeg_audio['raw']['bitrate'] == 15) { + // http://www.hydrogenaudio.org/?act=ST&f=16&t=9682&st=0 + $this->getid3->warning('Invalid bitrate index (15), this is a known bug in free-format MP3s encoded by LAME v3.90 - 3.93.1'); + $thisfile_mpeg_audio['raw']['bitrate'] = 0; + } + $thisfile_mpeg_audio['padding'] = (bool) $thisfile_mpeg_audio['raw']['padding']; + $thisfile_mpeg_audio['bitrate'] = $mpeg_audio_bitrate_lookup[$thisfile_mpeg_audio['version']][$thisfile_mpeg_audio['layer']][$thisfile_mpeg_audio['raw']['bitrate']]; + + if (($thisfile_mpeg_audio['bitrate'] == 'free') && ($offset == $info['avdataoffset'])) { + // only skip multiple frame check if free-format bitstream found at beginning of file + // otherwise is quite possibly simply corrupted data + $recursive_search = false; + } + + // For Layer 2 there are some combinations of bitrate and mode which are not allowed. + if (!$fast_mpeg_header_scan && ($thisfile_mpeg_audio['layer'] == '2')) { + + $info['audio']['dataformat'] = 'mp2'; + switch ($thisfile_mpeg_audio['channelmode']) { + + case 'mono': + if (($thisfile_mpeg_audio['bitrate'] == 'free') || ($thisfile_mpeg_audio['bitrate'] <= 192000)) { + // these are ok + } else { + + // non-fatal error: bitrate not allowed in Layer 2/mono + return; + } + break; + + case 'stereo': + case 'joint stereo': + case 'dual channel': + if (($thisfile_mpeg_audio['bitrate'] == 'free') || ($thisfile_mpeg_audio['bitrate'] == 64000) || ($thisfile_mpeg_audio['bitrate'] >= 96000)) { + // these are ok + } else { + + // non-fatal error: bitrate not allowed in Layer 2/stereo/joint stereo/dual channel + return; + } + break; + + } + + } + + + if ($info['audio']['sample_rate'] > 0) { + $thisfile_mpeg_audio['framelength'] = getid3_mp3::MPEGaudioFrameLength($thisfile_mpeg_audio['bitrate'], $thisfile_mpeg_audio['version'], $thisfile_mpeg_audio['layer'], (int) $thisfile_mpeg_audio['padding'], $info['audio']['sample_rate']); + } + + $next_frame_test_offset = $offset + 1; + if ($thisfile_mpeg_audio['bitrate'] != 'free') { + + $info['audio']['bitrate'] = $thisfile_mpeg_audio['bitrate']; + + if (isset($thisfile_mpeg_audio['framelength'])) { + $next_frame_test_offset = $offset + $thisfile_mpeg_audio['framelength']; + } else { + + // non-fatal error: Frame at offset('.$offset.') is has an invalid frame length. + return; + } + + } + + $expected_number_of_audio_bytes = 0; + + //////////////////////////////////////////////////////////////////////////////////// + // Variable-bitrate headers + + if (substr($header_string, 4 + 32, 4) == 'VBRI') { + // Fraunhofer VBR header is hardcoded 'VBRI' at offset 0x24 (36) + // specs taken from http://minnie.tuhs.org/pipermail/mp3encoder/2001-January/001800.html + + $thisfile_mpeg_audio['bitrate_mode'] = 'vbr'; + $thisfile_mpeg_audio['VBR_method'] = 'Fraunhofer'; + $info['audio']['codec'] = 'Fraunhofer'; + + $side_info_data = substr($header_string, 4 + 2, 32); + + $fraunhofer_vbr_offset = 36; + + $thisfile_mpeg_audio['VBR_encoder_version'] = getid3_lib::BigEndian2Int(substr($header_string, $fraunhofer_vbr_offset + 4, 2)); // VbriVersion + $thisfile_mpeg_audio['VBR_encoder_delay'] = getid3_lib::BigEndian2Int(substr($header_string, $fraunhofer_vbr_offset + 6, 2)); // VbriDelay + $thisfile_mpeg_audio['VBR_quality'] = getid3_lib::BigEndian2Int(substr($header_string, $fraunhofer_vbr_offset + 8, 2)); // VbriQuality + $thisfile_mpeg_audio['VBR_bytes'] = getid3_lib::BigEndian2Int(substr($header_string, $fraunhofer_vbr_offset + 10, 4)); // VbriStreamBytes + $thisfile_mpeg_audio['VBR_frames'] = getid3_lib::BigEndian2Int(substr($header_string, $fraunhofer_vbr_offset + 14, 4)); // VbriStreamFrames + $thisfile_mpeg_audio['VBR_seek_offsets'] = getid3_lib::BigEndian2Int(substr($header_string, $fraunhofer_vbr_offset + 18, 2)); // VbriTableSize + $thisfile_mpeg_audio['VBR_seek_scale'] = getid3_lib::BigEndian2Int(substr($header_string, $fraunhofer_vbr_offset + 20, 2)); // VbriTableScale + $thisfile_mpeg_audio['VBR_entry_bytes'] = getid3_lib::BigEndian2Int(substr($header_string, $fraunhofer_vbr_offset + 22, 2)); // VbriEntryBytes + $thisfile_mpeg_audio['VBR_entry_frames'] = getid3_lib::BigEndian2Int(substr($header_string, $fraunhofer_vbr_offset + 24, 2)); // VbriEntryFrames + + $expected_number_of_audio_bytes = $thisfile_mpeg_audio['VBR_bytes']; + + $previous_byte_offset = $offset; + for ($i = 0; $i < $thisfile_mpeg_audio['VBR_seek_offsets']; $i++) { + $fraunhofer_offset_n = getid3_lib::BigEndian2Int(substr($header_string, $fraunhofer_vbr_offset, $thisfile_mpeg_audio['VBR_entry_bytes'])); + $fraunhofer_vbr_offset += $thisfile_mpeg_audio['VBR_entry_bytes']; + $thisfile_mpeg_audio['VBR_offsets_relative'][$i] = ($fraunhofer_offset_n * $thisfile_mpeg_audio['VBR_seek_scale']); + $thisfile_mpeg_audio['VBR_offsets_absolute'][$i] = ($fraunhofer_offset_n * $thisfile_mpeg_audio['VBR_seek_scale']) + $previous_byte_offset; + $previous_byte_offset += $fraunhofer_offset_n; + } + + + } else { + + // Xing VBR header is hardcoded 'Xing' at a offset 0x0D (13), 0x15 (21) or 0x24 (36) + // depending on MPEG layer and number of channels + + $vbr_id_offset = getid3_mp3::XingVBRidOffset($thisfile_mpeg_audio['version'], $thisfile_mpeg_audio['channelmode']); + $side_info_data = substr($header_string, 4 + 2, $vbr_id_offset - 4); + + if ((substr($header_string, $vbr_id_offset, strlen('Xing')) == 'Xing') || (substr($header_string, $vbr_id_offset, strlen('Info')) == 'Info')) { + // 'Xing' is traditional Xing VBR frame + // 'Info' is LAME-encoded CBR (This was done to avoid CBR files to be recognized as traditional Xing VBR files by some decoders.) + // 'Info' *can* legally be used to specify a VBR file as well, however. + + // http://www.multiweb.cz/twoinches/MP3inside.htm + //00..03 = "Xing" or "Info" + //04..07 = Flags: + // 0x01 Frames Flag set if value for number of frames in file is stored + // 0x02 Bytes Flag set if value for filesize in bytes is stored + // 0x04 TOC Flag set if values for TOC are stored + // 0x08 VBR Scale Flag set if values for VBR scale is stored + //08..11 Frames: Number of frames in file (including the first Xing/Info one) + //12..15 Bytes: File length in Bytes + //16..115 TOC (Table of Contents): + // Contains of 100 indexes (one Byte length) for easier lookup in file. Approximately solves problem with moving inside file. + // Each Byte has a value according this formula: + // (TOC[i] / 256) * fileLenInBytes + // So if song lasts eg. 240 sec. and you want to jump to 60. sec. (and file is 5 000 000 Bytes length) you can use: + // TOC[(60/240)*100] = TOC[25] + // and corresponding Byte in file is then approximately at: + // (TOC[25]/256) * 5000000 + //116..119 VBR Scale + + + // should be safe to leave this at 'vbr' and let it be overriden to 'cbr' if a CBR preset/mode is used by LAME + $thisfile_mpeg_audio['bitrate_mode'] = 'vbr'; + $thisfile_mpeg_audio['VBR_method'] = 'Xing'; + + $thisfile_mpeg_audio['xing_flags_raw'] = getid3_lib::BigEndian2Int(substr($header_string, $vbr_id_offset + 4, 4)); + + $thisfile_mpeg_audio['xing_flags']['frames'] = (bool) ($thisfile_mpeg_audio['xing_flags_raw'] & 0x00000001); + $thisfile_mpeg_audio['xing_flags']['bytes'] = (bool) ($thisfile_mpeg_audio['xing_flags_raw'] & 0x00000002); + $thisfile_mpeg_audio['xing_flags']['toc'] = (bool) ($thisfile_mpeg_audio['xing_flags_raw'] & 0x00000004); + $thisfile_mpeg_audio['xing_flags']['vbr_scale'] = (bool) ($thisfile_mpeg_audio['xing_flags_raw'] & 0x00000008); + + if ($thisfile_mpeg_audio['xing_flags']['frames']) { + $thisfile_mpeg_audio['VBR_frames'] = getid3_lib::BigEndian2Int(substr($header_string, $vbr_id_offset + 8, 4)); + } + if ($thisfile_mpeg_audio['xing_flags']['bytes']) { + $thisfile_mpeg_audio['VBR_bytes'] = getid3_lib::BigEndian2Int(substr($header_string, $vbr_id_offset + 12, 4)); + } + + if (!empty($thisfile_mpeg_audio['VBR_frames']) && !empty($thisfile_mpeg_audio['VBR_bytes'])) { + + $frame_lengthfloat = $thisfile_mpeg_audio['VBR_bytes'] / $thisfile_mpeg_audio['VBR_frames']; + + if ($thisfile_mpeg_audio['layer'] == '1') { + // BitRate = (((FrameLengthInBytes / 4) - Padding) * SampleRate) / 12 + $info['audio']['bitrate'] = ($frame_lengthfloat / 4) * $thisfile_mpeg_audio['sample_rate'] * (2 / $info['audio']['channels']) / 12; + } else { + // Bitrate = ((FrameLengthInBytes - Padding) * SampleRate) / 144 + $info['audio']['bitrate'] = $frame_lengthfloat * $thisfile_mpeg_audio['sample_rate'] * (2 / $info['audio']['channels']) / 144; + } + $thisfile_mpeg_audio['framelength'] = floor($frame_lengthfloat); + } + + if ($thisfile_mpeg_audio['xing_flags']['toc']) { + $lame_toc_data = substr($header_string, $vbr_id_offset + 16, 100); + for ($i = 0; $i < 100; $i++) { + $thisfile_mpeg_audio['toc'][$i] = ord($lame_toc_data{$i}); + } + } + if ($thisfile_mpeg_audio['xing_flags']['vbr_scale']) { + $thisfile_mpeg_audio['VBR_scale'] = getid3_lib::BigEndian2Int(substr($header_string, $vbr_id_offset + 116, 4)); + } + + + // http://gabriel.mp3-tech.org/mp3infotag.html + if (substr($header_string, $vbr_id_offset + 120, 4) == 'LAME') { + + // shortcut + $thisfile_mpeg_audio['LAME'] = array (); + $thisfile_mpeg_audio_lame = &$thisfile_mpeg_audio['LAME']; + + + $thisfile_mpeg_audio_lame['long_version'] = substr($header_string, $vbr_id_offset + 120, 20); + $thisfile_mpeg_audio_lame['short_version'] = substr($thisfile_mpeg_audio_lame['long_version'], 0, 9); + + if ($thisfile_mpeg_audio_lame['short_version'] >= 'LAME3.90') { + + // extra 11 chars are not part of version string when LAMEtag present + unset($thisfile_mpeg_audio_lame['long_version']); + + // It the LAME tag was only introduced in LAME v3.90 + // http://www.hydrogenaudio.org/?act=ST&f=15&t=9933 + + // Offsets of various bytes in http://gabriel.mp3-tech.org/mp3infotag.html + // are assuming a 'Xing' identifier offset of 0x24, which is the case for + // MPEG-1 non-mono, but not for other combinations + $lame_tag_offset_contant = $vbr_id_offset - 0x24; + + // shortcuts + $thisfile_mpeg_audio_lame['RGAD'] = array ('track'=>array(), 'album'=>array()); + $thisfile_mpeg_audio_lame_rgad = &$thisfile_mpeg_audio_lame['RGAD']; + $thisfile_mpeg_audio_lame_rgad_track = &$thisfile_mpeg_audio_lame_rgad['track']; + $thisfile_mpeg_audio_lame_rgad_album = &$thisfile_mpeg_audio_lame_rgad['album']; + $thisfile_mpeg_audio_lame['raw'] = array (); + $thisfile_mpeg_audio_lame_raw = &$thisfile_mpeg_audio_lame['raw']; + + // byte $9B VBR Quality + // This field is there to indicate a quality level, although the scale was not precised in the original Xing specifications. + // Actually overwrites original Xing bytes + unset($thisfile_mpeg_audio['VBR_scale']); + $thisfile_mpeg_audio_lame['vbr_quality'] = getid3_lib::BigEndian2Int(substr($header_string, $lame_tag_offset_contant + 0x9B, 1)); + + // bytes $9C-$A4 Encoder short VersionString + $thisfile_mpeg_audio_lame['short_version'] = substr($header_string, $lame_tag_offset_contant + 0x9C, 9); + + // byte $A5 Info Tag revision + VBR method + $lame_tagRevisionVBRmethod = getid3_lib::BigEndian2Int(substr($header_string, $lame_tag_offset_contant + 0xA5, 1)); + + $thisfile_mpeg_audio_lame['tag_revision'] = ($lame_tagRevisionVBRmethod & 0xF0) >> 4; + $thisfile_mpeg_audio_lame_raw['vbr_method'] = $lame_tagRevisionVBRmethod & 0x0F; + $thisfile_mpeg_audio_lame['vbr_method'] = getid3_mp3::LAMEvbrMethodLookup($thisfile_mpeg_audio_lame_raw['vbr_method']); + $thisfile_mpeg_audio['bitrate_mode'] = substr($thisfile_mpeg_audio_lame['vbr_method'], 0, 3); // usually either 'cbr' or 'vbr', but truncates 'vbr-old / vbr-rh' to 'vbr' + + // byte $A6 Lowpass filter value + $thisfile_mpeg_audio_lame['lowpass_frequency'] = getid3_lib::BigEndian2Int(substr($header_string, $lame_tag_offset_contant + 0xA6, 1)) * 100; + + // bytes $A7-$AE Replay Gain + // http://privatewww.essex.ac.uk/~djmrob/replaygain/rg_data_format.html + // bytes $A7-$AA : 32 bit floating point "Peak signal amplitude" + if ($thisfile_mpeg_audio_lame['short_version'] >= 'LAME3.94b') { + // LAME 3.94a16 and later - 9.23 fixed point + // ie 0x0059E2EE / (2^23) = 5890798 / 8388608 = 0.7022378444671630859375 + $thisfile_mpeg_audio_lame_rgad['peak_amplitude'] = (float) ((getid3_lib::BigEndian2Int(substr($header_string, $lame_tag_offset_contant + 0xA7, 4))) / 8388608); + } else { + // LAME 3.94a15 and earlier - 32-bit floating point + // Actually 3.94a16 will fall in here too and be WRONG, but is hard to detect 3.94a16 vs 3.94a15 + $thisfile_mpeg_audio_lame_rgad['peak_amplitude'] = getid3_lib::LittleEndian2Float(substr($header_string, $lame_tag_offset_contant + 0xA7, 4)); + } + if ($thisfile_mpeg_audio_lame_rgad['peak_amplitude'] == 0) { + unset($thisfile_mpeg_audio_lame_rgad['peak_amplitude']); + } else { + $thisfile_mpeg_audio_lame_rgad['peak_db'] = 20 * log10($thisfile_mpeg_audio_lame_rgad['peak_amplitude']); + } + + $thisfile_mpeg_audio_lame_raw['RGAD_track'] = getid3_lib::BigEndian2Int(substr($header_string, $lame_tag_offset_contant + 0xAB, 2)); + $thisfile_mpeg_audio_lame_raw['RGAD_album'] = getid3_lib::BigEndian2Int(substr($header_string, $lame_tag_offset_contant + 0xAD, 2)); + + + if ($thisfile_mpeg_audio_lame_raw['RGAD_track'] != 0) { + + $thisfile_mpeg_audio_lame_rgad_track['raw']['name'] = ($thisfile_mpeg_audio_lame_raw['RGAD_track'] & 0xE000) >> 13; + $thisfile_mpeg_audio_lame_rgad_track['raw']['originator'] = ($thisfile_mpeg_audio_lame_raw['RGAD_track'] & 0x1C00) >> 10; + $thisfile_mpeg_audio_lame_rgad_track['raw']['sign_bit'] = ($thisfile_mpeg_audio_lame_raw['RGAD_track'] & 0x0200) >> 9; + $thisfile_mpeg_audio_lame_rgad_track['raw']['gain_adjust'] = $thisfile_mpeg_audio_lame_raw['RGAD_track'] & 0x01FF; + $thisfile_mpeg_audio_lame_rgad_track['name'] = getid3_lib_replaygain::NameLookup($thisfile_mpeg_audio_lame_rgad_track['raw']['name']); + $thisfile_mpeg_audio_lame_rgad_track['originator'] = getid3_lib_replaygain::OriginatorLookup($thisfile_mpeg_audio_lame_rgad_track['raw']['originator']); + $thisfile_mpeg_audio_lame_rgad_track['gain_db'] = getid3_lib_replaygain::AdjustmentLookup($thisfile_mpeg_audio_lame_rgad_track['raw']['gain_adjust'], $thisfile_mpeg_audio_lame_rgad_track['raw']['sign_bit']); + + if (!empty($thisfile_mpeg_audio_lame_rgad['peak_amplitude'])) { + $info['replay_gain']['track']['peak'] = $thisfile_mpeg_audio_lame_rgad['peak_amplitude']; + } + $info['replay_gain']['track']['originator'] = $thisfile_mpeg_audio_lame_rgad_track['originator']; + $info['replay_gain']['track']['adjustment'] = $thisfile_mpeg_audio_lame_rgad_track['gain_db']; + } else { + unset($thisfile_mpeg_audio_lame_rgad['track']); + } + if ($thisfile_mpeg_audio_lame_raw['RGAD_album'] != 0) { + + $thisfile_mpeg_audio_lame_rgad_album['raw']['name'] = ($thisfile_mpeg_audio_lame_raw['RGAD_album'] & 0xE000) >> 13; + $thisfile_mpeg_audio_lame_rgad_album['raw']['originator'] = ($thisfile_mpeg_audio_lame_raw['RGAD_album'] & 0x1C00) >> 10; + $thisfile_mpeg_audio_lame_rgad_album['raw']['sign_bit'] = ($thisfile_mpeg_audio_lame_raw['RGAD_album'] & 0x0200) >> 9; + $thisfile_mpeg_audio_lame_rgad_album['raw']['gain_adjust'] = $thisfile_mpeg_audio_lame_raw['RGAD_album'] & 0x01FF; + $thisfile_mpeg_audio_lame_rgad_album['name'] = getid3_lib_replaygain::NameLookup($thisfile_mpeg_audio_lame_rgad_album['raw']['name']); + $thisfile_mpeg_audio_lame_rgad_album['originator'] = getid3_lib_replaygain::OriginatorLookup($thisfile_mpeg_audio_lame_rgad_album['raw']['originator']); + $thisfile_mpeg_audio_lame_rgad_album['gain_db'] = getid3_lib_replaygain::AdjustmentLookup($thisfile_mpeg_audio_lame_rgad_album['raw']['gain_adjust'], $thisfile_mpeg_audio_lame_rgad_album['raw']['sign_bit']); + + if (!empty($thisfile_mpeg_audio_lame_rgad['peak_amplitude'])) { + $info['replay_gain']['album']['peak'] = $thisfile_mpeg_audio_lame_rgad['peak_amplitude']; + } + $info['replay_gain']['album']['originator'] = $thisfile_mpeg_audio_lame_rgad_album['originator']; + $info['replay_gain']['album']['adjustment'] = $thisfile_mpeg_audio_lame_rgad_album['gain_db']; + } else { + unset($thisfile_mpeg_audio_lame_rgad['album']); + } + if (empty($thisfile_mpeg_audio_lame_rgad)) { + unset($thisfile_mpeg_audio_lame['RGAD']); + } + + + // byte $AF Encoding flags + ATH Type + $encoding_flags_ath_type = getid3_lib::BigEndian2Int(substr($header_string, $lame_tag_offset_contant + 0xAF, 1)); + $thisfile_mpeg_audio_lame['encoding_flags']['nspsytune'] = (bool) ($encoding_flags_ath_type & 0x10); + $thisfile_mpeg_audio_lame['encoding_flags']['nssafejoint'] = (bool) ($encoding_flags_ath_type & 0x20); + $thisfile_mpeg_audio_lame['encoding_flags']['nogap_next'] = (bool) ($encoding_flags_ath_type & 0x40); + $thisfile_mpeg_audio_lame['encoding_flags']['nogap_prev'] = (bool) ($encoding_flags_ath_type & 0x80); + $thisfile_mpeg_audio_lame['ath_type'] = $encoding_flags_ath_type & 0x0F; + + // byte $B0 if ABR {specified bitrate} else {minimal bitrate} + $thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate'] = getid3_lib::BigEndian2Int(substr($header_string, $lame_tag_offset_contant + 0xB0, 1)); + if ($thisfile_mpeg_audio_lame_raw['vbr_method'] == 2) { // Average BitRate (ABR) + $thisfile_mpeg_audio_lame['bitrate_abr'] = $thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate']; + } elseif ($thisfile_mpeg_audio_lame_raw['vbr_method'] == 1) { // Constant BitRate (CBR) + // ignore + } elseif ($thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate'] > 0) { // Variable BitRate (VBR) - minimum bitrate + $thisfile_mpeg_audio_lame['bitrate_min'] = $thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate']; + } + + // bytes $B1-$B3 Encoder delays + $encoder_delays = getid3_lib::BigEndian2Int(substr($header_string, $lame_tag_offset_contant + 0xB1, 3)); + $thisfile_mpeg_audio_lame['encoder_delay'] = ($encoder_delays & 0xFFF000) >> 12; + $thisfile_mpeg_audio_lame['end_padding'] = $encoder_delays & 0x000FFF; + + // byte $B4 Misc + $misc_byte = getid3_lib::BigEndian2Int(substr($header_string, $lame_tag_offset_contant + 0xB4, 1)); + $thisfile_mpeg_audio_lame_raw['noise_shaping'] = ($misc_byte & 0x03); + $thisfile_mpeg_audio_lame_raw['stereo_mode'] = ($misc_byte & 0x1C) >> 2; + $thisfile_mpeg_audio_lame_raw['not_optimal_quality'] = ($misc_byte & 0x20) >> 5; + $thisfile_mpeg_audio_lame_raw['source_sample_freq'] = ($misc_byte & 0xC0) >> 6; + $thisfile_mpeg_audio_lame['noise_shaping'] = $thisfile_mpeg_audio_lame_raw['noise_shaping']; + $thisfile_mpeg_audio_lame['stereo_mode'] = getid3_mp3::LAMEmiscStereoModeLookup($thisfile_mpeg_audio_lame_raw['stereo_mode']); + $thisfile_mpeg_audio_lame['not_optimal_quality'] = (bool) $thisfile_mpeg_audio_lame_raw['not_optimal_quality']; + $thisfile_mpeg_audio_lame['source_sample_freq'] = getid3_mp3::LAMEmiscSourceSampleFrequencyLookup($thisfile_mpeg_audio_lame_raw['source_sample_freq']); + + // byte $B5 MP3 Gain + $thisfile_mpeg_audio_lame_raw['mp3_gain'] = getid3_lib::BigEndian2Int(substr($header_string, $lame_tag_offset_contant + 0xB5, 1), false, true); + $thisfile_mpeg_audio_lame['mp3_gain_db'] = (20 * log10(2) / 4) * $thisfile_mpeg_audio_lame_raw['mp3_gain']; + $thisfile_mpeg_audio_lame['mp3_gain_factor'] = pow(2, ($thisfile_mpeg_audio_lame['mp3_gain_db'] / 6)); + + // bytes $B6-$B7 Preset and surround info + $PresetSurroundBytes = getid3_lib::BigEndian2Int(substr($header_string, $lame_tag_offset_contant + 0xB6, 2)); + // Reserved = ($PresetSurroundBytes & 0xC000); + $thisfile_mpeg_audio_lame_raw['surround_info'] = ($PresetSurroundBytes & 0x3800); + $thisfile_mpeg_audio_lame['surround_info'] = getid3_mp3::LAMEsurroundInfoLookup($thisfile_mpeg_audio_lame_raw['surround_info']); + $thisfile_mpeg_audio_lame['preset_used_id'] = ($PresetSurroundBytes & 0x07FF); + $thisfile_mpeg_audio_lame['preset_used'] = getid3_mp3::LAMEpresetUsedLookup($thisfile_mpeg_audio_lame); + if (!empty($thisfile_mpeg_audio_lame['preset_used_id']) && empty($thisfile_mpeg_audio_lame['preset_used'])) { + $this->getid3->warning('Unknown LAME preset used ('.$thisfile_mpeg_audio_lame['preset_used_id'].') - please report to info@getid3.org'); + } + if (($thisfile_mpeg_audio_lame['short_version'] == 'LAME3.90.') && !empty($thisfile_mpeg_audio_lame['preset_used_id'])) { + // this may change if 3.90.4 ever comes out + $thisfile_mpeg_audio_lame['short_version'] = 'LAME3.90.3'; + } + + // bytes $B8-$BB MusicLength + $thisfile_mpeg_audio_lame['audio_bytes'] = getid3_lib::BigEndian2Int(substr($header_string, $lame_tag_offset_contant + 0xB8, 4)); + $expected_number_of_audio_bytes = (($thisfile_mpeg_audio_lame['audio_bytes'] > 0) ? $thisfile_mpeg_audio_lame['audio_bytes'] : $thisfile_mpeg_audio['VBR_bytes']); + + // bytes $BC-$BD MusicCRC + $thisfile_mpeg_audio_lame['music_crc'] = getid3_lib::BigEndian2Int(substr($header_string, $lame_tag_offset_contant + 0xBC, 2)); + + // bytes $BE-$BF CRC-16 of Info Tag + $thisfile_mpeg_audio_lame['lame_tag_crc'] = getid3_lib::BigEndian2Int(substr($header_string, $lame_tag_offset_contant + 0xBE, 2)); + + + // LAME CBR + if ($thisfile_mpeg_audio_lame_raw['vbr_method'] == 1) { + + $thisfile_mpeg_audio['bitrate_mode'] = 'cbr'; + $thisfile_mpeg_audio['bitrate'] = getid3_mp3::ClosestStandardMP3Bitrate($thisfile_mpeg_audio['bitrate']); + $info['audio']['bitrate'] = $thisfile_mpeg_audio['bitrate']; + + } + + } + } + + } else { + + // not Fraunhofer or Xing VBR methods, most likely CBR (but could be VBR with no header) + $thisfile_mpeg_audio['bitrate_mode'] = 'cbr'; + if ($recursive_search) { + $thisfile_mpeg_audio['bitrate_mode'] = 'vbr'; + if (getid3_mp3::RecursiveFrameScanning($fd, $info, $offset, $next_frame_test_offset, true)) { + $recursive_search = false; + $thisfile_mpeg_audio['bitrate_mode'] = 'cbr'; + } + if ($thisfile_mpeg_audio['bitrate_mode'] == 'vbr') { + $this->getid3->warning('VBR file with no VBR header. Bitrate values calculated from actual frame bitrates.'); + } + } + + } + + } + + if (($expected_number_of_audio_bytes > 0) && ($expected_number_of_audio_bytes != ($info['avdataend'] - $info['avdataoffset']))) { + if ($expected_number_of_audio_bytes > ($info['avdataend'] - $info['avdataoffset'])) { + if (($expected_number_of_audio_bytes - ($info['avdataend'] - $info['avdataoffset'])) == 1) { + $this->getid3->warning('Last byte of data truncated (this is a known bug in Meracl ID3 Tag Writer before v1.3.5)'); + } else { + $this->getid3->warning('Probable truncated file: expecting '.$expected_number_of_audio_bytes.' bytes of audio data, only found '.($info['avdataend'] - $info['avdataoffset']).' (short by '.($expected_number_of_audio_bytes - ($info['avdataend'] - $info['avdataoffset'])).' bytes)'); + } + } else { + if ((($info['avdataend'] - $info['avdataoffset']) - $expected_number_of_audio_bytes) == 1) { + $info['avdataend']--; + } else { + $this->getid3->warning('Too much data in file: expecting '.$expected_number_of_audio_bytes.' bytes of audio data, found '.($info['avdataend'] - $info['avdataoffset']).' ('.(($info['avdataend'] - $info['avdataoffset']) - $expected_number_of_audio_bytes).' bytes too many)'); + } + } + } + + if (($thisfile_mpeg_audio['bitrate'] == 'free') && empty($info['audio']['bitrate'])) { + if (($offset == $info['avdataoffset']) && empty($thisfile_mpeg_audio['VBR_frames'])) { + $frame_byte_length = getid3_mp3::FreeFormatFrameLength($fd, $offset, $info, true); + if ($frame_byte_length > 0) { + $thisfile_mpeg_audio['framelength'] = $frame_byte_length; + if ($thisfile_mpeg_audio['layer'] == '1') { + // BitRate = (((FrameLengthInBytes / 4) - Padding) * SampleRate) / 12 + $info['audio']['bitrate'] = ((($frame_byte_length / 4) - intval($thisfile_mpeg_audio['padding'])) * $thisfile_mpeg_audio['sample_rate']) / 12; + } else { + // Bitrate = ((FrameLengthInBytes - Padding) * SampleRate) / 144 + $info['audio']['bitrate'] = (($frame_byte_length - intval($thisfile_mpeg_audio['padding'])) * $thisfile_mpeg_audio['sample_rate']) / 144; + } + } else { + + // non-fatal error: Error calculating frame length of free-format MP3 without Xing/LAME header. + return; + } + } + } + + if (@$thisfile_mpeg_audio['VBR_frames']) { + switch ($thisfile_mpeg_audio['bitrate_mode']) { + case 'vbr': + case 'abr': + if (($thisfile_mpeg_audio['version'] == '1') && ($thisfile_mpeg_audio['layer'] == 1)) { + $thisfile_mpeg_audio['VBR_bitrate'] = ((@$thisfile_mpeg_audio['VBR_bytes'] / $thisfile_mpeg_audio['VBR_frames']) * 8) * ($info['audio']['sample_rate'] / 384); + } elseif ((($thisfile_mpeg_audio['version'] == '2') || ($thisfile_mpeg_audio['version'] == '2.5')) && ($thisfile_mpeg_audio['layer'] == 3)) { + $thisfile_mpeg_audio['VBR_bitrate'] = ((@$thisfile_mpeg_audio['VBR_bytes'] / $thisfile_mpeg_audio['VBR_frames']) * 8) * ($info['audio']['sample_rate'] / 576); + } else { + $thisfile_mpeg_audio['VBR_bitrate'] = ((@$thisfile_mpeg_audio['VBR_bytes'] / $thisfile_mpeg_audio['VBR_frames']) * 8) * ($info['audio']['sample_rate'] / 1152); + } + if ($thisfile_mpeg_audio['VBR_bitrate'] > 0) { + $info['audio']['bitrate'] = $thisfile_mpeg_audio['VBR_bitrate']; + $thisfile_mpeg_audio['bitrate'] = $thisfile_mpeg_audio['VBR_bitrate']; // to avoid confusion + } + break; + } + } + + // End variable-bitrate headers + //////////////////////////////////////////////////////////////////////////////////// + + if ($recursive_search) { + + if (!getid3_mp3::RecursiveFrameScanning($fd, $info, $offset, $next_frame_test_offset, $scan_as_cbr)) { + return false; + } + + } + + return true; + } + + + + public function RecursiveFrameScanning(&$fd, &$info, &$offset, &$next_frame_test_offset, $scan_as_cbr) { + for ($i = 0; $i < getid3_mp3::VALID_CHECK_FRAMES; $i++) { + // check next getid3_mp3::VALID_CHECK_FRAMES frames for validity, to make sure we haven't run across a false synch + if (($next_frame_test_offset + 4) >= $info['avdataend']) { + // end of file + return true; + } + + $next_frame_test_array = array ('avdataend' => $info['avdataend'], 'avdataoffset' => $info['avdataoffset']); + if ($this->decodeMPEGaudioHeader($fd, $next_frame_test_offset, $next_frame_test_array, false)) { + if ($scan_as_cbr) { + // force CBR mode, used for trying to pick out invalid audio streams with + // valid(?) VBR headers, or VBR streams with no VBR header + if (!isset($next_frame_test_array['mpeg']['audio']['bitrate']) || !isset($info['mpeg']['audio']['bitrate']) || ($next_frame_test_array['mpeg']['audio']['bitrate'] != $info['mpeg']['audio']['bitrate'])) { + return false; + } + } + + + // next frame is OK, get ready to check the one after that + if (isset($next_frame_test_array['mpeg']['audio']['framelength']) && ($next_frame_test_array['mpeg']['audio']['framelength'] > 0)) { + $next_frame_test_offset += $next_frame_test_array['mpeg']['audio']['framelength']; + } else { + + // non-fatal error: Frame at offset $offset has an invalid frame length. + return; + } + + } else { + + // non-fatal error: Next frame is not valid. + return; + } + } + return true; + } + + + + public function FreeFormatFrameLength($fd, $offset, &$info, $deep_scan=false) { + fseek($fd, $offset, SEEK_SET); + $mpeg_audio_data = fread($fd, 32768); + + $sync_pattern1 = substr($mpeg_audio_data, 0, 4); + // may be different pattern due to padding + $sync_pattern2 = $sync_pattern1{0}.$sync_pattern1{1}.chr(ord($sync_pattern1{2}) | 0x02).$sync_pattern1{3}; + if ($sync_pattern2 === $sync_pattern1) { + $sync_pattern2 = $sync_pattern1{0}.$sync_pattern1{1}.chr(ord($sync_pattern1{2}) & 0xFD).$sync_pattern1{3}; + } + + $frame_length = false; + $frame_length1 = strpos($mpeg_audio_data, $sync_pattern1, 4); + $frame_length2 = strpos($mpeg_audio_data, $sync_pattern2, 4); + if ($frame_length1 > 4) { + $frame_length = $frame_length1; + } + if (($frame_length2 > 4) && ($frame_length2 < $frame_length1)) { + $frame_length = $frame_length2; + } + if (!$frame_length) { + + // LAME 3.88 has a different value for modeextension on the first frame vs the rest + $frame_length1 = strpos($mpeg_audio_data, substr($sync_pattern1, 0, 3), 4); + $frame_length2 = strpos($mpeg_audio_data, substr($sync_pattern2, 0, 3), 4); + + if ($frame_length1 > 4) { + $frame_length = $frame_length1; + } + if (($frame_length2 > 4) && ($frame_length2 < $frame_length1)) { + $frame_length = $frame_length2; + } + if (!$frame_length) { + throw new getid3_exception('Cannot find next free-format synch pattern ('.getid3_lib::PrintHexBytes($sync_pattern1).' or '.getid3_lib::PrintHexBytes($sync_pattern2).') after offset '.$offset); + } else { + $this->getid3->warning('ModeExtension varies between first frame and other frames (known free-format issue in LAME 3.88)'); + $info['audio']['codec'] = 'LAME'; + $info['audio']['encoder'] = 'LAME3.88'; + $sync_pattern1 = substr($sync_pattern1, 0, 3); + $sync_pattern2 = substr($sync_pattern2, 0, 3); + } + } + + if ($deep_scan) { + + $actual_frame_length_values = array (); + $next_offset = $offset + $frame_length; + while ($next_offset < ($info['avdataend'] - 6)) { + fseek($fd, $next_offset - 1, SEEK_SET); + $NextSyncPattern = fread($fd, 6); + if ((substr($NextSyncPattern, 1, strlen($sync_pattern1)) == $sync_pattern1) || (substr($NextSyncPattern, 1, strlen($sync_pattern2)) == $sync_pattern2)) { + // good - found where expected + $actual_frame_length_values[] = $frame_length; + } elseif ((substr($NextSyncPattern, 0, strlen($sync_pattern1)) == $sync_pattern1) || (substr($NextSyncPattern, 0, strlen($sync_pattern2)) == $sync_pattern2)) { + // ok - found one byte earlier than expected (last frame wasn't padded, first frame was) + $actual_frame_length_values[] = ($frame_length - 1); + $next_offset--; + } elseif ((substr($NextSyncPattern, 2, strlen($sync_pattern1)) == $sync_pattern1) || (substr($NextSyncPattern, 2, strlen($sync_pattern2)) == $sync_pattern2)) { + // ok - found one byte later than expected (last frame was padded, first frame wasn't) + $actual_frame_length_values[] = ($frame_length + 1); + $next_offset++; + } else { + throw new getid3_exception('Did not find expected free-format sync pattern at offset '.$next_offset); + } + $next_offset += $frame_length; + } + if (count($actual_frame_length_values) > 0) { + $frame_length = intval(round(array_sum($actual_frame_length_values) / count($actual_frame_length_values))); + } + } + return $frame_length; + } + + + + public function getOnlyMPEGaudioInfo($fd, &$info, $avdata_offset, $bit_rate_histogram=false) { + + // looks for synch, decodes MPEG audio header + + fseek($fd, $avdata_offset, SEEK_SET); + + $sync_seek_buffer_size = min(128 * 1024, $info['avdataend'] - $avdata_offset); + $header = fread($fd, $sync_seek_buffer_size); + $sync_seek_buffer_size = strlen($header); + $synch_seek_offset = 0; + + static $mpeg_audio_version_lookup; + static $mpeg_audio_layer_lookup; + static $mpeg_audio_bitrate_lookup; + if (empty($mpeg_audio_version_lookup)) { + $mpeg_audio_version_lookup = getid3_mp3::MPEGaudioVersionarray(); + $mpeg_audio_layer_lookup = getid3_mp3::MPEGaudioLayerarray(); + $mpeg_audio_bitrate_lookup = getid3_mp3::MPEGaudioBitratearray(); + + } + + while ($synch_seek_offset < $sync_seek_buffer_size) { + + if ((($avdata_offset + $synch_seek_offset) < $info['avdataend']) && !feof($fd)) { + + // if a synch's not found within the first 128k bytes, then give up + if ($synch_seek_offset > $sync_seek_buffer_size) { + throw new getid3_exception('Could not find valid MPEG audio synch within the first '.round($sync_seek_buffer_size / 1024).'kB'); + } + + if (feof($fd)) { + throw new getid3_exception('Could not find valid MPEG audio synch before end of file'); + } + } + + if (($synch_seek_offset + 1) >= strlen($header)) { + throw new getid3_exception('Could not find valid MPEG synch before end of file'); + } + + if (($header{$synch_seek_offset} == "\xFF") && ($header{($synch_seek_offset + 1)} > "\xE0")) { // synch detected + + if (!isset($first_frame_info) && !isset($info['mpeg']['audio'])) { + $first_frame_info = $info; + $first_frame_avdata_offset = $avdata_offset + $synch_seek_offset; + if (!getid3_mp3::decodeMPEGaudioHeader($fd, $avdata_offset + $synch_seek_offset, $first_frame_info, false)) { + // if this is the first valid MPEG-audio frame, save it in case it's a VBR header frame and there's + // garbage between this frame and a valid sequence of MPEG-audio frames, to be restored below + unset($first_frame_info); + } + } + + $dummy = $info; // only overwrite real data if valid header found + if (getid3_mp3::decodeMPEGaudioHeader($fd, $avdata_offset + $synch_seek_offset, $dummy, true)) { + $info = $dummy; + $info['avdataoffset'] = $avdata_offset + $synch_seek_offset; + + switch (@$info['fileformat']) { + case '': + case 'mp3': + $info['fileformat'] = 'mp3'; + $info['audio']['dataformat'] = 'mp3'; + break; + } + if (isset($first_frame_info['mpeg']['audio']['bitrate_mode']) && ($first_frame_info['mpeg']['audio']['bitrate_mode'] == 'vbr')) { + if (!(abs($info['audio']['bitrate'] - $first_frame_info['audio']['bitrate']) <= 1)) { + // If there is garbage data between a valid VBR header frame and a sequence + // of valid MPEG-audio frames the VBR data is no longer discarded. + $info = $first_frame_info; + $info['avdataoffset'] = $first_frame_avdata_offset; + $info['fileformat'] = 'mp3'; + $info['audio']['dataformat'] = 'mp3'; + $dummy = $info; + unset($dummy['mpeg']['audio']); + $GarbageOffsetStart = $first_frame_avdata_offset + $first_frame_info['mpeg']['audio']['framelength']; + $GarbageOffsetEnd = $avdata_offset + $synch_seek_offset; + if (getid3_mp3::decodeMPEGaudioHeader($fd, $GarbageOffsetEnd, $dummy, true, true)) { + + $info = $dummy; + $info['avdataoffset'] = $GarbageOffsetEnd; + $this->getid3->warning('apparently-valid VBR header not used because could not find '.getid3_mp3::VALID_CHECK_FRAMES.' consecutive MPEG-audio frames immediately after VBR header (garbage data for '.($GarbageOffsetEnd - $GarbageOffsetStart).' bytes between '.$GarbageOffsetStart.' and '.$GarbageOffsetEnd.'), but did find valid CBR stream starting at '.$GarbageOffsetEnd); + + } else { + + $this->getid3->warning('using data from VBR header even though could not find '.getid3_mp3::VALID_CHECK_FRAMES.' consecutive MPEG-audio frames immediately after VBR header (garbage data for '.($GarbageOffsetEnd - $GarbageOffsetStart).' bytes between '.$GarbageOffsetStart.' and '.$GarbageOffsetEnd.')'); + + } + } + } + if (isset($info['mpeg']['audio']['bitrate_mode']) && ($info['mpeg']['audio']['bitrate_mode'] == 'vbr') && !isset($info['mpeg']['audio']['VBR_method'])) { + // VBR file with no VBR header + $bit_rate_histogram = true; + } + + if ($bit_rate_histogram) { + + $info['mpeg']['audio']['stereo_distribution'] = array ('stereo'=>0, 'joint stereo'=>0, 'dual channel'=>0, 'mono'=>0); + $info['mpeg']['audio']['version_distribution'] = array ('1'=>0, '2'=>0, '2.5'=>0); + + if ($info['mpeg']['audio']['version'] == '1') { + if ($info['mpeg']['audio']['layer'] == 3) { + $info['mpeg']['audio']['bitrate_distribution'] = array ('free'=>0, 32000=>0, 40000=>0, 48000=>0, 56000=>0, 64000=>0, 80000=>0, 96000=>0, 112000=>0, 128000=>0, 160000=>0, 192000=>0, 224000=>0, 256000=>0, 320000=>0); + } elseif ($info['mpeg']['audio']['layer'] == 2) { + $info['mpeg']['audio']['bitrate_distribution'] = array ('free'=>0, 32000=>0, 48000=>0, 56000=>0, 64000=>0, 80000=>0, 96000=>0, 112000=>0, 128000=>0, 160000=>0, 192000=>0, 224000=>0, 256000=>0, 320000=>0, 384000=>0); + } elseif ($info['mpeg']['audio']['layer'] == 1) { + $info['mpeg']['audio']['bitrate_distribution'] = array ('free'=>0, 32000=>0, 64000=>0, 96000=>0, 128000=>0, 160000=>0, 192000=>0, 224000=>0, 256000=>0, 288000=>0, 320000=>0, 352000=>0, 384000=>0, 416000=>0, 448000=>0); + } + } elseif ($info['mpeg']['audio']['layer'] == 1) { + $info['mpeg']['audio']['bitrate_distribution'] = array ('free'=>0, 32000=>0, 48000=>0, 56000=>0, 64000=>0, 80000=>0, 96000=>0, 112000=>0, 128000=>0, 144000=>0, 160000=>0, 176000=>0, 192000=>0, 224000=>0, 256000=>0); + } else { + $info['mpeg']['audio']['bitrate_distribution'] = array ('free'=>0, 8000=>0, 16000=>0, 24000=>0, 32000=>0, 40000=>0, 48000=>0, 56000=>0, 64000=>0, 80000=>0, 96000=>0, 112000=>0, 128000=>0, 144000=>0, 160000=>0); + } + + $dummy = array ('avdataend' => $info['avdataend'], 'avdataoffset' => $info['avdataoffset']); + $synch_start_offset = $info['avdataoffset']; + + $fast_mode = false; + $synch_errors_found = 0; + while ($this->decodeMPEGaudioHeader($fd, $synch_start_offset, $dummy, false, false, $fast_mode)) { + $fast_mode = true; + $thisframebitrate = $mpeg_audio_bitrate_lookup[$mpeg_audio_version_lookup[$dummy['mpeg']['audio']['raw']['version']]][$mpeg_audio_layer_lookup[$dummy['mpeg']['audio']['raw']['layer']]][$dummy['mpeg']['audio']['raw']['bitrate']]; + + if (empty($dummy['mpeg']['audio']['framelength'])) { + $synch_errors_found++; + } + else { + @$info['mpeg']['audio']['bitrate_distribution'][$thisframebitrate]++; + @$info['mpeg']['audio']['stereo_distribution'][$dummy['mpeg']['audio']['channelmode']]++; + @$info['mpeg']['audio']['version_distribution'][$dummy['mpeg']['audio']['version']]++; + + $synch_start_offset += $dummy['mpeg']['audio']['framelength']; + } + } + if ($synch_errors_found > 0) { + $this->getid3->warning('Found '.$synch_errors_found.' synch errors in histogram analysis'); + } + + $bit_total = 0; + $frame_counter = 0; + foreach ($info['mpeg']['audio']['bitrate_distribution'] as $bit_rate_value => $bit_rate_count) { + $frame_counter += $bit_rate_count; + if ($bit_rate_value != 'free') { + $bit_total += ($bit_rate_value * $bit_rate_count); + } + } + if ($frame_counter == 0) { + throw new getid3_exception('Corrupt MP3 file: framecounter == zero'); + } + $info['mpeg']['audio']['frame_count'] = $frame_counter; + $info['mpeg']['audio']['bitrate'] = ($bit_total / $frame_counter); + + $info['audio']['bitrate'] = $info['mpeg']['audio']['bitrate']; + + + // Definitively set VBR vs CBR, even if the Xing/LAME/VBRI header says differently + $distinct_bit_rates = 0; + foreach ($info['mpeg']['audio']['bitrate_distribution'] as $bit_rate_value => $bit_rate_count) { + if ($bit_rate_count > 0) { + $distinct_bit_rates++; + } + } + if ($distinct_bit_rates > 1) { + $info['mpeg']['audio']['bitrate_mode'] = 'vbr'; + } else { + $info['mpeg']['audio']['bitrate_mode'] = 'cbr'; + } + $info['audio']['bitrate_mode'] = $info['mpeg']['audio']['bitrate_mode']; + + } + + break; // exit while() + } + } + + $synch_seek_offset++; + if (($avdata_offset + $synch_seek_offset) >= $info['avdataend']) { + // end of file/data + + if (empty($info['mpeg']['audio'])) { + + throw new getid3_exception('could not find valid MPEG synch before end of file'); + } + break; + } + + } + + $info['audio']['channels'] = $info['mpeg']['audio']['channels']; + $info['audio']['channelmode'] = $info['mpeg']['audio']['channelmode']; + $info['audio']['sample_rate'] = $info['mpeg']['audio']['sample_rate']; + return true; + } + + + + public static function MPEGaudioVersionarray() { + + static $array = array ('2.5', false, '2', '1'); + return $array; + } + + + + public static function MPEGaudioLayerarray() { + + static $array = array (false, 3, 2, 1); + return $array; + } + + + + public static function MPEGaudioBitratearray() { + + static $array; + if (empty($array)) { + $array = array ( + '1' => array (1 => array ('free', 32000, 64000, 96000, 128000, 160000, 192000, 224000, 256000, 288000, 320000, 352000, 384000, 416000, 448000), + 2 => array ('free', 32000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 160000, 192000, 224000, 256000, 320000, 384000), + 3 => array ('free', 32000, 40000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 160000, 192000, 224000, 256000, 320000) + ), + + '2' => array (1 => array ('free', 32000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 144000, 160000, 176000, 192000, 224000, 256000), + 2 => array ('free', 8000, 16000, 24000, 32000, 40000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 144000, 160000), + ) + ); + $array['2'][3] = $array['2'][2]; + $array['2.5'] = $array['2']; + } + return $array; + } + + + + public static function MPEGaudioFrequencyarray() { + + static $array = array ( + '1' => array (44100, 48000, 32000), + '2' => array (22050, 24000, 16000), + '2.5' => array (11025, 12000, 8000) + ); + return $array; + } + + + + public static function MPEGaudioChannelModearray() { + + static $array = array ('stereo', 'joint stereo', 'dual channel', 'mono'); + return $array; + } + + + + public static function MPEGaudioModeExtensionarray() { + + static $array = array ( + 1 => array ('4-31', '8-31', '12-31', '16-31'), + 2 => array ('4-31', '8-31', '12-31', '16-31'), + 3 => array ('', 'IS', 'MS', 'IS+MS') + ); + return $array; + } + + + + public static function MPEGaudioEmphasisarray() { + + static $array = array ('none', '50/15ms', false, 'CCIT J.17'); + return $array; + } + + + + public static function MPEGaudioHeaderBytesValid($head4, $allow_bitrate_15=false) { + + return getid3_mp3::MPEGaudioHeaderValid(getid3_mp3::MPEGaudioHeaderDecode($head4), false, $allow_bitrate_15); + } + + + + public static function MPEGaudioHeaderValid($raw_array, $echo_errors=false, $allow_bitrate_15=false) { + + if (($raw_array['synch'] & 0x0FFE) != 0x0FFE) { + return false; + } + + static $mpeg_audio_version_lookup; + static $mpeg_audio_layer_lookup; + static $mpeg_audio_bitrate_lookup; + static $mpeg_audio_frequency_lookup; + static $mpeg_audio_channel_mode_lookup; + static $mpeg_audio_mode_extension_lookup; + static $mpeg_audio_emphasis_lookup; + if (empty($mpeg_audio_version_lookup)) { + $mpeg_audio_version_lookup = getid3_mp3::MPEGaudioVersionarray(); + $mpeg_audio_layer_lookup = getid3_mp3::MPEGaudioLayerarray(); + $mpeg_audio_bitrate_lookup = getid3_mp3::MPEGaudioBitratearray(); + $mpeg_audio_frequency_lookup = getid3_mp3::MPEGaudioFrequencyarray(); + $mpeg_audio_channel_mode_lookup = getid3_mp3::MPEGaudioChannelModearray(); + $mpeg_audio_mode_extension_lookup = getid3_mp3::MPEGaudioModeExtensionarray(); + $mpeg_audio_emphasis_lookup = getid3_mp3::MPEGaudioEmphasisarray(); + } + + if (isset($mpeg_audio_version_lookup[$raw_array['version']])) { + $decodedVersion = $mpeg_audio_version_lookup[$raw_array['version']]; + } else { + echo ($echo_errors ? "\n".'invalid Version ('.$raw_array['version'].')' : ''); + return false; + } + if (isset($mpeg_audio_layer_lookup[$raw_array['layer']])) { + $decodedLayer = $mpeg_audio_layer_lookup[$raw_array['layer']]; + } else { + echo ($echo_errors ? "\n".'invalid Layer ('.$raw_array['layer'].')' : ''); + return false; + } + if (!isset($mpeg_audio_bitrate_lookup[$decodedVersion][$decodedLayer][$raw_array['bitrate']])) { + echo ($echo_errors ? "\n".'invalid Bitrate ('.$raw_array['bitrate'].')' : ''); + if ($raw_array['bitrate'] == 15) { + // known issue in LAME 3.90 - 3.93.1 where free-format has bitrate ID of 15 instead of 0 + // let it go through here otherwise file will not be identified + if (!$allow_bitrate_15) { + return false; + } + } else { + return false; + } + } + if (!isset($mpeg_audio_frequency_lookup[$decodedVersion][$raw_array['sample_rate']])) { + echo ($echo_errors ? "\n".'invalid Frequency ('.$raw_array['sample_rate'].')' : ''); + return false; + } + if (!isset($mpeg_audio_channel_mode_lookup[$raw_array['channelmode']])) { + echo ($echo_errors ? "\n".'invalid ChannelMode ('.$raw_array['channelmode'].')' : ''); + return false; + } + if (!isset($mpeg_audio_mode_extension_lookup[$decodedLayer][$raw_array['modeextension']])) { + echo ($echo_errors ? "\n".'invalid Mode Extension ('.$raw_array['modeextension'].')' : ''); + return false; + } + if (!isset($mpeg_audio_emphasis_lookup[$raw_array['emphasis']])) { + echo ($echo_errors ? "\n".'invalid Emphasis ('.$raw_array['emphasis'].')' : ''); + return false; + } + // These are just either set or not set, you can't mess that up :) + // $raw_array['protection']; + // $raw_array['padding']; + // $raw_array['private']; + // $raw_array['copyright']; + // $raw_array['original']; + + return true; + } + + + + public static function MPEGaudioHeaderDecode($header_four_bytes) { + // AAAA AAAA AAAB BCCD EEEE FFGH IIJJ KLMM + // A - Frame sync (all bits set) + // B - MPEG Audio version ID + // C - Layer description + // D - Protection bit + // E - Bitrate index + // F - Sampling rate frequency index + // G - Padding bit + // H - Private bit + // I - Channel Mode + // J - Mode extension (Only if Joint stereo) + // K - Copyright + // L - Original + // M - Emphasis + + if (strlen($header_four_bytes) != 4) { + return false; + } + + $mpeg_raw_header['synch'] = (getid3_lib::BigEndian2Int(substr($header_four_bytes, 0, 2)) & 0xFFE0) >> 4; + $mpeg_raw_header['version'] = (ord($header_four_bytes{1}) & 0x18) >> 3; // BB + $mpeg_raw_header['layer'] = (ord($header_four_bytes{1}) & 0x06) >> 1; // CC + $mpeg_raw_header['protection'] = (ord($header_four_bytes{1}) & 0x01); // D + $mpeg_raw_header['bitrate'] = (ord($header_four_bytes{2}) & 0xF0) >> 4; // EEEE + $mpeg_raw_header['sample_rate'] = (ord($header_four_bytes{2}) & 0x0C) >> 2; // FF + $mpeg_raw_header['padding'] = (ord($header_four_bytes{2}) & 0x02) >> 1; // G + $mpeg_raw_header['private'] = (ord($header_four_bytes{2}) & 0x01); // H + $mpeg_raw_header['channelmode'] = (ord($header_four_bytes{3}) & 0xC0) >> 6; // II + $mpeg_raw_header['modeextension'] = (ord($header_four_bytes{3}) & 0x30) >> 4; // JJ + $mpeg_raw_header['copyright'] = (ord($header_four_bytes{3}) & 0x08) >> 3; // K + $mpeg_raw_header['original'] = (ord($header_four_bytes{3}) & 0x04) >> 2; // L + $mpeg_raw_header['emphasis'] = (ord($header_four_bytes{3}) & 0x03); // MM + + return $mpeg_raw_header; + } + + + + public static function MPEGaudioFrameLength(&$bit_rate, &$version, &$layer, $padding, &$sample_rate) { + + if (!isset($cache[$bit_rate][$version][$layer][$padding][$sample_rate])) { + $cache[$bit_rate][$version][$layer][$padding][$sample_rate] = false; + if ($bit_rate != 'free') { + + if ($version == '1') { + + if ($layer == '1') { + + // For Layer I slot is 32 bits long + $frame_length_coefficient = 48; + $slot_length = 4; + + } else { // Layer 2 / 3 + + // for Layer 2 and Layer 3 slot is 8 bits long. + $frame_length_coefficient = 144; + $slot_length = 1; + + } + + } else { // MPEG-2 / MPEG-2.5 + + if ($layer == '1') { + + // For Layer I slot is 32 bits long + $frame_length_coefficient = 24; + $slot_length = 4; + + } elseif ($layer == '2') { + + // for Layer 2 and Layer 3 slot is 8 bits long. + $frame_length_coefficient = 144; + $slot_length = 1; + + } else { // layer 3 + + // for Layer 2 and Layer 3 slot is 8 bits long. + $frame_length_coefficient = 72; + $slot_length = 1; + + } + + } + + // FrameLengthInBytes = ((Coefficient * BitRate) / SampleRate) + Padding + if ($sample_rate > 0) { + $new_frame_length = ($frame_length_coefficient * $bit_rate) / $sample_rate; + $new_frame_length = floor($new_frame_length / $slot_length) * $slot_length; // round to next-lower multiple of SlotLength (1 byte for Layer 2/3, 4 bytes for Layer I) + if ($padding) { + $new_frame_length += $slot_length; + } + $cache[$bit_rate][$version][$layer][$padding][$sample_rate] = (int) $new_frame_length; + } + } + } + return $cache[$bit_rate][$version][$layer][$padding][$sample_rate]; + } + + + + public static function ClosestStandardMP3Bitrate($bit_rate) { + + static $standard_bit_rates = array (320000, 256000, 224000, 192000, 160000, 128000, 112000, 96000, 80000, 64000, 56000, 48000, 40000, 32000, 24000, 16000, 8000); + static $bit_rate_table = array (0=>'-'); + $round_bit_rate = intval(round($bit_rate, -3)); + if (!isset($bit_rate_table[$round_bit_rate])) { + if ($round_bit_rate > 320000) { + $bit_rate_table[$round_bit_rate] = round($bit_rate, -4); + } else { + $last_bit_rate = 320000; + foreach ($standard_bit_rates as $standard_bit_rate) { + $bit_rate_table[$round_bit_rate] = $standard_bit_rate; + if ($round_bit_rate >= $standard_bit_rate - (($last_bit_rate - $standard_bit_rate) / 2)) { + break; + } + $last_bit_rate = $standard_bit_rate; + } + } + } + return $bit_rate_table[$round_bit_rate]; + } + + + + public static function XingVBRidOffset($version, $channel_mode) { + + static $lookup = array ( + '1' => array ('mono' => 0x15, // 4 + 17 = 21 + 'stereo' => 0x24, // 4 + 32 = 36 + 'joint stereo' => 0x24, + 'dual channel' => 0x24 + ), + + '2' => array ('mono' => 0x0D, // 4 + 9 = 13 + 'stereo' => 0x15, // 4 + 17 = 21 + 'joint stereo' => 0x15, + 'dual channel' => 0x15 + ), + + '2.5' => array ('mono' => 0x15, + 'stereo' => 0x15, + 'joint stereo' => 0x15, + 'dual channel' => 0x15 + ) + ); + + return $lookup[$version][$channel_mode]; + } + + + + public static function LAMEvbrMethodLookup($vbr_method_id) { + + static $lookup = array ( + 0x00 => 'unknown', + 0x01 => 'cbr', + 0x02 => 'abr', + 0x03 => 'vbr-old / vbr-rh', + 0x04 => 'vbr-new / vbr-mtrh', + 0x05 => 'vbr-mt', + 0x06 => 'Full VBR Method 4', + 0x08 => 'constant bitrate 2 pass', + 0x09 => 'abr 2 pass', + 0x0F => 'reserved' + ); + return (isset($lookup[$vbr_method_id]) ? $lookup[$vbr_method_id] : ''); + } + + + + public static function LAMEmiscStereoModeLookup($stereo_mode_id) { + + static $lookup = array ( + 0 => 'mono', + 1 => 'stereo', + 2 => 'dual mono', + 3 => 'joint stereo', + 4 => 'forced stereo', + 5 => 'auto', + 6 => 'intensity stereo', + 7 => 'other' + ); + return (isset($lookup[$stereo_mode_id]) ? $lookup[$stereo_mode_id] : ''); + } + + + + public static function LAMEmiscSourceSampleFrequencyLookup($source_sample_frequency_id) { + + static $lookup = array ( + 0 => '<= 32 kHz', + 1 => '44.1 kHz', + 2 => '48 kHz', + 3 => '> 48kHz' + ); + return (isset($lookup[$source_sample_frequency_id]) ? $lookup[$source_sample_frequency_id] : ''); + } + + + + public static function LAMEsurroundInfoLookup($surround_info_id) { + + static $lookup = array ( + 0 => 'no surround info', + 1 => 'DPL encoding', + 2 => 'DPL2 encoding', + 3 => 'Ambisonic encoding' + ); + return (isset($lookup[$surround_info_id]) ? $lookup[$surround_info_id] : 'reserved'); + } + + + + public static function LAMEpresetUsedLookup($lame_tag) { + + if ($lame_tag['preset_used_id'] == 0) { + // no preset used (LAME >=3.93) + // no preset recorded (LAME <3.93) + return ''; + } + + $lame_preset_used_lookup = array (); + + for ($i = 8; $i <= 320; $i++) { + switch ($lame_tag['vbr_method']) { + case 'cbr': + $lame_preset_used_lookup[$i] = '--alt-preset '.$lame_tag['vbr_method'].' '.$i; + break; + case 'abr': + default: // other VBR modes shouldn't be here(?) + $lame_preset_used_lookup[$i] = '--alt-preset '.$i; + break; + } + } + + // named old-style presets (studio, phone, voice, etc) are handled in GuessEncoderOptions() + + // named alt-presets + $lame_preset_used_lookup[1000] = '--r3mix'; + $lame_preset_used_lookup[1001] = '--alt-preset standard'; + $lame_preset_used_lookup[1002] = '--alt-preset extreme'; + $lame_preset_used_lookup[1003] = '--alt-preset insane'; + $lame_preset_used_lookup[1004] = '--alt-preset fast standard'; + $lame_preset_used_lookup[1005] = '--alt-preset fast extreme'; + $lame_preset_used_lookup[1006] = '--alt-preset medium'; + $lame_preset_used_lookup[1007] = '--alt-preset fast medium'; + + // LAME 3.94 additions/changes + $lame_preset_used_lookup[1010] = '--preset portable'; // 3.94a15 Oct 21 2003 + $lame_preset_used_lookup[1015] = '--preset radio'; // 3.94a15 Oct 21 2003 + + $lame_preset_used_lookup[320] = '--preset insane'; // 3.94a15 Nov 12 2003 + $lame_preset_used_lookup[410] = '-V9'; + $lame_preset_used_lookup[420] = '-V8'; + $lame_preset_used_lookup[430] = '--preset radio'; // 3.94a15 Nov 12 2003 + $lame_preset_used_lookup[440] = '-V6'; + $lame_preset_used_lookup[450] = '--preset '.(($lame_tag['raw']['vbr_method'] == 4) ? 'fast ' : '').'portable'; // 3.94a15 Nov 12 2003 + $lame_preset_used_lookup[460] = '--preset '.(($lame_tag['raw']['vbr_method'] == 4) ? 'fast ' : '').'medium'; // 3.94a15 Nov 12 2003 + $lame_preset_used_lookup[470] = '--r3mix'; // 3.94b1 Dec 18 2003 + $lame_preset_used_lookup[480] = '--preset '.(($lame_tag['raw']['vbr_method'] == 4) ? 'fast ' : '').'standard'; // 3.94a15 Nov 12 2003 + $lame_preset_used_lookup[490] = '-V1'; + $lame_preset_used_lookup[500] = '--preset '.(($lame_tag['raw']['vbr_method'] == 4) ? 'fast ' : '').'extreme'; // 3.94a15 Nov 12 2003 + + return (isset($lame_preset_used_lookup[$lame_tag['preset_used_id']]) ? $lame_preset_used_lookup[$lame_tag['preset_used_id']] : 'new/unknown preset: '.$lame_tag['preset_used_id'].' - report to info@getid3.org'); + } + + +} + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.mpc.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.mpc.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,211 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.mpc.php | +// | Module for analyzing Musepack/MPEG+ Audio files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.mpc.php,v 1.3 2006/11/02 10:48:01 ah Exp $ + + + +class getid3_mpc extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + // http://www.uni-jena.de/~pfk/mpp/sv8/header.html + + $getid3->info['fileformat'] = 'mpc'; + $getid3->info['audio']['dataformat'] = 'mpc'; + $getid3->info['audio']['bitrate_mode'] = 'vbr'; + $getid3->info['audio']['channels'] = 2; // the format appears to be hardcoded for stereo only + $getid3->info['audio']['lossless'] = false; + + $getid3->info['mpc']['header'] = array (); + $info_mpc_header = &$getid3->info['mpc']['header']; + $info_mpc_header['size'] = 28; + $info_mpc_header['raw']['preamble'] = 'MP+'; // Magic bytes + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $mpc_header_data = fread($getid3->fp, 28); + + $stream_version_byte = getid3_lib::LittleEndian2Int(substr($mpc_header_data, 3, 1)); + $info_mpc_header['stream_major_version'] = ($stream_version_byte & 0x0F); + $info_mpc_header['stream_minor_version'] = ($stream_version_byte & 0xF0) >> 4; + if ($info_mpc_header['stream_major_version'] != 7) { + throw new getid3_exception('Only Musepack SV7 supported'); + } + + $info_mpc_header['frame_count'] = getid3_lib::LittleEndian2Int(substr($mpc_header_data, 4, 4)); + + $info_mpc_header['raw']['title_peak'] = getid3_lib::LittleEndian2Int(substr($mpc_header_data, 12, 2)); + $info_mpc_header['raw']['title_gain'] = getid3_lib::LittleEndian2Int(substr($mpc_header_data, 14, 2), true); + $info_mpc_header['raw']['album_peak'] = getid3_lib::LittleEndian2Int(substr($mpc_header_data, 16, 2)); + $info_mpc_header['raw']['album_gain'] = getid3_lib::LittleEndian2Int(substr($mpc_header_data, 18, 2), true); + + $info_mpc_header['raw']['not_sure_what'] = getid3_lib::LittleEndian2Int(substr($mpc_header_data, 24, 3)); + $info_mpc_header['raw']['encoder_version'] = getid3_lib::LittleEndian2Int(substr($mpc_header_data, 27, 1)); + + $flags_dword1 = getid3_lib::LittleEndian2Int(substr($mpc_header_data, 8, 4)); + $flags_dword2 = getid3_lib::LittleEndian2Int(substr($mpc_header_data, 20, 4)); + + $info_mpc_header['intensity_stereo'] = (bool)(($flags_dword1 & 0x80000000) >> 31); + $info_mpc_header['mid_side_stereo'] = (bool)(($flags_dword1 & 0x40000000) >> 30); + $info_mpc_header['max_subband'] = ($flags_dword1 & 0x3F000000) >> 24; + $info_mpc_header['raw']['profile'] = ($flags_dword1 & 0x00F00000) >> 20; + $info_mpc_header['begin_loud'] = (bool)(($flags_dword1 & 0x00080000) >> 19); + $info_mpc_header['end_loud'] = (bool)(($flags_dword1 & 0x00040000) >> 18); + $info_mpc_header['raw']['sample_rate'] = ($flags_dword1 & 0x00030000) >> 16; + $info_mpc_header['max_level'] = ($flags_dword1 & 0x0000FFFF); + + $info_mpc_header['true_gapless'] = (bool)(($flags_dword2 & 0x80000000) >> 31); + $info_mpc_header['last_frame_length'] = ($flags_dword2 & 0x7FF00000) >> 20; + + $info_mpc_header['profile'] = getid3_mpc::MPCprofileNameLookup($info_mpc_header['raw']['profile']); + $info_mpc_header['sample_rate'] = getid3_mpc::MPCfrequencyLookup($info_mpc_header['raw']['sample_rate']); + $getid3->info['audio']['sample_rate'] = $info_mpc_header['sample_rate']; + $info_mpc_header['samples'] = ((($info_mpc_header['frame_count'] - 1) * 1152) + $info_mpc_header['last_frame_length']) * $getid3->info['audio']['channels']; + + $getid3->info['playtime_seconds'] = ($info_mpc_header['samples'] / $getid3->info['audio']['channels']) / $getid3->info['audio']['sample_rate']; + + $getid3->info['avdataoffset'] += $info_mpc_header['size']; + + $getid3->info['audio']['bitrate'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / $getid3->info['playtime_seconds']; + + $info_mpc_header['title_peak'] = $info_mpc_header['raw']['title_peak']; + $info_mpc_header['title_peak_db'] = getid3_mpc::MPCpeakDBLookup($info_mpc_header['title_peak']); + if ($info_mpc_header['raw']['title_gain'] < 0) { + $info_mpc_header['title_gain_db'] = (float)(32768 + $info_mpc_header['raw']['title_gain']) / -100; + } + else { + $info_mpc_header['title_gain_db'] = (float)$info_mpc_header['raw']['title_gain'] / 100; + } + + $info_mpc_header['album_peak'] = $info_mpc_header['raw']['album_peak']; + $info_mpc_header['album_peak_db'] = getid3_mpc::MPCpeakDBLookup($info_mpc_header['album_peak']); + if ($info_mpc_header['raw']['album_gain'] < 0) { + $info_mpc_header['album_gain_db'] = (float)(32768 + $info_mpc_header['raw']['album_gain']) / -100; + } + else { + $info_mpc_header['album_gain_db'] = (float)$info_mpc_header['raw']['album_gain'] / 100;; + } + $info_mpc_header['encoder_version'] = getid3_mpc::MPCencoderVersionLookup($info_mpc_header['raw']['encoder_version']); + + $getid3->info['replay_gain']['track']['adjustment'] = $info_mpc_header['title_gain_db']; + $getid3->info['replay_gain']['album']['adjustment'] = $info_mpc_header['album_gain_db']; + + if ($info_mpc_header['title_peak'] > 0) { + $getid3->info['replay_gain']['track']['peak'] = $info_mpc_header['title_peak']; + } + elseif (round($info_mpc_header['max_level'] * 1.18) > 0) { + $getid3->info['replay_gain']['track']['peak'] = (int)(round($info_mpc_header['max_level'] * 1.18)); // why? I don't know - see mppdec.c + } + if ($info_mpc_header['album_peak'] > 0) { + $getid3->info['replay_gain']['album']['peak'] = $info_mpc_header['album_peak']; + } + + $getid3->info['audio']['encoder'] = $info_mpc_header['encoder_version']; + $getid3->info['audio']['encoder_options'] = $info_mpc_header['profile']; + + return true; + } + + + + public static function MPCprofileNameLookup($profileid) { + + static $lookup = array ( + 0 => 'no profile', + 1 => 'Experimental', + 2 => 'unused', + 3 => 'unused', + 4 => 'unused', + 5 => 'below Telephone (q = 0.0)', + 6 => 'below Telephone (q = 1.0)', + 7 => 'Telephone (q = 2.0)', + 8 => 'Thumb (q = 3.0)', + 9 => 'Radio (q = 4.0)', + 10 => 'Standard (q = 5.0)', + 11 => 'Extreme (q = 6.0)', + 12 => 'Insane (q = 7.0)', + 13 => 'BrainDead (q = 8.0)', + 14 => 'above BrainDead (q = 9.0)', + 15 => 'above BrainDead (q = 10.0)' + ); + return (isset($lookup[$profileid]) ? $lookup[$profileid] : 'invalid'); + } + + + + public static function MPCfrequencyLookup($frequencyid) { + + static $lookup = array ( + 0 => 44100, + 1 => 48000, + 2 => 37800, + 3 => 32000 + ); + return (isset($lookup[$frequencyid]) ? $lookup[$frequencyid] : 'invalid'); + } + + + + public static function MPCpeakDBLookup($int_value) { + + if ($int_value > 0) { + return ((log10($int_value) / log10(2)) - 15) * 6; + } + return false; + } + + + + public static function MPCencoderVersionLookup($encoder_version) { + + //Encoder version * 100 (106 = 1.06) + //EncoderVersion % 10 == 0 Release (1.0) + //EncoderVersion % 2 == 0 Beta (1.06) + //EncoderVersion % 2 == 1 Alpha (1.05a...z) + + if ($encoder_version == 0) { + // very old version, not known exactly which + return 'Buschmann v1.7.0-v1.7.9 or Klemm v0.90-v1.05'; + } + + if (($encoder_version % 10) == 0) { + + // release version + return number_format($encoder_version / 100, 2); + + } elseif (($encoder_version % 2) == 0) { + + // beta version + return number_format($encoder_version / 100, 2).' beta'; + + } + + // alpha version + return number_format($encoder_version / 100, 2).' alpha'; + } + +} + + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.mpc_old.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.mpc_old.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,107 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.mpc_old.php | +// | Module for analyzing Musepack/MPEG+ Audio files - SV4-SV6 | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.mpc_old.php,v 1.2 2006/11/02 10:48:01 ah Exp $ + + + +class getid3_mpc_old extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + // http://www.uni-jena.de/~pfk/mpp/sv8/header.html + + $getid3->info['mpc']['header'] = array (); + $info_mpc_header = &$getid3->info['mpc']['header']; + + $getid3->info['fileformat'] = 'mpc'; + $getid3->info['audio']['dataformat'] = 'mpc'; + $getid3->info['audio']['bitrate_mode'] = 'vbr'; + $getid3->info['audio']['channels'] = 2; // the format appears to be hardcoded for stereo only + $getid3->info['audio']['lossless'] = false; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + + $info_mpc_header['size'] = 8; + $getid3->info['avdataoffset'] += $info_mpc_header['size']; + + $mpc_header_data = fread($getid3->fp, $info_mpc_header['size']); + + + // Most of this code adapted from Jurgen Faul's MPEGplus source code - thanks Jurgen! :) + $header_dword[0] = getid3_lib::LittleEndian2Int(substr($mpc_header_data, 0, 4)); + $header_dword[1] = getid3_lib::LittleEndian2Int(substr($mpc_header_data, 4, 4)); + + + // DDDD DDDD CCCC CCCC BBBB BBBB AAAA AAAA + // aaaa aaaa abcd dddd dddd deee eeff ffff + // + // a = bitrate = anything + // b = IS = anything + // c = MS = anything + // d = streamversion = 0000000004 or 0000000005 or 0000000006 + // e = maxband = anything + // f = blocksize = 000001 for SV5+, anything(?) for SV4 + + $info_mpc_header['target_bitrate'] = (($header_dword[0] & 0xFF800000) >> 23); + $info_mpc_header['intensity_stereo'] = (bool)(($header_dword[0] & 0x00400000) >> 22); + $info_mpc_header['mid-side_stereo'] = (bool)(($header_dword[0] & 0x00200000) >> 21); + $info_mpc_header['stream_major_version'] = ($header_dword[0] & 0x001FF800) >> 11; + $info_mpc_header['stream_minor_version'] = 0; + $info_mpc_header['max_band'] = ($header_dword[0] & 0x000007C0) >> 6; // related to lowpass frequency, not sure how it translates exactly + $info_mpc_header['block_size'] = ($header_dword[0] & 0x0000003F); + + switch ($info_mpc_header['stream_major_version']) { + case 4: + $info_mpc_header['frame_count'] = ($header_dword[1] >> 16); + break; + case 5: + case 6: + $info_mpc_header['frame_count'] = $header_dword[1]; + break; + + default: + throw new getid3_exception('Expecting 4, 5 or 6 in version field, found '.$info_mpc_header['stream_major_version'].' instead'); + } + + if (($info_mpc_header['stream_major_version'] > 4) && ($info_mpc_header['block_size'] != 1)) { + $getid3->warning('Block size expected to be 1, actual value found: '.$info_mpc_header['block_size']); + } + + $info_mpc_header['sample_rate'] = $getid3->info['audio']['sample_rate'] = 44100; // AB: used by all files up to SV7 + $info_mpc_header['samples'] = $info_mpc_header['frame_count'] * 1152 * $getid3->info['audio']['channels']; + + $getid3->info['audio']['bitrate_mode'] = $info_mpc_header['target_bitrate'] == 0 ? 'vbr' : 'cbr'; + + $getid3->info['mpc']['bitrate'] = ($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8 * 44100 / $info_mpc_header['frame_count'] / 1152; + $getid3->info['audio']['bitrate'] = $getid3->info['mpc']['bitrate']; + $getid3->info['audio']['encoder'] = 'SV'.$info_mpc_header['stream_major_version']; + + return true; + } + +} + + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.optimfrog.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.optimfrog.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,468 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.optimfrog.php | +// | Module for analyzing OptimFROG Audio files | +// | dependencies: module.audio-video.riff.php | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.optimfrog.php,v 1.3 2006/11/02 10:48:01 ah Exp $ + + + +class getid3_optimfrog extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->include_module('audio-video.riff'); + + $getid3->info['audio']['dataformat'] = 'ofr'; + $getid3->info['audio']['bitrate_mode'] = 'vbr'; + $getid3->info['audio']['lossless'] = true; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $ofr_header = fread($getid3->fp, 8); + + if (substr($ofr_header, 0, 5) == '*RIFF') { + return $this->ParseOptimFROGheader42($getid3->fp, $getid3->info); + + } elseif (substr($ofr_header, 0, 3) == 'OFR') { + return $this->ParseOptimFROGheader45($getid3->fp, $getid3->info); + } + + throw new getid3_exception('Expecting "*RIFF" or "OFR " at offset '.$getid3->info['avdataoffset'].', found "'.$ofr_header.'"'); + } + + + + private function ParseOptimFROGheader42() { + + $getid3 = $this->getid3; + + // for fileformat of v4.21 and older + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + + $ofr_header_data = fread($getid3->fp, 45); + $getid3->info['avdataoffset'] = 45; + + $ofr_encoder_version_raw = getid3_lib::LittleEndian2Int(substr($ofr_header_data, 0, 1)); + $ofr_encoder_version_major = floor($ofr_encoder_version_raw / 10); + $ofr_encoder_version_minor = $ofr_encoder_version_raw - ($ofr_encoder_version_major * 10); + $riff_data = substr($ofr_header_data, 1, 44); + $origna_riff_header_size = getid3_lib::LittleEndian2Int(substr($riff_data, 4, 4)) + 8; + $origna_riff_data_size = getid3_lib::LittleEndian2Int(substr($riff_data, 40, 4)) + 44; + + if ($origna_riff_header_size > $origna_riff_data_size) { + $getid3->info['avdataend'] -= ($origna_riff_header_size - $origna_riff_data_size); + fseek($getid3->fp, $getid3->info['avdataend'], SEEK_SET); + $riff_data .= fread($getid3->fp, $origna_riff_header_size - $origna_riff_data_size); + } + + // move the data chunk after all other chunks (if any) + // so that the RIFF parser doesn't see EOF when trying + // to skip over the data chunk + + $riff_data = substr($riff_data, 0, 36).substr($riff_data, 44).substr($riff_data, 36, 8); + + // Save audio info key + $saved_info_audio = $getid3->info['audio']; + + // Instantiate riff module and analyze string + $riff = new getid3_riff($getid3); + $riff->AnalyzeString($riff_data); + + // Restore info key + $getid3->info['audio'] = $saved_info_audio; + + $getid3->info['audio']['encoder'] = 'OptimFROG '.$ofr_encoder_version_major.'.'.$ofr_encoder_version_minor; + $getid3->info['audio']['channels'] = $getid3->info['riff']['audio'][0]['channels']; + $getid3->info['audio']['sample_rate'] = $getid3->info['riff']['audio'][0]['sample_rate']; + $getid3->info['audio']['bits_per_sample'] = $getid3->info['riff']['audio'][0]['bits_per_sample']; + $getid3->info['playtime_seconds'] = $origna_riff_data_size / ($getid3->info['audio']['channels'] * $getid3->info['audio']['sample_rate'] * ($getid3->info['audio']['bits_per_sample'] / 8)); + $getid3->info['audio']['bitrate'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / $getid3->info['playtime_seconds']; + + $getid3->info['fileformat'] = 'ofr'; + + return true; + } + + + + private function ParseOptimFROGheader45() { + + $getid3 = $this->getid3; + + // for fileformat of v4.50a and higher + + $riff_data = ''; + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + + while (!feof($getid3->fp) && (ftell($getid3->fp) < $getid3->info['avdataend'])) { + + $block_offset = ftell($getid3->fp); + $block_data = fread($getid3->fp, 8); + $offset = 8; + $block_name = substr($block_data, 0, 4); + $block_size = getid3_lib::LittleEndian2Int(substr($block_data, 4, 4)); + + if ($block_name == 'OFRX') { + $block_name = 'OFR '; + } + if (!isset($getid3->info['ofr'][$block_name])) { + $getid3->info['ofr'][$block_name] = array (); + } + $info_ofr_this_block = &$getid3->info['ofr'][$block_name]; + + switch ($block_name) { + case 'OFR ': + + // shortcut + $info_ofr_this_block['offset'] = $block_offset; + $info_ofr_this_block['size'] = $block_size; + + $getid3->info['audio']['encoder'] = 'OptimFROG 4.50 alpha'; + switch ($block_size) { + case 12: + case 15: + // good + break; + + default: + $getid3->warning('"'.$block_name.'" contains more data than expected (expected 12 or 15 bytes, found '.$block_size.' bytes)'); + break; + } + $block_data .= fread($getid3->fp, $block_size); + + $info_ofr_this_block['total_samples'] = getid3_lib::LittleEndian2Int(substr($block_data, $offset, 6)); + $offset += 6; + + $info_ofr_this_block['raw']['sample_type'] = getid3_lib::LittleEndian2Int($block_data{$offset++}); + $info_ofr_this_block['sample_type'] = $this->OptimFROGsampleTypeLookup($info_ofr_this_block['raw']['sample_type']); + + $info_ofr_this_block['channel_config'] = getid3_lib::LittleEndian2Int($block_data{$offset++}); + $info_ofr_this_block['channels'] = $info_ofr_this_block['channel_config']; + + $info_ofr_this_block['sample_rate'] = getid3_lib::LittleEndian2Int(substr($block_data, $offset, 4)); + $offset += 4; + + if ($block_size > 12) { + + // OFR 4.504b or higher + $info_ofr_this_block['channels'] = $this->OptimFROGchannelConfigNumChannelsLookup($info_ofr_this_block['channel_config']); + $info_ofr_this_block['raw']['encoder_id'] = getid3_lib::LittleEndian2Int(substr($block_data, $offset, 2)); + $info_ofr_this_block['encoder'] = $this->OptimFROGencoderNameLookup($info_ofr_this_block['raw']['encoder_id']); + $offset += 2; + + $info_ofr_this_block['raw']['compression'] = getid3_lib::LittleEndian2Int($block_data{$offset++}); + $info_ofr_this_block['compression'] = $this->OptimFROGcompressionLookup($info_ofr_this_block['raw']['compression']); + $info_ofr_this_block['speedup'] = $this->OptimFROGspeedupLookup($info_ofr_this_block['raw']['compression']); + + $getid3->info['audio']['encoder'] = 'OptimFROG '.$info_ofr_this_block['encoder']; + $getid3->info['audio']['encoder_options'] = '--mode '.$info_ofr_this_block['compression']; + + if ((($info_ofr_this_block['raw']['encoder_id'] & 0xF0) >> 4) == 7) { // v4.507 + if (preg_match('/\.ofs$/i', $getid3->filename)) { + // OptimFROG DualStream format is lossy, but as of v4.507 there is no way to tell the difference + // between lossless and lossy other than the file extension. + $getid3->info['audio']['dataformat'] = 'ofs'; + $getid3->info['audio']['lossless'] = true; + } + } + } + + $getid3->info['audio']['channels'] = $info_ofr_this_block['channels']; + $getid3->info['audio']['sample_rate'] = $info_ofr_this_block['sample_rate']; + $getid3->info['audio']['bits_per_sample'] = $this->OptimFROGbitsPerSampleTypeLookup($info_ofr_this_block['raw']['sample_type']); + break; + + + case 'COMP': + // unlike other block types, there CAN be multiple COMP blocks + + $comp_data['offset'] = $block_offset; + $comp_data['size'] = $block_size; + + if ($getid3->info['avdataoffset'] == 0) { + $getid3->info['avdataoffset'] = $block_offset; + } + + // Only interested in first 14 bytes (only first 12 needed for v4.50 alpha), not actual audio data + $block_data .= fread($getid3->fp, 14); + fseek($getid3->fp, $block_size - 14, SEEK_CUR); + + $comp_data['crc_32'] = getid3_lib::LittleEndian2Int(substr($block_data, $offset, 4)); + $offset += 4; + + $comp_data['sample_count'] = getid3_lib::LittleEndian2Int(substr($block_data, $offset, 4)); + $offset += 4; + + $comp_data['raw']['sample_type'] = getid3_lib::LittleEndian2Int($block_data{$offset++}); + $comp_data['sample_type'] = $this->OptimFROGsampleTypeLookup($comp_data['raw']['sample_type']); + + $comp_data['raw']['channel_configuration'] = getid3_lib::LittleEndian2Int($block_data{$offset++}); + $comp_data['channel_configuration'] = $this->OptimFROGchannelConfigurationLookup($comp_data['raw']['channel_configuration']); + + $comp_data['raw']['algorithm_id'] = getid3_lib::LittleEndian2Int(substr($block_data, $offset, 2)); + $offset += 2; + + if ($getid3->info['ofr']['OFR ']['size'] > 12) { + + // OFR 4.504b or higher + $comp_data['raw']['encoder_id'] = getid3_lib::LittleEndian2Int(substr($block_data, $offset, 2)); + $comp_data['encoder'] = $this->OptimFROGencoderNameLookup($comp_data['raw']['encoder_id']); + $offset += 2; + } + + if ($comp_data['crc_32'] == 0x454E4F4E) { + // ASCII value of 'NONE' - placeholder value in v4.50a + $comp_data['crc_32'] = false; + } + + $info_ofr_this_block[] = $comp_data; + break; + + case 'HEAD': + $info_ofr_this_block['offset'] = $block_offset; + $info_ofr_this_block['size'] = $block_size; + + $riff_data .= fread($getid3->fp, $block_size); + break; + + case 'TAIL': + $info_ofr_this_block['offset'] = $block_offset; + $info_ofr_this_block['size'] = $block_size; + + if ($block_size > 0) { + $riff_data .= fread($getid3->fp, $block_size); + } + break; + + case 'RECV': + // block contains no useful meta data - simply note and skip + + $info_ofr_this_block['offset'] = $block_offset; + $info_ofr_this_block['size'] = $block_size; + + fseek($getid3->fp, $block_size, SEEK_CUR); + break; + + + case 'APET': + // APEtag v2 + + $info_ofr_this_block['offset'] = $block_offset; + $info_ofr_this_block['size'] = $block_size; + $getid3->warning('APEtag processing inside OptimFROG not supported in this version ('.GETID3_VERSION.') of getID3()'); + + fseek($getid3->fp, $block_size, SEEK_CUR); + break; + + + case 'MD5 ': + // APEtag v2 + + $info_ofr_this_block['offset'] = $block_offset; + $info_ofr_this_block['size'] = $block_size; + + if ($block_size == 16) { + + $info_ofr_this_block['md5_binary'] = fread($getid3->fp, $block_size); + $info_ofr_this_block['md5_string'] = getid3_lib::PrintHexBytes($info_ofr_this_block['md5_binary'], true, false, false); + $getid3->info['md5_data_source'] = $info_ofr_this_block['md5_string']; + + } else { + + $getid3->warning('Expecting block size of 16 in "MD5 " chunk, found '.$block_size.' instead'); + fseek($getid3->fp, $block_size, SEEK_CUR); + + } + break; + + + default: + $info_ofr_this_block['offset'] = $block_offset; + $info_ofr_this_block['size'] = $block_size; + + $getid3->warning('Unhandled OptimFROG block type "'.$block_name.'" at offset '.$info_ofr_this_block['offset']); + fseek($getid3->fp, $block_size, SEEK_CUR); + break; + } + } + + if (isset($getid3->info['ofr']['TAIL']['offset'])) { + $getid3->info['avdataend'] = $getid3->info['ofr']['TAIL']['offset']; + } + + $getid3->info['playtime_seconds'] = (float)$getid3->info['ofr']['OFR ']['total_samples'] / ($getid3->info['audio']['channels'] * $getid3->info['audio']['sample_rate']); + $getid3->info['audio']['bitrate'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / $getid3->info['playtime_seconds']; + + // move the data chunk after all other chunks (if any) + // so that the RIFF parser doesn't see EOF when trying + // to skip over the data chunk + + $riff_data = substr($riff_data, 0, 36).substr($riff_data, 44).substr($riff_data, 36, 8); + + // Save audio info key + $saved_info_audio = $getid3->info['audio']; + + // Instantiate riff module and analyze string + $riff = new getid3_riff($getid3); + $riff->AnalyzeString($riff_data); + + // Restore info key + $getid3->info['audio'] = $saved_info_audio; + + $getid3->info['fileformat'] = 'ofr'; + + return true; + } + + + + public static function OptimFROGsampleTypeLookup($sample_type) { + + static $lookup = array ( + 0 => 'unsigned int (8-bit)', + 1 => 'signed int (8-bit)', + 2 => 'unsigned int (16-bit)', + 3 => 'signed int (16-bit)', + 4 => 'unsigned int (24-bit)', + 5 => 'signed int (24-bit)', + 6 => 'unsigned int (32-bit)', + 7 => 'signed int (32-bit)', + 8 => 'float 0.24 (32-bit)', + 9 => 'float 16.8 (32-bit)', + 10 => 'float 24.0 (32-bit)' + ); + + return @$lookup[$sample_type]; + } + + + + public static function OptimFROGbitsPerSampleTypeLookup($sample_type) { + + static $lookup = array ( + 0 => 8, + 1 => 8, + 2 => 16, + 3 => 16, + 4 => 24, + 5 => 24, + 6 => 32, + 7 => 32, + 8 => 32, + 9 => 32, + 10 => 32 + ); + + return @$lookup[$sample_type]; + } + + + + public static function OptimFROGchannelConfigurationLookup($channel_configuration) { + + static $lookup = array ( + 0 => 'mono', + 1 => 'stereo' + ); + + return @$lookup[$channel_configuration]; + } + + + + public static function OptimFROGchannelConfigNumChannelsLookup($channel_configuration) { + + static $lookup = array ( + 0 => 1, + 1 => 2 + ); + + return @$lookup[$channel_configuration]; + } + + + + public static function OptimFROGencoderNameLookup($encoder_id) { + + // version = (encoderID >> 4) + 4500 + // system = encoderID & 0xF + + $encoder_version = number_format(((($encoder_id & 0xF0) >> 4) + 4500) / 1000, 3); + $encoder_system_id = ($encoder_id & 0x0F); + + static $lookup = array ( + 0x00 => 'Windows console', + 0x01 => 'Linux console', + 0x0F => 'unknown' + ); + return $encoder_version.' ('.(isset($lookup[$encoder_system_id]) ? $lookup[$encoder_system_id] : 'undefined encoder type (0x'.dechex($encoder_system_id).')').')'; + } + + + + public static function OptimFROGcompressionLookup($compression_id) { + + // mode = compression >> 3 + // speedup = compression & 0x07 + + $compression_mode_id = ($compression_id & 0xF8) >> 3; + //$compression_speed_up_id = ($compression_id & 0x07); + + static $lookup = array ( + 0x00 => 'fast', + 0x01 => 'normal', + 0x02 => 'high', + 0x03 => 'extra', // extranew (some versions) + 0x04 => 'best', // bestnew (some versions) + 0x05 => 'ultra', + 0x06 => 'insane', + 0x07 => 'highnew', + 0x08 => 'extranew', + 0x09 => 'bestnew' + ); + return (isset($lookup[$compression_mode_id]) ? $lookup[$compression_mode_id] : 'undefined mode (0x'.str_pad(dechex($compression_mode_id), 2, '0', STR_PAD_LEFT).')'); + } + + + + public static function OptimFROGspeedupLookup($compression_id) { + + // mode = compression >> 3 + // speedup = compression & 0x07 + + //$compression_mode_id = ($compression_id & 0xF8) >> 3; + $compression_speed_up_id = ($compression_id & 0x07); + + static $lookup = array ( + 0x00 => '1x', + 0x01 => '2x', + 0x02 => '4x' + ); + + return (isset($lookup[$compression_speed_up_id]) ? $lookup[$compression_speed_up_id] : 'undefined mode (0x'.dechex($compression_speed_up_id)); + } + +} + + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.rkau.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.rkau.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,101 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.rkau.php | +// | Module for analyzing RKAU Audio files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.rkau.php,v 1.2 2006/11/02 10:48:01 ah Exp $ + + + +class getid3_rkau extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $rkau_header = fread($getid3->fp, 20); + + // Magic bytes 'RKA' + + $getid3->info['fileformat'] = 'rkau'; + $getid3->info['audio']['dataformat'] = 'rkau'; + $getid3->info['audio']['bitrate_mode'] = 'vbr'; + + // Shortcut + $getid3->info['rkau'] = array (); + $info_rkau = &$getid3->info['rkau']; + + $info_rkau['raw']['version'] = getid3_lib::LittleEndian2Int(substr($rkau_header, 3, 1)); + $info_rkau['version'] = '1.'.str_pad($info_rkau['raw']['version'] & 0x0F, 2, '0', STR_PAD_LEFT); + if (($info_rkau['version'] > 1.07) || ($info_rkau['version'] < 1.06)) { + throw new getid3_exception('This version of getID3() can only parse RKAU files v1.06 and 1.07 (this file is v'.$info_rkau['version'].')'); + } + + getid3_lib::ReadSequence('LittleEndian2Int', $info_rkau, $rkau_header, 4, + array ( + 'source_bytes' => 4, + 'sample_rate' => 4, + 'channels' => 1, + 'bits_per_sample' => 1 + ) + ); + + $info_rkau['raw']['quality'] = getid3_lib::LittleEndian2Int(substr($rkau_header, 14, 1)); + + $quality = $info_rkau['raw']['quality'] & 0x0F; + + $info_rkau['lossless'] = (($quality == 0) ? true : false); + $info_rkau['compression_level'] = (($info_rkau['raw']['quality'] & 0xF0) >> 4) + 1; + if (!$info_rkau['lossless']) { + $info_rkau['quality_setting'] = $quality; + } + + $info_rkau['raw']['flags'] = getid3_lib::LittleEndian2Int(substr($rkau_header, 15, 1)); + $info_rkau['flags']['joint_stereo'] = (bool)(!($info_rkau['raw']['flags'] & 0x01)); + $info_rkau['flags']['streaming'] = (bool) ($info_rkau['raw']['flags'] & 0x02); + $info_rkau['flags']['vrq_lossy_mode'] = (bool) ($info_rkau['raw']['flags'] & 0x04); + + if ($info_rkau['flags']['streaming']) { + $getid3->info['avdataoffset'] += 20; + $info_rkau['compressed_bytes'] = getid3_lib::LittleEndian2Int(substr($rkau_header, 16, 4)); + } + else { + $getid3->info['avdataoffset'] += 16; + $info_rkau['compressed_bytes'] = $getid3->info['avdataend'] - $getid3->info['avdataoffset'] - 1; + } + // Note: compressed_bytes does not always equal what appears to be the actual number of compressed bytes, + // sometimes it's more, sometimes less. No idea why(?) + + $getid3->info['audio']['lossless'] = $info_rkau['lossless']; + $getid3->info['audio']['channels'] = $info_rkau['channels']; + $getid3->info['audio']['bits_per_sample'] = $info_rkau['bits_per_sample']; + $getid3->info['audio']['sample_rate'] = $info_rkau['sample_rate']; + + $getid3->info['playtime_seconds'] = $info_rkau['source_bytes'] / ($info_rkau['sample_rate'] * $info_rkau['channels'] * ($info_rkau['bits_per_sample'] / 8)); + $getid3->info['audio']['bitrate'] = ($info_rkau['compressed_bytes'] * 8) / $getid3->info['playtime_seconds']; + + return true; + + } + +} + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.shorten.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.shorten.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,121 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.shorten.php | +// | Module for analyzing Shorten Audio files | +// | dependencies: module.audio-video.riff.php | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.shorten.php,v 1.5 2006/12/03 19:28:18 ah Exp $ + + + +class getid3_shorten extends getid3_handler +{ + + public function __construct(getID3 $getid3) { + + parent::__construct($getid3); + + if ((bool)ini_get('safe_mode')) { + throw new getid3_exception('PHP running in Safe Mode - backtick operator not available, cannot analyze Shorten files.'); + } + + if (!`head --version`) { + throw new getid3_exception('head[.exe] binary not found in path. UNIX: typically /usr/bin. Windows: typically c:\windows\system32.'); + } + + if (!`shorten -l`) { + throw new getid3_exception('shorten[.exe] binary not found in path. UNIX: typically /usr/bin. Windows: typically c:\windows\system32.'); + } + } + + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->include_module('audio-video.riff'); + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + + $shn_header = fread($getid3->fp, 8); + + // Magic bytes: "ajkg" + + $getid3->info['fileformat'] = 'shn'; + $getid3->info['audio']['dataformat'] = 'shn'; + $getid3->info['audio']['lossless'] = true; + $getid3->info['audio']['bitrate_mode'] = 'vbr'; + + $getid3->info['shn']['version'] = getid3_lib::LittleEndian2Int($shn_header{4}); + + fseek($getid3->fp, $getid3->info['avdataend'] - 12, SEEK_SET); + + $seek_table_signature_test = fread($getid3->fp, 12); + + $getid3->info['shn']['seektable']['present'] = (bool)(substr($seek_table_signature_test, 4, 8) == 'SHNAMPSK'); + if ($getid3->info['shn']['seektable']['present']) { + + $getid3->info['shn']['seektable']['length'] = getid3_lib::LittleEndian2Int(substr($seek_table_signature_test, 0, 4)); + $getid3->info['shn']['seektable']['offset'] = $getid3->info['avdataend'] - $getid3->info['shn']['seektable']['length']; + fseek($getid3->fp, $getid3->info['shn']['seektable']['offset'], SEEK_SET); + $seek_table_magic = fread($getid3->fp, 4); + + if ($seek_table_magic != 'SEEK') { + + throw new getid3_exception('Expecting "SEEK" at offset '.$getid3->info['shn']['seektable']['offset'].', found "'.$seek_table_magic.'"'); + } + + $seek_table_data = fread($getid3->fp, $getid3->info['shn']['seektable']['length'] - 16); + $getid3->info['shn']['seektable']['entry_count'] = floor(strlen($seek_table_data) / 80); + } + + $commandline = 'shorten -x '.escapeshellarg(realpath($getid3->filename)).' - | head -c 64'; + $output = `$commandline`; + + if (@$output && substr($output, 12, 4) == 'fmt ') { + + $fmt_size = getid3_lib::LittleEndian2Int(substr($output, 16, 4)); + $decoded_wav_format_ex = getid3_riff::RIFFparseWAVEFORMATex(substr($output, 20, $fmt_size)); + + $getid3->info['audio']['channels'] = $decoded_wav_format_ex['channels']; + $getid3->info['audio']['bits_per_sample'] = $decoded_wav_format_ex['bits_per_sample']; + $getid3->info['audio']['sample_rate'] = $decoded_wav_format_ex['sample_rate']; + + if (substr($output, 20 + $fmt_size, 4) == 'data') { + + $getid3->info['playtime_seconds'] = getid3_lib::LittleEndian2Int(substr($output, 20 + 4 + $fmt_size, 4)) / $decoded_wav_format_ex['raw']['nAvgBytesPerSec']; + + } else { + + throw new getid3_exception('shorten failed to decode DATA chunk to expected location, cannot determine playtime'); + } + + $getid3->info['audio']['bitrate'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) / $getid3->info['playtime_seconds']) * 8; + + } else { + + throw new getid3_exception('shorten failed to decode file to WAV for parsing'); + return false; + } + + return true; + } + +} + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.tta.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.tta.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,125 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.tta.php | +// | Module for analyzing TTA Audio files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.tta.php,v 1.2 2006/11/02 10:48:01 ah Exp $ + + + +class getid3_tta extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->info['fileformat'] = 'tta'; + $getid3->info['audio']['dataformat'] = 'tta'; + $getid3->info['audio']['lossless'] = true; + $getid3->info['audio']['bitrate_mode'] = 'vbr'; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $tta_header = fread($getid3->fp, 26); + + $getid3->info['tta']['magic'] = 'TTA'; // Magic bytes + + switch ($tta_header{3}) { + + case "\x01": // TTA v1.x + case "\x02": // TTA v1.x + case "\x03": // TTA v1.x + + // "It was the demo-version of the TTA encoder. There is no released format with such header. TTA encoder v1 is not supported about a year." + $getid3->info['tta']['major_version'] = 1; + $getid3->info['avdataoffset'] += 16; + + getid3_lib::ReadSequence('LittleEndian2Int', $getid3->info['tta'], $tta_header, 4, + array ( + 'channels' => 2, + 'bits_per_sample' => 2, + 'sample_rate' => 4, + 'samples_per_channel' => 4 + ) + ); + $getid3->info['tta']['compression_level'] = ord($tta_header{3}); + + $getid3->info['audio']['encoder_options'] = '-e'.$getid3->info['tta']['compression_level']; + $getid3->info['playtime_seconds'] = $getid3->info['tta']['samples_per_channel'] / $getid3->info['tta']['sample_rate']; + break; + + case '2': // TTA v2.x + // "I have hurried to release the TTA 2.0 encoder. Format documentation is removed from our site. This format still in development. Please wait the TTA2 format, encoder v4." + $getid3->info['tta']['major_version'] = 2; + $getid3->info['avdataoffset'] += 20; + + getid3_lib::ReadSequence('LittleEndian2Int', $getid3->info['tta'], $tta_header, 4, + array ( + 'compression_level' => 2, + 'audio_format' => 2, + 'channels' => 2, + 'bits_per_sample' => 2, + 'sample_rate' => 4, + 'data_length' => 4 + ) + ); + + $getid3->info['audio']['encoder_options'] = '-e'.$getid3->info['tta']['compression_level']; + $getid3->info['playtime_seconds'] = $getid3->info['tta']['data_length'] / $getid3->info['tta']['sample_rate']; + break; + + case '1': // TTA v3.x + // "This is a first stable release of the TTA format. It will be supported by the encoders v3 or higher." + $getid3->info['tta']['major_version'] = 3; + $getid3->info['avdataoffset'] += 26; + + getid3_lib::ReadSequence('LittleEndian2Int', $getid3->info['tta'], $tta_header, 4, + array ( + 'audio_format' => 2, + 'channels' => 2, + 'bits_per_sample'=> 2, + 'sample_rate' => 4, + 'data_length' => 4, + 'crc32_footer' => -4, // string + 'seek_point' => 4 + ) + ); + + $getid3->info['playtime_seconds'] = $getid3->info['tta']['data_length'] / $getid3->info['tta']['sample_rate']; + break; + + default: + throw new getid3_exception('This version of getID3() only knows how to handle TTA v1, v2 and v3 - it may not work correctly with this file which appears to be TTA v'.$tta_header{3}); + return false; + break; + } + + $getid3->info['audio']['encoder'] = 'TTA v'.$getid3->info['tta']['major_version']; + $getid3->info['audio']['bits_per_sample'] = $getid3->info['tta']['bits_per_sample']; + $getid3->info['audio']['sample_rate'] = $getid3->info['tta']['sample_rate']; + $getid3->info['audio']['channels'] = $getid3->info['tta']['channels']; + $getid3->info['audio']['bitrate'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / $getid3->info['playtime_seconds']; + + return true; + } + +} + + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.voc.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.voc.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,240 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.voc.php | +// | Module for analyzing Creative VOC Audio files. | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.voc.php,v 1.3 2006/11/02 10:48:02 ah Exp $ + + + +class getid3_voc extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $original_av_data_offset = $getid3->info['avdataoffset']; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $voc_header= fread($getid3->fp, 26); + + // Magic bytes: 'Creative Voice File' + + $info_audio = &$getid3->info['audio']; + $getid3->info['voc'] = array (); + $info_voc = &$getid3->info['voc']; + + $getid3->info['fileformat'] = 'voc'; + $info_audio['dataformat'] = 'voc'; + $info_audio['bitrate_mode'] = 'cbr'; + $info_audio['lossless'] = true; + $info_audio['channels'] = 1; // might be overriden below + $info_audio['bits_per_sample'] = 8; // might be overriden below + + // byte # Description + // ------ ------------------------------------------ + // 00-12 'Creative Voice File' + // 13 1A (eof to abort printing of file) + // 14-15 Offset of first datablock in .voc file (std 1A 00 in Intel Notation) + // 16-17 Version number (minor,major) (VOC-HDR puts 0A 01) + // 18-19 2's Comp of Ver. # + 1234h (VOC-HDR puts 29 11) + + getid3_lib::ReadSequence('LittleEndian2Int', $info_voc['header'], $voc_header, 20, + array ( + 'datablock_offset' => 2, + 'minor_version' => 1, + 'major_version' => 1 + ) + ); + + do { + $block_offset = ftell($getid3->fp); + $block_data = fread($getid3->fp, 4); + $block_type = ord($block_data{0}); + $block_size = getid3_lib::LittleEndian2Int(substr($block_data, 1, 3)); + $this_block = array (); + + @$info_voc['blocktypes'][$block_type]++; + + switch ($block_type) { + + case 0: // Terminator + // do nothing, we'll break out of the loop down below + break; + + case 1: // Sound data + $block_data .= fread($getid3->fp, 2); + if ($getid3->info['avdataoffset'] <= $original_av_data_offset) { + $getid3->info['avdataoffset'] = ftell($getid3->fp); + } + fseek($getid3->fp, $block_size - 2, SEEK_CUR); + + getid3_lib::ReadSequence('LittleEndian2Int', $this_block, $block_data, 4, + array ( + 'sample_rate_id' => 1, + 'compression_type' => 1 + ) + ); + + $this_block['compression_name'] = getid3_voc::VOCcompressionTypeLookup($this_block['compression_type']); + if ($this_block['compression_type'] <= 3) { + $info_voc['compressed_bits_per_sample'] = (int)(str_replace('-bit', '', $this_block['compression_name'])); + } + + // Less accurate sample_rate calculation than the Extended block (#8) data (but better than nothing if Extended Block is not available) + if (empty($info_audio['sample_rate'])) { + // SR byte = 256 - (1000000 / sample_rate) + $info_audio['sample_rate'] = (int)floor((1000000 / (256 - $this_block['sample_rate_id'])) / $info_audio['channels']); + } + break; + + case 2: // Sound continue + case 3: // Silence + case 4: // Marker + case 6: // Repeat + case 7: // End repeat + // nothing useful, just skip + fseek($getid3->fp, $block_size, SEEK_CUR); + break; + + case 8: // Extended + $block_data .= fread($getid3->fp, 4); + + //00-01 Time Constant: + // Mono: 65536 - (256000000 / sample_rate) + // Stereo: 65536 - (256000000 / (sample_rate * 2)) + getid3_lib::ReadSequence('LittleEndian2Int', $this_block, $block_data, 4, + array ( + 'time_constant' => 2, + 'pack_method' => 1, + 'stereo' => 1 + ) + ); + $this_block['stereo'] = (bool)$this_block['stereo']; + + $info_audio['channels'] = ($this_block['stereo'] ? 2 : 1); + $info_audio['sample_rate'] = (int)floor((256000000 / (65536 - $this_block['time_constant'])) / $info_audio['channels']); + break; + + case 9: // data block that supersedes blocks 1 and 8. Used for stereo, 16 bit + $block_data .= fread($getid3->fp, 12); + if ($getid3->info['avdataoffset'] <= $original_av_data_offset) { + $getid3->info['avdataoffset'] = ftell($getid3->fp); + } + fseek($getid3->fp, $block_size - 12, SEEK_CUR); + + getid3_lib::ReadSequence('LittleEndian2Int', $this_block, $block_data, 4, + array ( + 'sample_rate' => 4, + 'bits_per_sample' => 1, + 'channels' => 1, + 'wFormat' => 2 + ) + ); + + $this_block['compression_name'] = getid3_voc::VOCwFormatLookup($this_block['wFormat']); + if (getid3_voc::VOCwFormatActualBitsPerSampleLookup($this_block['wFormat'])) { + $info_voc['compressed_bits_per_sample'] = getid3_voc::VOCwFormatActualBitsPerSampleLookup($this_block['wFormat']); + } + + $info_audio['sample_rate'] = $this_block['sample_rate']; + $info_audio['bits_per_sample'] = $this_block['bits_per_sample']; + $info_audio['channels'] = $this_block['channels']; + break; + + default: + $getid3->warning('Unhandled block type "'.$block_type.'" at offset '.$block_offset); + fseek($getid3->fp, $block_size, SEEK_CUR); + break; + } + + if (!empty($this_block)) { + $this_block['block_offset'] = $block_offset; + $this_block['block_size'] = $block_size; + $this_block['block_type_id'] = $block_type; + $info_voc['blocks'][] = $this_block; + } + + } while (!feof($getid3->fp) && ($block_type != 0)); + + // Terminator block doesn't have size field, so seek back 3 spaces + fseek($getid3->fp, -3, SEEK_CUR); + + ksort($info_voc['blocktypes']); + + if (!empty($info_voc['compressed_bits_per_sample'])) { + $getid3->info['playtime_seconds'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / ($info_voc['compressed_bits_per_sample'] * $info_audio['channels'] * $info_audio['sample_rate']); + $info_audio['bitrate'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / $getid3->info['playtime_seconds']; + } + + return true; + } + + + + public static function VOCcompressionTypeLookup($index) { + + static $lookup = array ( + 0 => '8-bit', + 1 => '4-bit', + 2 => '2.6-bit', + 3 => '2-bit' + ); + return (isset($lookup[$index]) ? $lookup[$index] : 'Multi DAC ('.($index - 3).') channels'); + } + + + + public static function VOCwFormatLookup($index) { + + static $lookup = array ( + 0x0000 => '8-bit unsigned PCM', + 0x0001 => 'Creative 8-bit to 4-bit ADPCM', + 0x0002 => 'Creative 8-bit to 3-bit ADPCM', + 0x0003 => 'Creative 8-bit to 2-bit ADPCM', + 0x0004 => '16-bit signed PCM', + 0x0006 => 'CCITT a-Law', + 0x0007 => 'CCITT u-Law', + 0x2000 => 'Creative 16-bit to 4-bit ADPCM' + ); + return (isset($lookup[$index]) ? $lookup[$index] : false); + } + + + + public static function VOCwFormatActualBitsPerSampleLookup($index) { + + static $lookup = array ( + 0x0000 => 8, + 0x0001 => 4, + 0x0002 => 3, + 0x0003 => 2, + 0x0004 => 16, + 0x0006 => 8, + 0x0007 => 8, + 0x2000 => 4 + ); + return (isset($lookup[$index]) ? $lookup[$index] : false); + } + +} + + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.vqf.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.vqf.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,164 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.vqf.php | +// | Module for analyzing VQF Audio files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.vqf.php,v 1.3 2006/11/16 23:16:31 ah Exp $ + + + +class getid3_vqf extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + // based loosely on code from TTwinVQ by Jurgen Faul + // http://jfaul.de/atl or http://j-faul.virtualave.net/atl/atl.html + + $getid3->info['fileformat'] = 'vqf'; + $getid3->info['audio']['dataformat'] = 'vqf'; + $getid3->info['audio']['bitrate_mode'] = 'cbr'; + $getid3->info['audio']['lossless'] = false; + + // Shortcuts + $getid3->info['vqf']['raw'] = array (); + $info_vqf = &$getid3->info['vqf']; + $info_vqf_raw = &$info_vqf['raw']; + + // Get header + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $vqf_header_data = fread($getid3->fp, 16); + + $info_vqf_raw['header_tag'] = 'TWIN'; // Magic bytes + $info_vqf_raw['version'] = substr($vqf_header_data, 4, 8); + $info_vqf_raw['size'] = getid3_lib::BigEndian2Int(substr($vqf_header_data, 12, 4)); + + while (ftell($getid3->fp) < $getid3->info['avdataend']) { + + $chunk_base_offset = ftell($getid3->fp); + $chunk_data = fread($getid3->fp, 8); + $chunk_name = substr($chunk_data, 0, 4); + + if ($chunk_name == 'DATA') { + $getid3->info['avdataoffset'] = $chunk_base_offset; + break; + } + + $chunk_size = getid3_lib::BigEndian2Int(substr($chunk_data, 4, 4)); + if ($chunk_size > ($getid3->info['avdataend'] - ftell($getid3->fp))) { + throw new getid3_exception('Invalid chunk size ('.$chunk_size.') for chunk "'.$chunk_name.'" at offset 8.'); + } + if ($chunk_size > 0) { + $chunk_data .= fread($getid3->fp, $chunk_size); + } + + switch ($chunk_name) { + + case 'COMM': + $info_vqf['COMM'] = array (); + getid3_lib::ReadSequence('BigEndian2Int', $info_vqf['COMM'], $chunk_data, 8, + array ( + 'channel_mode' => 4, + 'bitrate' => 4, + 'sample_rate' => 4, + 'security_level' => 4 + ) + ); + + $getid3->info['audio']['channels'] = $info_vqf['COMM']['channel_mode'] + 1; + $getid3->info['audio']['sample_rate'] = getid3_vqf::VQFchannelFrequencyLookup($info_vqf['COMM']['sample_rate']); + $getid3->info['audio']['bitrate'] = $info_vqf['COMM']['bitrate'] * 1000; + $getid3->info['audio']['encoder_options'] = 'CBR' . ceil($getid3->info['audio']['bitrate']/1000); + + if ($getid3->info['audio']['bitrate'] == 0) { + throw new getid3_exception('Corrupt VQF file: bitrate_audio == zero'); + } + break; + + case 'NAME': + case 'AUTH': + case '(c) ': + case 'FILE': + case 'COMT': + case 'ALBM': + $info_vqf['comments'][getid3_vqf::VQFcommentNiceNameLookup($chunk_name)][] = trim(substr($chunk_data, 8)); + break; + + case 'DSIZ': + $info_vqf['DSIZ'] = getid3_lib::BigEndian2Int(substr($chunk_data, 8, 4)); + break; + + default: + $getid3->warning('Unhandled chunk type "'.$chunk_name.'" at offset 8'); + break; + } + } + + $getid3->info['playtime_seconds'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / $getid3->info['audio']['bitrate']; + + if (isset($info_vqf['DSIZ']) && (($info_vqf['DSIZ'] != ($getid3->info['avdataend'] - $getid3->info['avdataoffset'] - strlen('DATA'))))) { + switch ($info_vqf['DSIZ']) { + case 0: + case 1: + $getid3->warning('Invalid DSIZ value "'.$info_vqf['DSIZ'].'". This is known to happen with VQF files encoded by Ahead Nero, and seems to be its way of saying this is TwinVQF v'.($info_vqf['DSIZ'] + 1).'.0'); + $getid3->info['audio']['encoder'] = 'Ahead Nero'; + break; + + default: + $getid3->warning('Probable corrupted file - should be '.$info_vqf['DSIZ'].' bytes, actually '.($getid3->info['avdataend'] - $getid3->info['avdataoffset'] - strlen('DATA'))); + break; + } + } + + return true; + } + + + + public static function VQFchannelFrequencyLookup($frequencyid) { + + static $lookup = array ( + 11 => 11025, + 22 => 22050, + 44 => 44100 + ); + return (isset($lookup[$frequencyid]) ? $lookup[$frequencyid] : $frequencyid * 1000); + } + + + + public static function VQFcommentNiceNameLookup($shortname) { + + static $lookup = array ( + 'NAME' => 'title', + 'AUTH' => 'artist', + '(c) ' => 'copyright', + 'FILE' => 'filename', + 'COMT' => 'comment', + 'ALBM' => 'album' + ); + return (isset($lookup[$shortname]) ? $lookup[$shortname] : $shortname); + } + +} + + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.wavpack.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.wavpack.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,399 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.wavpack.php | +// | module for analyzing WavPack v4.0+ Audio files | +// | dependencies: audio-video.riff | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.wavpack.php,v 1.2 2006/11/02 10:48:02 ah Exp $ + + +class getid3_wavpack extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->include_module('audio-video.riff'); + + $getid3->info['wavpack'] = array (); + $info_wavpack = &$getid3->info['wavpack']; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + + while (true) { + + $wavpack_header = fread($getid3->fp, 32); + + if (ftell($getid3->fp) >= $getid3->info['avdataend']) { + break; + } elseif (feof($getid3->fp)) { + break; + } elseif ( + (@$info_wavpack_blockheader['total_samples'] > 0) && + (@$info_wavpack_blockheader['block_samples'] > 0) && + (!isset($info_wavpack['riff_trailer_size']) || ($info_wavpack['riff_trailer_size'] <= 0)) && + ((@$info_wavpack['config_flags']['md5_checksum'] === false) || !empty($getid3->info['md5_data_source']))) { + break; + } + + $block_header_offset = ftell($getid3->fp) - 32; + $block_header_magic = substr($wavpack_header, 0, 4); + $block_header_size = getid3_lib::LittleEndian2Int(substr($wavpack_header, 4, 4)); + + if ($block_header_magic != 'wvpk') { + throw new getid3_exception('Expecting "wvpk" at offset '.$block_header_offset.', found "'.$block_header_magic.'"'); + } + + if ((@$info_wavpack_blockheader['block_samples'] <= 0) || (@$info_wavpack_blockheader['total_samples'] <= 0)) { + + // Also, it is possible that the first block might not have + // any samples (block_samples == 0) and in this case you should skip blocks + // until you find one with samples because the other information (like + // total_samples) are not guaranteed to be correct until (block_samples > 0) + + // Finally, I have defined a format for files in which the length is not known + // (for example when raw files are created using pipes). In these cases + // total_samples will be -1 and you must seek to the final block to determine + // the total number of samples. + + + $getid3->info['audio']['dataformat'] = 'wavpack'; + $getid3->info['fileformat'] = 'wavpack'; + $getid3->info['audio']['lossless'] = true; + $getid3->info['audio']['bitrate_mode'] = 'vbr'; + + $info_wavpack['blockheader']['offset'] = $block_header_offset; + $info_wavpack['blockheader']['magic'] = $block_header_magic; + $info_wavpack['blockheader']['size'] = $block_header_size; + $info_wavpack_blockheader = &$info_wavpack['blockheader']; + + if ($info_wavpack_blockheader['size'] >= 0x100000) { + throw new getid3_exception('Expecting WavPack block size less than "0x100000", found "'.$info_wavpack_blockheader['size'].'" at offset '.$info_wavpack_blockheader['offset']); + } + + $info_wavpack_blockheader['minor_version'] = ord($wavpack_header{8}); + $info_wavpack_blockheader['major_version'] = ord($wavpack_header{9}); + + if (($info_wavpack_blockheader['major_version'] != 4) || + (($info_wavpack_blockheader['minor_version'] < 4) && + ($info_wavpack_blockheader['minor_version'] > 16))) { + throw new getid3_exception('Expecting WavPack version between "4.2" and "4.16", found version "'.$info_wavpack_blockheader['major_version'].'.'.$info_wavpack_blockheader['minor_version'].'" at offset '.$info_wavpack_blockheader['offset']); + } + + $info_wavpack_blockheader['track_number'] = ord($wavpack_header{10}); // unused + $info_wavpack_blockheader['index_number'] = ord($wavpack_header{11}); // unused + + getid3_lib::ReadSequence('LittleEndian2Int', $info_wavpack_blockheader, $wavpack_header, 12, + array ( + 'total_samples' => 4, + 'block_index' => 4, + 'block_samples' => 4, + 'flags_raw' => 4, + 'crc' => 4 + ) + ); + + + $info_wavpack_blockheader['flags']['bytes_per_sample'] = 1 + ($info_wavpack_blockheader['flags_raw'] & 0x00000003); + $info_wavpack_blockheader['flags']['mono'] = (bool) ($info_wavpack_blockheader['flags_raw'] & 0x00000004); + $info_wavpack_blockheader['flags']['hybrid'] = (bool) ($info_wavpack_blockheader['flags_raw'] & 0x00000008); + $info_wavpack_blockheader['flags']['joint_stereo'] = (bool) ($info_wavpack_blockheader['flags_raw'] & 0x00000010); + $info_wavpack_blockheader['flags']['cross_decorrelation'] = (bool) ($info_wavpack_blockheader['flags_raw'] & 0x00000020); + $info_wavpack_blockheader['flags']['hybrid_noiseshape'] = (bool) ($info_wavpack_blockheader['flags_raw'] & 0x00000040); + $info_wavpack_blockheader['flags']['ieee_32bit_float'] = (bool) ($info_wavpack_blockheader['flags_raw'] & 0x00000080); + $info_wavpack_blockheader['flags']['int_32bit'] = (bool) ($info_wavpack_blockheader['flags_raw'] & 0x00000100); + $info_wavpack_blockheader['flags']['hybrid_bitrate_noise'] = (bool) ($info_wavpack_blockheader['flags_raw'] & 0x00000200); + $info_wavpack_blockheader['flags']['hybrid_balance_noise'] = (bool) ($info_wavpack_blockheader['flags_raw'] & 0x00000400); + $info_wavpack_blockheader['flags']['multichannel_initial'] = (bool) ($info_wavpack_blockheader['flags_raw'] & 0x00000800); + $info_wavpack_blockheader['flags']['multichannel_final'] = (bool) ($info_wavpack_blockheader['flags_raw'] & 0x00001000); + + $getid3->info['audio']['lossless'] = !$info_wavpack_blockheader['flags']['hybrid']; + } + + + while (!feof($getid3->fp) && (ftell($getid3->fp) < ($block_header_offset + $block_header_size + 8))) { + + $metablock = array('offset'=>ftell($getid3->fp)); + $metablockheader = fread($getid3->fp, 2); + if (feof($getid3->fp)) { + break; + } + $metablock['id'] = ord($metablockheader{0}); + $metablock['function_id'] = ($metablock['id'] & 0x3F); + $metablock['function_name'] = $this->WavPackMetablockNameLookup($metablock['function_id']); + + // The 0x20 bit in the id of the meta subblocks (which is defined as + // ID_OPTIONAL_DATA) is a permanent part of the id. The idea is that + // if a decoder encounters an id that it does not know about, it uses + // that "ID_OPTIONAL_DATA" flag to determine what to do. If it is set + // then the decoder simply ignores the metadata, but if it is zero + // then the decoder should quit because it means that an understanding + // of the metadata is required to correctly decode the audio. + + $metablock['non_decoder'] = (bool) ($metablock['id'] & 0x20); + $metablock['padded_data'] = (bool) ($metablock['id'] & 0x40); + $metablock['large_block'] = (bool) ($metablock['id'] & 0x80); + if ($metablock['large_block']) { + $metablockheader .= fread($getid3->fp, 2); + } + $metablock['size'] = getid3_lib::LittleEndian2Int(substr($metablockheader, 1)) * 2; // size is stored in words + $metablock['data'] = null; + + if ($metablock['size'] > 0) { + + switch ($metablock['function_id']) { + + case 0x21: // ID_RIFF_HEADER + case 0x22: // ID_RIFF_TRAILER + case 0x23: // ID_REPLAY_GAIN + case 0x24: // ID_CUESHEET + case 0x25: // ID_CONFIG_BLOCK + case 0x26: // ID_MD5_CHECKSUM + $metablock['data'] = fread($getid3->fp, $metablock['size']); + + if ($metablock['padded_data']) { + // padded to the nearest even byte + $metablock['size']--; + $metablock['data'] = substr($metablock['data'], 0, -1); + } + break; + + + case 0x00: // ID_DUMMY + case 0x01: // ID_ENCODER_INFO + case 0x02: // ID_DECORR_TERMS + case 0x03: // ID_DECORR_WEIGHTS + case 0x04: // ID_DECORR_SAMPLES + case 0x05: // ID_ENTROPY_VARS + case 0x06: // ID_HYBRID_PROFILE + case 0x07: // ID_SHAPING_WEIGHTS + case 0x08: // ID_FLOAT_INFO + case 0x09: // ID_INT32_INFO + case 0x0A: // ID_WV_BITSTREAM + case 0x0B: // ID_WVC_BITSTREAM + case 0x0C: // ID_WVX_BITSTREAM + case 0x0D: // ID_CHANNEL_INFO + fseek($getid3->fp, $metablock['offset'] + ($metablock['large_block'] ? 4 : 2) + $metablock['size'], SEEK_SET); + break; + + + default: + $getid3->warning('Unexpected metablock type "0x'.str_pad(dechex($metablock['function_id']), 2, '0', STR_PAD_LEFT).'" at offset '.$metablock['offset']); + fseek($getid3->fp, $metablock['offset'] + ($metablock['large_block'] ? 4 : 2) + $metablock['size'], SEEK_SET); + break; + } + + + switch ($metablock['function_id']) { + + case 0x21: // ID_RIFF_HEADER + + $original_wav_filesize = getid3_lib::LittleEndian2Int(substr($metablock['data'], 4, 4)); + + // Clone getid3 + $clone = clone $getid3; + + // Analyze clone by string + $riff = new getid3_riff($clone); + $riff->AnalyzeString($metablock['data']); + + // Import from clone and destroy + $metablock['riff'] = $clone->info['riff']; + $getid3->warnings($clone->warnings()); + unset($clone); + + // Save RIFF header - we may need it later for RIFF footer parsing + $this->riff_header = $metablock['data']; + + $metablock['riff']['original_filesize'] = $original_wav_filesize; + $info_wavpack['riff_trailer_size'] = $original_wav_filesize - $metablock['riff']['WAVE']['data'][0]['size'] - $metablock['riff']['header_size']; + + $getid3->info['audio']['sample_rate'] = $metablock['riff']['raw']['fmt ']['nSamplesPerSec']; + $getid3->info['playtime_seconds'] = $info_wavpack_blockheader['total_samples'] / $getid3->info['audio']['sample_rate']; + + // Safe RIFF header in case there's a RIFF footer later + $metablock_riff_header = $metablock['data']; + break; + + + case 0x22: // ID_RIFF_TRAILER + + $metablock_riff_footer = $metablock_riff_header.$metablock['data']; + + $start_offset = $metablock['offset'] + ($metablock['large_block'] ? 4 : 2); + + $ftell_old = ftell($getid3->fp); + + // Clone getid3 + $clone = clone $getid3; + + // Call public method that really should be private + $riff = new getid3_riff($clone); + $metablock['riff'] = $riff->ParseRIFF($start_offset, $start_offset + $metablock['size']); + unset($clone); + + fseek($getid3->fp, $ftell_old, SEEK_SET); + + if (!empty($metablock['riff']['INFO'])) { + getid3_riff::RIFFCommentsParse($metablock['riff']['INFO'], $metablock['comments']); + $getid3->info['tags']['riff'] = $metablock['comments']; + } + break; + + + case 0x23: // ID_REPLAY_GAIN + $getid3->warning('WavPack "Replay Gain" contents not yet handled by getID3() in metablock at offset '.$metablock['offset']); + break; + + + case 0x24: // ID_CUESHEET + $getid3->warning('WavPack "Cuesheet" contents not yet handled by getID3() in metablock at offset '.$metablock['offset']); + break; + + + case 0x25: // ID_CONFIG_BLOCK + $metablock['flags_raw'] = getid3_lib::LittleEndian2Int(substr($metablock['data'], 0, 3)); + + $metablock['flags']['adobe_mode'] = (bool) ($metablock['flags_raw'] & 0x000001); // "adobe" mode for 32-bit floats + $metablock['flags']['fast_flag'] = (bool) ($metablock['flags_raw'] & 0x000002); // fast mode + $metablock['flags']['very_fast_flag'] = (bool) ($metablock['flags_raw'] & 0x000004); // double fast + $metablock['flags']['high_flag'] = (bool) ($metablock['flags_raw'] & 0x000008); // high quality mode + $metablock['flags']['very_high_flag'] = (bool) ($metablock['flags_raw'] & 0x000010); // double high (not used yet) + $metablock['flags']['bitrate_kbps'] = (bool) ($metablock['flags_raw'] & 0x000020); // bitrate is kbps, not bits / sample + $metablock['flags']['auto_shaping'] = (bool) ($metablock['flags_raw'] & 0x000040); // automatic noise shaping + $metablock['flags']['shape_override'] = (bool) ($metablock['flags_raw'] & 0x000080); // shaping mode specified + $metablock['flags']['joint_override'] = (bool) ($metablock['flags_raw'] & 0x000100); // joint-stereo mode specified + $metablock['flags']['copy_time'] = (bool) ($metablock['flags_raw'] & 0x000200); // copy file-time from source + $metablock['flags']['create_exe'] = (bool) ($metablock['flags_raw'] & 0x000400); // create executable + $metablock['flags']['create_wvc'] = (bool) ($metablock['flags_raw'] & 0x000800); // create correction file + $metablock['flags']['optimize_wvc'] = (bool) ($metablock['flags_raw'] & 0x001000); // maximize bybrid compression + $metablock['flags']['quality_mode'] = (bool) ($metablock['flags_raw'] & 0x002000); // psychoacoustic quality mode + $metablock['flags']['raw_flag'] = (bool) ($metablock['flags_raw'] & 0x004000); // raw mode (not implemented yet) + $metablock['flags']['calc_noise'] = (bool) ($metablock['flags_raw'] & 0x008000); // calc noise in hybrid mode + $metablock['flags']['lossy_mode'] = (bool) ($metablock['flags_raw'] & 0x010000); // obsolete (for information) + $metablock['flags']['extra_mode'] = (bool) ($metablock['flags_raw'] & 0x020000); // extra processing mode + $metablock['flags']['skip_wvx'] = (bool) ($metablock['flags_raw'] & 0x040000); // no wvx stream w/ floats & big ints + $metablock['flags']['md5_checksum'] = (bool) ($metablock['flags_raw'] & 0x080000); // compute & store MD5 signature + $metablock['flags']['quiet_mode'] = (bool) ($metablock['flags_raw'] & 0x100000); // don't report progress % + + $info_wavpack['config_flags'] = $metablock['flags']; + + $getid3->info['audio']['encoder_options'] = trim( + ($info_wavpack_blockheader['flags']['hybrid'] ? ' -b???' : '') . + ($metablock['flags']['adobe_mode'] ? ' -a' : '') . + ($metablock['flags']['optimize_wvc'] ? ' -cc' : '') . + ($metablock['flags']['create_exe'] ? ' -e' : '') . + ($metablock['flags']['fast_flag'] ? ' -f' : '') . + ($metablock['flags']['joint_override'] ? ' -j?' : '') . + ($metablock['flags']['high_flag'] ? ' -h' : '') . + ($metablock['flags']['md5_checksum'] ? ' -m' : '') . + ($metablock['flags']['calc_noise'] ? ' -n' : '') . + ($metablock['flags']['shape_override'] ? ' -s?' : '') . + ($metablock['flags']['extra_mode'] ? ' -x?' : '') + ); + if (!$getid3->info['audio']['encoder_options']) { + unset($getid3->info['audio']['encoder_options']); + } + break; + + + case 0x26: // ID_MD5_CHECKSUM + if (strlen($metablock['data']) == 16) { + $getid3->info['md5_data_source'] = strtolower(getid3_lib::PrintHexBytes($metablock['data'], true, false, false)); + } else { + $getid3->warning('Expecting 16 bytes of WavPack "MD5 Checksum" in metablock at offset '.$metablock['offset'].', but found '.strlen($metablock['data']).' bytes'); + } + break; + + + case 0x00: // ID_DUMMY + case 0x01: // ID_ENCODER_INFO + case 0x02: // ID_DECORR_TERMS + case 0x03: // ID_DECORR_WEIGHTS + case 0x04: // ID_DECORR_SAMPLES + case 0x05: // ID_ENTROPY_VARS + case 0x06: // ID_HYBRID_PROFILE + case 0x07: // ID_SHAPING_WEIGHTS + case 0x08: // ID_FLOAT_INFO + case 0x09: // ID_INT32_INFO + case 0x0A: // ID_WV_BITSTREAM + case 0x0B: // ID_WVC_BITSTREAM + case 0x0C: // ID_WVX_BITSTREAM + case 0x0D: // ID_CHANNEL_INFO + unset($metablock); + break; + } + + } + + if (!empty($metablock)) { + $info_wavpack['metablocks'][] = $metablock; + } + + } + + } + + $getid3->info['audio']['encoder'] = 'WavPack v'.$info_wavpack_blockheader['major_version'].'.'.str_pad($info_wavpack_blockheader['minor_version'], 2, '0', STR_PAD_LEFT); + $getid3->info['audio']['bits_per_sample'] = $info_wavpack_blockheader['flags']['bytes_per_sample'] * 8; + $getid3->info['audio']['channels'] = ($info_wavpack_blockheader['flags']['mono'] ? 1 : 2); + + if (@$getid3->info['playtime_seconds']) { + $getid3->info['audio']['bitrate'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / $getid3->info['playtime_seconds']; + } else { + $getid3->info['audio']['dataformat'] = 'wvc'; + } + + return true; + } + + + + public static function WavPackMetablockNameLookup($id) { + + static $lookup = array( + 0x00 => 'Dummy', + 0x01 => 'Encoder Info', + 0x02 => 'Decorrelation Terms', + 0x03 => 'Decorrelation Weights', + 0x04 => 'Decorrelation Samples', + 0x05 => 'Entropy Variables', + 0x06 => 'Hybrid Profile', + 0x07 => 'Shaping Weights', + 0x08 => 'Float Info', + 0x09 => 'Int32 Info', + 0x0A => 'WV Bitstream', + 0x0B => 'WVC Bitstream', + 0x0C => 'WVX Bitstream', + 0x0D => 'Channel Info', + 0x21 => 'RIFF header', + 0x22 => 'RIFF trailer', + 0x23 => 'Replay Gain', + 0x24 => 'Cuesheet', + 0x25 => 'Config Block', + 0x26 => 'MD5 Checksum', + ); + + return (@$lookup[$id]); + } + +} + + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.xiph.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.audio.xiph.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,952 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.xiph.php | +// | Module for analyzing Xiph.org audio file formats: | +// | Ogg Vorbis, FLAC, OggFLAC and Speex - not Ogg Theora | +// | dependencies: module.lib.image_size.php (optional) | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.xiph.php,v 1.5 2006/12/03 21:12:43 ah Exp $ + + + +class getid3_xiph extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + if ($getid3->option_tags_images) { + $getid3->include_module('lib.image_size'); + } + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + + $magic = fread($getid3->fp, 4); + + if ($magic == 'OggS') { + return $this->ParseOgg(); + } + + if ($magic == 'fLaC') { + return $this->ParseFLAC(); + } + + } + + + + private function ParseOgg() { + + $getid3 = $this->getid3; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + + $getid3->info['audio'] = $getid3->info['ogg'] = array (); + $info_ogg = &$getid3->info['ogg']; + $info_audio = &$getid3->info['audio']; + + $getid3->info['fileformat'] = 'ogg'; + + + //// Page 1 - Stream Header + + $ogg_page_info = $this->ParseOggPageHeader(); + $info_ogg['pageheader'][$ogg_page_info['page_seqno']] = $ogg_page_info; + + if (ftell($getid3->fp) >= getid3::FREAD_BUFFER_SIZE) { + throw new getid3_exception('Could not find start of Ogg page in the first '.getid3::FREAD_BUFFER_SIZE.' bytes (this might not be an Ogg file?)'); + } + + $file_data = fread($getid3->fp, $ogg_page_info['page_length']); + $file_data_offset = 0; + + + // OggFLAC + if (substr($file_data, 0, 4) == 'fLaC') { + + $info_audio['dataformat'] = 'flac'; + $info_audio['bitrate_mode'] = 'vbr'; + $info_audio['lossless'] = true; + + } + + + // Ogg Vorbis + elseif (substr($file_data, 1, 6) == 'vorbis') { + + $info_audio['dataformat'] = 'vorbis'; + $info_audio['lossless'] = false; + + $info_ogg['pageheader'][$ogg_page_info['page_seqno']]['packet_type'] = getid3_lib::LittleEndian2Int($file_data[0]); + $info_ogg['pageheader'][$ogg_page_info['page_seqno']]['stream_type'] = substr($file_data, 1, 6); // hard-coded to 'vorbis' + + getid3_lib::ReadSequence('LittleEndian2Int', $info_ogg, $file_data, 7, + array ( + 'bitstreamversion' => 4, + 'numberofchannels' => 1, + 'samplerate' => 4, + 'bitrate_max' => 4, + 'bitrate_nominal' => 4, + 'bitrate_min' => 4 + ) + ); + + $n28 = getid3_lib::LittleEndian2Int($file_data{28}); + $info_ogg['blocksize_small'] = pow(2, $n28 & 0x0F); + $info_ogg['blocksize_large'] = pow(2, ($n28 & 0xF0) >> 4); + $info_ogg['stop_bit'] = $n28; + + $info_audio['channels'] = $info_ogg['numberofchannels']; + $info_audio['sample_rate'] = $info_ogg['samplerate']; + + $info_audio['bitrate_mode'] = 'vbr'; // overridden if actually abr + + if ($info_ogg['bitrate_max'] == 0xFFFFFFFF) { + unset($info_ogg['bitrate_max']); + $info_audio['bitrate_mode'] = 'abr'; + } + + if ($info_ogg['bitrate_nominal'] == 0xFFFFFFFF) { + unset($info_ogg['bitrate_nominal']); + } + + if ($info_ogg['bitrate_min'] == 0xFFFFFFFF) { + unset($info_ogg['bitrate_min']); + $info_audio['bitrate_mode'] = 'abr'; + } + } + + + // Speex + elseif (substr($file_data, 0, 8) == 'Speex ') { + + // http://www.speex.org/manual/node10.html + + $info_audio['dataformat'] = 'speex'; + $getid3->info['mime_type'] = 'audio/speex'; + $info_audio['bitrate_mode'] = 'abr'; + $info_audio['lossless'] = false; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_ogg['pageheader'][$ogg_page_info['page_seqno']], $file_data, 0, + array ( + 'speex_string' => -8, // hard-coded to 'Speex ' + 'speex_version' => -20, // string + 'speex_version_id' => 4, + 'header_size' => 4, + 'rate' => 4, + 'mode' => 4, + 'mode_bitstream_version' => 4, + 'nb_channels' => 4, + 'bitrate' => 4, + 'framesize' => 4, + 'vbr' => 4, + 'frames_per_packet' => 4, + 'extra_headers' => 4, + 'reserved1' => 4, + 'reserved2' => 4 + ) + ); + + $getid3->info['speex']['speex_version'] = trim($info_ogg['pageheader'][$ogg_page_info['page_seqno']]['speex_version']); + $getid3->info['speex']['sample_rate'] = $info_ogg['pageheader'][$ogg_page_info['page_seqno']]['rate']; + $getid3->info['speex']['channels'] = $info_ogg['pageheader'][$ogg_page_info['page_seqno']]['nb_channels']; + $getid3->info['speex']['vbr'] = (bool)$info_ogg['pageheader'][$ogg_page_info['page_seqno']]['vbr']; + $getid3->info['speex']['band_type'] = getid3_xiph::SpeexBandModeLookup($info_ogg['pageheader'][$ogg_page_info['page_seqno']]['mode']); + + $info_audio['sample_rate'] = $getid3->info['speex']['sample_rate']; + $info_audio['channels'] = $getid3->info['speex']['channels']; + + if ($getid3->info['speex']['vbr']) { + $info_audio['bitrate_mode'] = 'vbr'; + } + } + + // Unsupported Ogg file + else { + + throw new getid3_exception('Expecting either "Speex " or "vorbis" identifier strings, found neither'); + } + + + //// Page 2 - Comment Header + + $ogg_page_info = $this->ParseOggPageHeader(); + $info_ogg['pageheader'][$ogg_page_info['page_seqno']] = $ogg_page_info; + + switch ($info_audio['dataformat']) { + + case 'vorbis': + $file_data = fread($getid3->fp, $info_ogg['pageheader'][$ogg_page_info['page_seqno']]['page_length']); + $info_ogg['pageheader'][$ogg_page_info['page_seqno']]['packet_type'] = getid3_lib::LittleEndian2Int(substr($file_data, 0, 1)); + $info_ogg['pageheader'][$ogg_page_info['page_seqno']]['stream_type'] = substr($file_data, 1, 6); // hard-coded to 'vorbis' + $this->ParseVorbisCommentsFilepointer(); + break; + + case 'flac': + if (!$this->FLACparseMETAdata()) { + throw new getid3_exception('Failed to parse FLAC headers'); + } + break; + + case 'speex': + fseek($getid3->fp, $info_ogg['pageheader'][$ogg_page_info['page_seqno']]['page_length'], SEEK_CUR); + $this->ParseVorbisCommentsFilepointer(); + break; + } + + + //// Last Page - Number of Samples + + fseek($getid3->fp, max($getid3->info['avdataend'] - getid3::FREAD_BUFFER_SIZE, 0), SEEK_SET); + $last_chunk_of_ogg = strrev(fread($getid3->fp, getid3::FREAD_BUFFER_SIZE)); + + if ($last_OggS_postion = strpos($last_chunk_of_ogg, 'SggO')) { + fseek($getid3->fp, $getid3->info['avdataend'] - ($last_OggS_postion + strlen('SggO')), SEEK_SET); + $getid3->info['avdataend'] = ftell($getid3->fp); + $info_ogg['pageheader']['eos'] = $this->ParseOggPageHeader(); + $info_ogg['samples'] = $info_ogg['pageheader']['eos']['pcm_abs_position']; + $info_ogg['bitrate_average'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / ($info_ogg['samples'] / $info_audio['sample_rate']); + } + + if (!empty($info_ogg['bitrate_average'])) { + $info_audio['bitrate'] = $info_ogg['bitrate_average']; + } elseif (!empty($info_ogg['bitrate_nominal'])) { + $info_audio['bitrate'] = $info_ogg['bitrate_nominal']; + } elseif (!empty($info_ogg['bitrate_min']) && !empty($info_ogg['bitrate_max'])) { + $info_audio['bitrate'] = ($info_ogg['bitrate_min'] + $info_ogg['bitrate_max']) / 2; + } + if (isset($info_audio['bitrate']) && !isset($getid3->info['playtime_seconds'])) { + $getid3->info['playtime_seconds'] = (float)((($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / $info_audio['bitrate']); + } + + if (isset($info_ogg['vendor'])) { + $info_audio['encoder'] = preg_replace('/^Encoded with /', '', $info_ogg['vendor']); + + // Vorbis only + if ($info_audio['dataformat'] == 'vorbis') { + + // Vorbis 1.0 starts with Xiph.Org + if (preg_match('/^Xiph.Org/', $info_audio['encoder'])) { + + if ($info_audio['bitrate_mode'] == 'abr') { + + // Set -b 128 on abr files + $info_audio['encoder_options'] = '-b '.round($info_ogg['bitrate_nominal'] / 1000); + + } elseif (($info_audio['bitrate_mode'] == 'vbr') && ($info_audio['channels'] == 2) && ($info_audio['sample_rate'] >= 44100) && ($info_audio['sample_rate'] <= 48000)) { + // Set -q N on vbr files + $info_audio['encoder_options'] = '-q '.getid3_xiph::GetQualityFromNominalBitrate($info_ogg['bitrate_nominal']); + } + } + + if (empty($info_audio['encoder_options']) && !empty($info_ogg['bitrate_nominal'])) { + $info_audio['encoder_options'] = 'Nominal bitrate: '.intval(round($info_ogg['bitrate_nominal'] / 1000)).'kbps'; + } + } + } + + return true; + } + + + + private function ParseOggPageHeader() { + + $getid3 = $this->getid3; + + // http://xiph.org/ogg/vorbis/doc/framing.html + $ogg_header['page_start_offset'] = ftell($getid3->fp); // where we started from in the file + + $file_data = fread($getid3->fp, getid3::FREAD_BUFFER_SIZE); + $file_data_offset = 0; + + while ((substr($file_data, $file_data_offset++, 4) != 'OggS')) { + if ((ftell($getid3->fp) - $ogg_header['page_start_offset']) >= getid3::FREAD_BUFFER_SIZE) { + // should be found before here + return false; + } + if ((($file_data_offset + 28) > strlen($file_data)) || (strlen($file_data) < 28)) { + if (feof($getid3->fp) || (($file_data .= fread($getid3->fp, getid3::FREAD_BUFFER_SIZE)) === false)) { + // get some more data, unless eof, in which case fail + return false; + } + } + } + + $file_data_offset += 3; // page, delimited by 'OggS' + + getid3_lib::ReadSequence('LittleEndian2Int', $ogg_header, $file_data, $file_data_offset, + array ( + 'stream_structver' => 1, + 'flags_raw' => 1, + 'pcm_abs_position' => 8, + 'stream_serialno' => 4, + 'page_seqno' => 4, + 'page_checksum' => 4, + 'page_segments' => 1 + ) + ); + + $file_data_offset += 23; + + $ogg_header['flags']['fresh'] = (bool)($ogg_header['flags_raw'] & 0x01); // fresh packet + $ogg_header['flags']['bos'] = (bool)($ogg_header['flags_raw'] & 0x02); // first page of logical bitstream (bos) + $ogg_header['flags']['eos'] = (bool)($ogg_header['flags_raw'] & 0x04); // last page of logical bitstream (eos) + + $ogg_header['page_length'] = 0; + for ($i = 0; $i < $ogg_header['page_segments']; $i++) { + $ogg_header['segment_table'][$i] = getid3_lib::LittleEndian2Int($file_data{$file_data_offset++}); + $ogg_header['page_length'] += $ogg_header['segment_table'][$i]; + } + $ogg_header['header_end_offset'] = $ogg_header['page_start_offset'] + $file_data_offset; + $ogg_header['page_end_offset'] = $ogg_header['header_end_offset'] + $ogg_header['page_length']; + fseek($getid3->fp, $ogg_header['header_end_offset'], SEEK_SET); + + return $ogg_header; + } + + + + private function ParseVorbisCommentsFilepointer() { + + $getid3 = $this->getid3; + + $original_offset = ftell($getid3->fp); + $comment_start_offset = $original_offset; + $comment_data_offset = 0; + $vorbis_comment_page = 1; + + switch ($getid3->info['audio']['dataformat']) { + + case 'vorbis': + $comment_start_offset = $getid3->info['ogg']['pageheader'][$vorbis_comment_page]['page_start_offset']; // Second Ogg page, after header block + fseek($getid3->fp, $comment_start_offset, SEEK_SET); + $comment_data_offset = 27 + $getid3->info['ogg']['pageheader'][$vorbis_comment_page]['page_segments']; + $comment_data = fread($getid3->fp, getid3_xiph::OggPageSegmentLength($getid3->info['ogg']['pageheader'][$vorbis_comment_page], 1) + $comment_data_offset); + $comment_data_offset += (strlen('vorbis') + 1); + break; + + + case 'flac': + fseek($getid3->fp, $getid3->info['flac']['VORBIS_COMMENT']['raw']['offset'] + 4, SEEK_SET); + $comment_data = fread($getid3->fp, $getid3->info['flac']['VORBIS_COMMENT']['raw']['block_length']); + break; + + + case 'speex': + $comment_start_offset = $getid3->info['ogg']['pageheader'][$vorbis_comment_page]['page_start_offset']; // Second Ogg page, after header block + fseek($getid3->fp, $comment_start_offset, SEEK_SET); + $comment_data_offset = 27 + $getid3->info['ogg']['pageheader'][$vorbis_comment_page]['page_segments']; + $comment_data = fread($getid3->fp, getid3_xiph::OggPageSegmentLength($getid3->info['ogg']['pageheader'][$vorbis_comment_page], 1) + $comment_data_offset); + break; + + + default: + return false; + } + + $vendor_size = getid3_lib::LittleEndian2Int(substr($comment_data, $comment_data_offset, 4)); + $comment_data_offset += 4; + + $getid3->info['ogg']['vendor'] = substr($comment_data, $comment_data_offset, $vendor_size); + $comment_data_offset += $vendor_size; + + $comments_count = getid3_lib::LittleEndian2Int(substr($comment_data, $comment_data_offset, 4)); + $comment_data_offset += 4; + + $getid3->info['avdataoffset'] = $comment_start_offset + $comment_data_offset; + + for ($i = 0; $i < $comments_count; $i++) { + + $getid3->info['ogg']['comments_raw'][$i]['dataoffset'] = $comment_start_offset + $comment_data_offset; + + if (ftell($getid3->fp) < ($getid3->info['ogg']['comments_raw'][$i]['dataoffset'] + 4)) { + $vorbis_comment_page++; + + $ogg_page_info = $this->ParseOggPageHeader(); + $getid3->info['ogg']['pageheader'][$ogg_page_info['page_seqno']] = $ogg_page_info; + + // First, save what we haven't read yet + $as_yet_unused_data = substr($comment_data, $comment_data_offset); + + // Then take that data off the end + $comment_data = substr($comment_data, 0, $comment_data_offset); + + // Add [headerlength] bytes of dummy data for the Ogg Page Header, just to keep absolute offsets correct + $comment_data .= str_repeat("\x00", 27 + $getid3->info['ogg']['pageheader'][$ogg_page_info['page_seqno']]['page_segments']); + $comment_data_offset += (27 + $getid3->info['ogg']['pageheader'][$ogg_page_info['page_seqno']]['page_segments']); + + // Finally, stick the unused data back on the end + $comment_data .= $as_yet_unused_data; + + $comment_data .= fread($getid3->fp, getid3_xiph::OggPageSegmentLength($getid3->info['ogg']['pageheader'][$vorbis_comment_page], 1)); + } + $getid3->info['ogg']['comments_raw'][$i]['size'] = getid3_lib::LittleEndian2Int(substr($comment_data, $comment_data_offset, 4)); + + // replace avdataoffset with position just after the last vorbiscomment + $getid3->info['avdataoffset'] = $getid3->info['ogg']['comments_raw'][$i]['dataoffset'] + $getid3->info['ogg']['comments_raw'][$i]['size'] + 4; + + $comment_data_offset += 4; + while ((strlen($comment_data) - $comment_data_offset) < $getid3->info['ogg']['comments_raw'][$i]['size']) { + + if (($getid3->info['ogg']['comments_raw'][$i]['size'] > $getid3->info['avdataend']) || ($getid3->info['ogg']['comments_raw'][$i]['size'] < 0)) { + throw new getid3_exception('Invalid Ogg comment size (comment #'.$i.', claims to be '.number_format($getid3->info['ogg']['comments_raw'][$i]['size']).' bytes) - aborting reading comments'); + } + + $vorbis_comment_page++; + + $ogg_page_info = $this->ParseOggPageHeader(); + $getid3->info['ogg']['pageheader'][$ogg_page_info['page_seqno']] = $ogg_page_info; + + // First, save what we haven't read yet + $as_yet_unused_data = substr($comment_data, $comment_data_offset); + + // Then take that data off the end + $comment_data = substr($comment_data, 0, $comment_data_offset); + + // Add [headerlength] bytes of dummy data for the Ogg Page Header, just to keep absolute offsets correct + $comment_data .= str_repeat("\x00", 27 + $getid3->info['ogg']['pageheader'][$ogg_page_info['page_seqno']]['page_segments']); + $comment_data_offset += (27 + $getid3->info['ogg']['pageheader'][$ogg_page_info['page_seqno']]['page_segments']); + + // Finally, stick the unused data back on the end + $comment_data .= $as_yet_unused_data; + + //$comment_data .= fread($getid3->fp, $getid3->info['ogg']['pageheader'][$ogg_page_info['page_seqno']]['page_length']); + $comment_data .= fread($getid3->fp, getid3_xiph::OggPageSegmentLength($getid3->info['ogg']['pageheader'][$vorbis_comment_page], 1)); + + //$filebaseoffset += $ogg_page_info['header_end_offset'] - $ogg_page_info['page_start_offset']; + } + $comment_string = substr($comment_data, $comment_data_offset, $getid3->info['ogg']['comments_raw'][$i]['size']); + $comment_data_offset += $getid3->info['ogg']['comments_raw'][$i]['size']; + + if (!$comment_string) { + + // no comment? + $getid3->warning('Blank Ogg comment ['.$i.']'); + + } elseif (strstr($comment_string, '=')) { + + $comment_exploded = explode('=', $comment_string, 2); + $getid3->info['ogg']['comments_raw'][$i]['key'] = strtoupper($comment_exploded[0]); + $getid3->info['ogg']['comments_raw'][$i]['value'] = @$comment_exploded[1]; + $getid3->info['ogg']['comments_raw'][$i]['data'] = base64_decode($getid3->info['ogg']['comments_raw'][$i]['value']); + + $getid3->info['ogg']['comments'][strtolower($getid3->info['ogg']['comments_raw'][$i]['key'])][] = $getid3->info['ogg']['comments_raw'][$i]['value']; + + if ($getid3->option_tags_images) { + $image_chunk_check = getid3_lib_image_size::get($getid3->info['ogg']['comments_raw'][$i]['data']); + $getid3->info['ogg']['comments_raw'][$i]['image_mime'] = image_type_to_mime_type($image_chunk_check[2]); + } + + if (!@$getid3->info['ogg']['comments_raw'][$i]['image_mime'] || ($getid3->info['ogg']['comments_raw'][$i]['image_mime'] == 'application/octet-stream')) { + unset($getid3->info['ogg']['comments_raw'][$i]['image_mime']); + unset($getid3->info['ogg']['comments_raw'][$i]['data']); + } + + + } else { + + $getid3->warning('[known problem with CDex >= v1.40, < v1.50b7] Invalid Ogg comment name/value pair ['.$i.']: '.$comment_string); + } + } + + + // Replay Gain Adjustment + // http://privatewww.essex.ac.uk/~djmrob/replaygain/ + if (isset($getid3->info['ogg']['comments']) && is_array($getid3->info['ogg']['comments'])) { + foreach ($getid3->info['ogg']['comments'] as $index => $commentvalue) { + switch ($index) { + case 'rg_audiophile': + case 'replaygain_album_gain': + $getid3->info['replay_gain']['album']['adjustment'] = (float)$commentvalue[0]; + unset($getid3->info['ogg']['comments'][$index]); + break; + + case 'rg_radio': + case 'replaygain_track_gain': + $getid3->info['replay_gain']['track']['adjustment'] = (float)$commentvalue[0]; + unset($getid3->info['ogg']['comments'][$index]); + break; + + case 'replaygain_album_peak': + $getid3->info['replay_gain']['album']['peak'] = (float)$commentvalue[0]; + unset($getid3->info['ogg']['comments'][$index]); + break; + + case 'rg_peak': + case 'replaygain_track_peak': + $getid3->info['replay_gain']['track']['peak'] = (float)$commentvalue[0]; + unset($getid3->info['ogg']['comments'][$index]); + break; + + case 'replaygain_reference_loudness': + $getid3->info['replay_gain']['reference_volume'] = (float)$commentvalue[0]; + unset($getid3->info['ogg']['comments'][$index]); + break; + } + } + } + + fseek($getid3->fp, $original_offset, SEEK_SET); + + return true; + } + + + + private function ParseFLAC() { + + $getid3 = $this->getid3; + + // http://flac.sourceforge.net/format.html + + $getid3->info['fileformat'] = 'flac'; + $getid3->info['audio']['dataformat'] = 'flac'; + $getid3->info['audio']['bitrate_mode'] = 'vbr'; + $getid3->info['audio']['lossless'] = true; + + return $this->FLACparseMETAdata(); + } + + + + private function FLACparseMETAdata() { + + $getid3 = $this->getid3; + + do { + + $meta_data_block_offset = ftell($getid3->fp); + $meta_data_block_header = fread($getid3->fp, 4); + $meta_data_last_block_flag = (bool)(getid3_lib::BigEndian2Int($meta_data_block_header[0]) & 0x80); + $meta_data_block_type = getid3_lib::BigEndian2Int($meta_data_block_header[0]) & 0x7F; + $meta_data_block_length = getid3_lib::BigEndian2Int(substr($meta_data_block_header, 1, 3)); + $meta_data_block_type_text = getid3_xiph::FLACmetaBlockTypeLookup($meta_data_block_type); + + if ($meta_data_block_length < 0) { + throw new getid3_exception('corrupt or invalid METADATA_BLOCK_HEADER.BLOCK_TYPE ('.$meta_data_block_type.') at offset '.$meta_data_block_offset); + } + + $getid3->info['flac'][$meta_data_block_type_text]['raw'] = array ( + 'offset' => $meta_data_block_offset, + 'last_meta_block' => $meta_data_last_block_flag, + 'block_type' => $meta_data_block_type, + 'block_type_text' => $meta_data_block_type_text, + 'block_length' => $meta_data_block_length, + 'block_data' => @fread($getid3->fp, $meta_data_block_length) + ); + $getid3->info['avdataoffset'] = ftell($getid3->fp); + + switch ($meta_data_block_type_text) { + + case 'STREAMINFO': + if (!$this->FLACparseSTREAMINFO($getid3->info['flac'][$meta_data_block_type_text]['raw']['block_data'])) { + return false; + } + break; + + case 'PADDING': + // ignore + break; + + case 'APPLICATION': + if (!$this->FLACparseAPPLICATION($getid3->info['flac'][$meta_data_block_type_text]['raw']['block_data'])) { + return false; + } + break; + + case 'SEEKTABLE': + if (!$this->FLACparseSEEKTABLE($getid3->info['flac'][$meta_data_block_type_text]['raw']['block_data'])) { + return false; + } + break; + + case 'VORBIS_COMMENT': + $old_offset = ftell($getid3->fp); + fseek($getid3->fp, 0 - $meta_data_block_length, SEEK_CUR); + $this->ParseVorbisCommentsFilepointer($getid3->fp, $getid3->info); + fseek($getid3->fp, $old_offset, SEEK_SET); + break; + + case 'CUESHEET': + if (!$this->FLACparseCUESHEET($getid3->info['flac'][$meta_data_block_type_text]['raw']['block_data'])) { + return false; + } + break; + + case 'PICTURE': + if (!$this->FLACparsePICTURE($getid3->info['flac'][$meta_data_block_type_text]['raw']['block_data'])) { + return false; + } + break; + + default: + $getid3->warning('Unhandled METADATA_BLOCK_HEADER.BLOCK_TYPE ('.$meta_data_block_type.') at offset '.$meta_data_block_offset); + } + + } while ($meta_data_last_block_flag === false); + + + if (isset($getid3->info['flac']['STREAMINFO'])) { + $getid3->info['flac']['compressed_audio_bytes'] = $getid3->info['avdataend'] - $getid3->info['avdataoffset']; + $getid3->info['flac']['uncompressed_audio_bytes'] = $getid3->info['flac']['STREAMINFO']['samples_stream'] * $getid3->info['flac']['STREAMINFO']['channels'] * ($getid3->info['flac']['STREAMINFO']['bits_per_sample'] / 8); + $getid3->info['flac']['compression_ratio'] = $getid3->info['flac']['compressed_audio_bytes'] / $getid3->info['flac']['uncompressed_audio_bytes']; + } + + // set md5_data_source - built into flac 0.5+ + if (isset($getid3->info['flac']['STREAMINFO']['audio_signature'])) { + + if ($getid3->info['flac']['STREAMINFO']['audio_signature'] === str_repeat("\x00", 16)) { + $getid3->warning('FLAC STREAMINFO.audio_signature is null (known issue with libOggFLAC)'); + + } else { + + $getid3->info['md5_data_source'] = ''; + $md5 = $getid3->info['flac']['STREAMINFO']['audio_signature']; + for ($i = 0; $i < strlen($md5); $i++) { + $getid3->info['md5_data_source'] .= str_pad(dechex(ord($md5{$i})), 2, '00', STR_PAD_LEFT); + } + if (!preg_match('/^[0-9a-f]{32}$/', $getid3->info['md5_data_source'])) { + unset($getid3->info['md5_data_source']); + } + + } + + } + + $getid3->info['audio']['bits_per_sample'] = $getid3->info['flac']['STREAMINFO']['bits_per_sample']; + if ($getid3->info['audio']['bits_per_sample'] == 8) { + // special case + // must invert sign bit on all data bytes before MD5'ing to match FLAC's calculated value + // MD5sum calculates on unsigned bytes, but FLAC calculated MD5 on 8-bit audio data as signed + $getid3->warning('FLAC calculates MD5 data strangely on 8-bit audio, so the stored md5_data_source value will not match the decoded WAV file'); + } + if (!empty($getid3->info['ogg']['vendor'])) { + $getid3->info['audio']['encoder'] = $getid3->info['ogg']['vendor']; + } + + return true; + } + + + + private function FLACparseSTREAMINFO($meta_data_block_data) { + + $getid3 = $this->getid3; + + getid3_lib::ReadSequence('BigEndian2Int', $getid3->info['flac']['STREAMINFO'], $meta_data_block_data, 0, + array ( + 'min_block_size' => 2, + 'max_block_size' => 2, + 'min_frame_size' => 3, + 'max_frame_size' => 3 + ) + ); + + $sample_rate_channels_sample_bits_stream_samples = getid3_lib::BigEndian2Bin(substr($meta_data_block_data, 10, 8)); + + $getid3->info['flac']['STREAMINFO']['sample_rate'] = bindec(substr($sample_rate_channels_sample_bits_stream_samples, 0, 20)); + $getid3->info['flac']['STREAMINFO']['channels'] = bindec(substr($sample_rate_channels_sample_bits_stream_samples, 20, 3)) + 1; + $getid3->info['flac']['STREAMINFO']['bits_per_sample'] = bindec(substr($sample_rate_channels_sample_bits_stream_samples, 23, 5)) + 1; + $getid3->info['flac']['STREAMINFO']['samples_stream'] = bindec(substr($sample_rate_channels_sample_bits_stream_samples, 28, 36)); // bindec() returns float in case of int overrun + $getid3->info['flac']['STREAMINFO']['audio_signature'] = substr($meta_data_block_data, 18, 16); + + if (!empty($getid3->info['flac']['STREAMINFO']['sample_rate'])) { + + $getid3->info['audio']['bitrate_mode'] = 'vbr'; + $getid3->info['audio']['sample_rate'] = $getid3->info['flac']['STREAMINFO']['sample_rate']; + $getid3->info['audio']['channels'] = $getid3->info['flac']['STREAMINFO']['channels']; + $getid3->info['audio']['bits_per_sample'] = $getid3->info['flac']['STREAMINFO']['bits_per_sample']; + $getid3->info['playtime_seconds'] = $getid3->info['flac']['STREAMINFO']['samples_stream'] / $getid3->info['flac']['STREAMINFO']['sample_rate']; + $getid3->info['audio']['bitrate'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / $getid3->info['playtime_seconds']; + + } else { + + throw new getid3_exception('Corrupt METAdata block: STREAMINFO'); + } + + unset($getid3->info['flac']['STREAMINFO']['raw']); + + return true; + } + + + + private function FLACparseAPPLICATION($meta_data_block_data) { + + $getid3 = $this->getid3; + + $application_id = getid3_lib::BigEndian2Int(substr($meta_data_block_data, 0, 4)); + + $getid3->info['flac']['APPLICATION'][$application_id]['name'] = getid3_xiph::FLACapplicationIDLookup($application_id); + $getid3->info['flac']['APPLICATION'][$application_id]['data'] = substr($meta_data_block_data, 4); + + unset($getid3->info['flac']['APPLICATION']['raw']); + + return true; + } + + + + private function FLACparseSEEKTABLE($meta_data_block_data) { + + $getid3 = $this->getid3; + + $offset = 0; + $meta_data_block_length = strlen($meta_data_block_data); + while ($offset < $meta_data_block_length) { + $sample_number_string = substr($meta_data_block_data, $offset, 8); + $offset += 8; + if ($sample_number_string == "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF") { + + // placeholder point + @$getid3->info['flac']['SEEKTABLE']['placeholders']++; + $offset += 10; + + } else { + + $sample_number = getid3_lib::BigEndian2Int($sample_number_string); + + $getid3->info['flac']['SEEKTABLE'][$sample_number]['offset'] = getid3_lib::BigEndian2Int(substr($meta_data_block_data, $offset, 8)); + $offset += 8; + + $getid3->info['flac']['SEEKTABLE'][$sample_number]['samples'] = getid3_lib::BigEndian2Int(substr($meta_data_block_data, $offset, 2)); + $offset += 2; + + } + } + + unset($getid3->info['flac']['SEEKTABLE']['raw']); + + return true; + } + + + + private function FLACparseCUESHEET($meta_data_block_data) { + + $getid3 = $this->getid3; + + $getid3->info['flac']['CUESHEET']['media_catalog_number'] = trim(substr($meta_data_block_data, 0, 128), "\0"); + $getid3->info['flac']['CUESHEET']['lead_in_samples'] = getid3_lib::BigEndian2Int(substr($meta_data_block_data, 128, 8)); + $getid3->info['flac']['CUESHEET']['flags']['is_cd'] = (bool)(getid3_lib::BigEndian2Int($meta_data_block_data[136]) & 0x80); + $getid3->info['flac']['CUESHEET']['number_tracks'] = getid3_lib::BigEndian2Int($meta_data_block_data[395]); + + $offset = 396; + + for ($track = 0; $track < $getid3->info['flac']['CUESHEET']['number_tracks']; $track++) { + + $track_sample_offset = getid3_lib::BigEndian2Int(substr($meta_data_block_data, $offset, 8)); + $offset += 8; + + $track_number = getid3_lib::BigEndian2Int($meta_data_block_data{$offset++}); + + $getid3->info['flac']['CUESHEET']['tracks'][$track_number]['sample_offset'] = $track_sample_offset; + $getid3->info['flac']['CUESHEET']['tracks'][$track_number]['isrc'] = substr($meta_data_block_data, $offset, 12); + $offset += 12; + + $track_flags_raw = getid3_lib::BigEndian2Int($meta_data_block_data{$offset++}); + $getid3->info['flac']['CUESHEET']['tracks'][$track_number]['flags']['is_audio'] = (bool)($track_flags_raw & 0x80); + $getid3->info['flac']['CUESHEET']['tracks'][$track_number]['flags']['pre_emphasis'] = (bool)($track_flags_raw & 0x40); + + $offset += 13; // reserved + + $getid3->info['flac']['CUESHEET']['tracks'][$track_number]['index_points'] = getid3_lib::BigEndian2Int($meta_data_block_data{$offset++}); + + for ($index = 0; $index < $getid3->info['flac']['CUESHEET']['tracks'][$track_number]['index_points']; $index++) { + + $index_sample_offset = getid3_lib::BigEndian2Int(substr($meta_data_block_data, $offset, 8)); + $offset += 8; + + $index_number = getid3_lib::BigEndian2Int($meta_data_block_data{$offset++}); + $getid3->info['flac']['CUESHEET']['tracks'][$track_number]['indexes'][$index_number] = $index_sample_offset; + + $offset += 3; // reserved + } + } + + unset($getid3->info['flac']['CUESHEET']['raw']); + + return true; + } + + + + private function FLACparsePICTURE($meta_data_block_data) { + + $getid3 = $this->getid3; + + $picture = &$getid3->info['flac']['PICTURE'][sizeof($getid3->info['flac']['PICTURE']) - 1]; + + $offset = 0; + + $picture['type'] = $this->FLACpictureTypeLookup(getid3_lib::BigEndian2Int(substr($meta_data_block_data, $offset, 4))); + $offset += 4; + + $length = getid3_lib::BigEndian2Int(substr($meta_data_block_data, $offset, 4)); + $offset += 4; + + $picture['mime_type'] = substr($meta_data_block_data, $offset, $length); + $offset += $length; + + $length = getid3_lib::BigEndian2Int(substr($meta_data_block_data, $offset, 4)); + $offset += 4; + + $picture['description'] = substr($meta_data_block_data, $offset, $length); + $offset += $length; + + $picture['width'] = getid3_lib::BigEndian2Int(substr($meta_data_block_data, $offset, 4)); + $offset += 4; + + $picture['height'] = getid3_lib::BigEndian2Int(substr($meta_data_block_data, $offset, 4)); + $offset += 4; + + $picture['color_depth'] = getid3_lib::BigEndian2Int(substr($meta_data_block_data, $offset, 4)); + $offset += 4; + + $picture['colors_indexed'] = getid3_lib::BigEndian2Int(substr($meta_data_block_data, $offset, 4)); + $offset += 4; + + $length = getid3_lib::BigEndian2Int(substr($meta_data_block_data, $offset, 4)); + $offset += 4; + + $picture['image_data'] = substr($meta_data_block_data, $offset, $length); + $offset += $length; + + unset($getid3->info['flac']['PICTURE']['raw']); + + return true; + } + + + + public static function SpeexBandModeLookup($mode) { + + static $lookup = array ( + 0 => 'narrow', + 1 => 'wide', + 2 => 'ultra-wide' + ); + return (isset($lookup[$mode]) ? $lookup[$mode] : null); + } + + + + public static function OggPageSegmentLength($ogg_info_array, $segment_number=1) { + + for ($i = 0; $i < $segment_number; $i++) { + $segment_length = 0; + foreach ($ogg_info_array['segment_table'] as $key => $value) { + $segment_length += $value; + if ($value < 255) { + break; + } + } + } + return $segment_length; + } + + + + public static function GetQualityFromNominalBitrate($nominal_bitrate) { + + // decrease precision + $nominal_bitrate = $nominal_bitrate / 1000; + + if ($nominal_bitrate < 128) { + // q-1 to q4 + $qval = ($nominal_bitrate - 64) / 16; + } elseif ($nominal_bitrate < 256) { + // q4 to q8 + $qval = $nominal_bitrate / 32; + } elseif ($nominal_bitrate < 320) { + // q8 to q9 + $qval = ($nominal_bitrate + 256) / 64; + } else { + // q9 to q10 + $qval = ($nominal_bitrate + 1300) / 180; + } + return round($qval, 1); // 5 or 4.9 + } + + + + public static function FLACmetaBlockTypeLookup($block_type) { + + static $lookup = array ( + 0 => 'STREAMINFO', + 1 => 'PADDING', + 2 => 'APPLICATION', + 3 => 'SEEKTABLE', + 4 => 'VORBIS_COMMENT', + 5 => 'CUESHEET', + 6 => 'PICTURE' + ); + return (isset($lookup[$block_type]) ? $lookup[$block_type] : 'reserved'); + } + + + + public static function FLACapplicationIDLookup($application_id) { + + // http://flac.sourceforge.net/id.html + + static $lookup = array ( + 0x46746F6C => 'flac-tools', // 'Ftol' + 0x46746F6C => 'Sound Font FLAC', // 'SFFL' + 0x7065656D => 'Parseable Embedded Extensible Metadata (specification)', // 'peem' + 0x786D6364 => 'xmcd' + + ); + return (isset($lookup[$application_id]) ? $lookup[$application_id] : 'reserved'); + } + + + public static function FLACpictureTypeLookup($type_id) { + + static $lookup = array ( + + 0 => 'Other', + 1 => "32x32 pixels 'file icon' (PNG only)", + 2 => 'Other file icon', + 3 => 'Cover (front)', + 4 => 'Cover (back)', + 5 => 'Leaflet page', + 6 => 'Media (e.g. label side of CD)', + 7 => 'Lead artist/lead performer/soloist', + 8 => 'Artist/performer', + 9 => 'Conductor', + 10 => 'Band/Orchestra', + 11 => 'Composer', + 12 => 'Lyricist/text writer', + 13 => 'Recording Location', + 14 => 'During recording', + 15 => 'During performance', + 16 => 'Movie/video screen capture', + 17 => 'A bright coloured fish', + 18 => 'Illustration', + 19 => 'Band/artist logotype', + 20 => 'Publisher/Studio logotype' + ); + return (isset($lookup[$type_id]) ? $lookup[$type_id] : 'reserved'); + } + +} + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.graphic.bmp.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.graphic.bmp.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,319 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.graphic.bmp.php | +// | Module for analyzing BMP graphic files. | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.graphic.bmp.php,v 1.4 2006/11/02 10:48:02 ah Exp $ + + + +class getid3_bmp extends getid3_handler +{ + + + public function Analyze() { + + $getid3 = $this->getid3; + + // BITMAPFILEHEADER [14 bytes] - http://msdn.microsoft.com/library/en-us/gdi/bitmaps_62uq.asp + // all versions + // WORD bfType; + // DWORD bfSize; + // WORD bfReserved1; + // WORD bfReserved2; + // DWORD bfOffBits; + + // shortcuts + $getid3->info['bmp']['header']['raw'] = array (); + $info_bmp = &$getid3->info['bmp']; + $info_bmp_header = &$info_bmp['header']; + $info_bmp_header_raw = &$info_bmp_header['raw']; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $bmp_header = fread($getid3->fp, 14 + 40); + + // Magic bytes + $info_bmp_header_raw['identifier'] = 'BM'; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_bmp_header_raw, $bmp_header, 2, + array ( + 'filesize' => 4, + 'reserved1' => 2, + 'reserved2' => 2, + 'data_offset' => 4, + 'header_size' => 4 + ) + ); + + // Check if the hardcoded-to-1 "planes" is at offset 22 or 26 + $planes22 = getid3_lib::LittleEndian2Int(substr($bmp_header, 22, 2)); + $planes26 = getid3_lib::LittleEndian2Int(substr($bmp_header, 26, 2)); + if (($planes22 == 1) && ($planes26 != 1)) { + $info_bmp['type_os'] = 'OS/2'; + $info_bmp['type_version'] = 1; + } + elseif (($planes26 == 1) && ($planes22 != 1)) { + $info_bmp['type_os'] = 'Windows'; + $info_bmp['type_version'] = 1; + } + elseif ($info_bmp_header_raw['header_size'] == 12) { + $info_bmp['type_os'] = 'OS/2'; + $info_bmp['type_version'] = 1; + } + elseif ($info_bmp_header_raw['header_size'] == 40) { + $info_bmp['type_os'] = 'Windows'; + $info_bmp['type_version'] = 1; + } + elseif ($info_bmp_header_raw['header_size'] == 84) { + $info_bmp['type_os'] = 'Windows'; + $info_bmp['type_version'] = 4; + } + elseif ($info_bmp_header_raw['header_size'] == 100) { + $info_bmp['type_os'] = 'Windows'; + $info_bmp['type_version'] = 5; + } + else { + throw new getid3_exception('Unknown BMP subtype (or not a BMP file)'); + } + + $getid3->info['fileformat'] = 'bmp'; + $getid3->info['video']['dataformat'] = 'bmp'; + $getid3->info['video']['lossless'] = true; + $getid3->info['video']['pixel_aspect_ratio'] = (float)1; + + if ($info_bmp['type_os'] == 'OS/2') { + + // OS/2-format BMP + // http://netghost.narod.ru/gff/graphics/summary/os2bmp.htm + + // DWORD Size; /* Size of this structure in bytes */ + // DWORD Width; /* Bitmap width in pixels */ + // DWORD Height; /* Bitmap height in pixel */ + // WORD NumPlanes; /* Number of bit planes (color depth) */ + // WORD BitsPerPixel; /* Number of bits per pixel per plane */ + + getid3_lib::ReadSequence('LittleEndian2Int', $info_bmp_header_raw, $bmp_header, 18, + array ( + 'width' => 2, + 'height' => 2, + 'planes' => 2, + 'bits_per_pixel' => 2 + ) + ); + + $getid3->info['video']['resolution_x'] = $info_bmp_header_raw['width']; + $getid3->info['video']['resolution_y'] = $info_bmp_header_raw['height']; + $getid3->info['video']['codec'] = 'BI_RGB '.$info_bmp_header_raw['bits_per_pixel'].'-bit'; + $getid3->info['video']['bits_per_sample'] = $info_bmp_header_raw['bits_per_pixel']; + + if ($info_bmp['type_version'] >= 2) { + // DWORD Compression; /* Bitmap compression scheme */ + // DWORD ImageDataSize; /* Size of bitmap data in bytes */ + // DWORD XResolution; /* X resolution of display device */ + // DWORD YResolution; /* Y resolution of display device */ + // DWORD ColorsUsed; /* Number of color table indices used */ + // DWORD ColorsImportant; /* Number of important color indices */ + // WORD Units; /* Type of units used to measure resolution */ + // WORD Reserved; /* Pad structure to 4-byte boundary */ + // WORD Recording; /* Recording algorithm */ + // WORD Rendering; /* Halftoning algorithm used */ + // DWORD Size1; /* Reserved for halftoning algorithm use */ + // DWORD Size2; /* Reserved for halftoning algorithm use */ + // DWORD ColorEncoding; /* Color model used in bitmap */ + // DWORD Identifier; /* Reserved for application use */ + + getid3_lib::ReadSequence('LittleEndian2Int', $info_bmp_header_raw, $bmp_header, 26, + array ( + 'compression' => 4, + 'bmp_data_size' => 4, + 'resolution_h' => 4, + 'resolution_v' => 4, + 'colors_used' => 4, + 'colors_important' => 4, + 'resolution_units' => 2, + 'reserved1' => 2, + 'recording' => 2, + 'rendering' => 2, + 'size1' => 4, + 'size2' => 4, + 'color_encoding' => 4, + 'identifier' => 4 + ) + ); + + $info_bmp_header['compression'] = getid3_bmp::BMPcompressionOS2Lookup($info_bmp_header_raw['compression']); + $getid3->info['video']['codec'] = $info_bmp_header['compression'].' '.$info_bmp_header_raw['bits_per_pixel'].'-bit'; + } + + return true; + } + + + if ($info_bmp['type_os'] == 'Windows') { + + // Windows-format BMP + + // BITMAPINFOHEADER - [40 bytes] http://msdn.microsoft.com/library/en-us/gdi/bitmaps_1rw2.asp + // all versions + // DWORD biSize; + // LONG biWidth; + // LONG biHeight; + // WORD biPlanes; + // WORD biBitCount; + // DWORD biCompression; + // DWORD biSizeImage; + // LONG biXPelsPerMeter; + // LONG biYPelsPerMeter; + // DWORD biClrUsed; + // DWORD biClrImportant; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_bmp_header_raw, $bmp_header, 18, + array ( + 'width' => -4, //signed + 'height' => -4, //signed + 'planes' => 2, + 'bits_per_pixel' => 2, + 'compression' => 4, + 'bmp_data_size' => 4, + 'resolution_h' => -4, //signed + 'resolution_v' => -4, //signed + 'colors_used' => 4, + 'colors_important' => 4 + ) + ); + foreach (array ('width', 'height', 'resolution_h', 'resolution_v') as $key) { + $info_bmp_header_raw[$key] = getid3_lib::LittleEndian2Int($info_bmp_header_raw[$key], true); + } + + $info_bmp_header['compression'] = getid3_bmp::BMPcompressionWindowsLookup($info_bmp_header_raw['compression']); + $getid3->info['video']['resolution_x'] = $info_bmp_header_raw['width']; + $getid3->info['video']['resolution_y'] = $info_bmp_header_raw['height']; + $getid3->info['video']['codec'] = $info_bmp_header['compression'].' '.$info_bmp_header_raw['bits_per_pixel'].'-bit'; + $getid3->info['video']['bits_per_sample'] = $info_bmp_header_raw['bits_per_pixel']; + + // should only be v4+, but BMPs with type_version==1 and BI_BITFIELDS compression have been seen + if (($info_bmp['type_version'] >= 4) || ($info_bmp_header_raw['compression'] == 3)) { + + + $bmp_header .= fread($getid3->fp, 44); + + // BITMAPV4HEADER - [44 bytes] - http://msdn.microsoft.com/library/en-us/gdi/bitmaps_2k1e.asp + // Win95+, WinNT4.0+ + // DWORD bV4RedMask; + // DWORD bV4GreenMask; + // DWORD bV4BlueMask; + // DWORD bV4AlphaMask; + // DWORD bV4CSType; + // CIEXYZTRIPLE bV4Endpoints; + // DWORD bV4GammaRed; + // DWORD bV4GammaGreen; + // DWORD bV4GammaBlue; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_bmp_header_raw, $bmp_header, 54, + array ( + 'red_mask' => 4, + 'green_mask' => 4, + 'blue_mask' => 4, + 'alpha_mask' => 4, + 'cs_type' => 4, + 'ciexyz_red' => -4, //string + 'ciexyz_green' => -4, //string + 'ciexyz_blue' => -4, //string + 'gamma_red' => 4, + 'gamma_green' => 4, + 'gamma_blue' => 4 + ) + ); + + $info_bmp_header['ciexyz_red'] = getid3_bmp::FixedPoint2_30(strrev($info_bmp_header_raw['ciexyz_red'])); + $info_bmp_header['ciexyz_green'] = getid3_bmp::FixedPoint2_30(strrev($info_bmp_header_raw['ciexyz_green'])); + $info_bmp_header['ciexyz_blue'] = getid3_bmp::FixedPoint2_30(strrev($info_bmp_header_raw['ciexyz_blue'])); + + + if ($info_bmp['type_version'] >= 5) { + $bmp_header .= fread($getid3->fp, 16); + + // BITMAPV5HEADER - [16 bytes] - http://msdn.microsoft.com/library/en-us/gdi/bitmaps_7c36.asp + // Win98+, Win2000+ + // DWORD bV5Intent; + // DWORD bV5ProfileData; + // DWORD bV5ProfileSize; + // DWORD bV5Reserved; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_bmp_header_raw, $bmp_header, 98, + array ( + 'intent' => 4, + 'profile_data_offset' => 4, + 'profile_data_size' => 4, + 'reserved3' => 4 + ) + ); + + } + } + + return true; + } + + + throw new getid3_exception('Unknown BMP format in header.'); + + } + + + + public static function BMPcompressionWindowsLookup($compression_id) { + + static $lookup = array ( + 0 => 'BI_RGB', + 1 => 'BI_RLE8', + 2 => 'BI_RLE4', + 3 => 'BI_BITFIELDS', + 4 => 'BI_JPEG', + 5 => 'BI_PNG' + ); + return (isset($lookup[$compression_id]) ? $lookup[$compression_id] : 'invalid'); + } + + + + public static function BMPcompressionOS2Lookup($compression_id) { + + static $lookup = array ( + 0 => 'BI_RGB', + 1 => 'BI_RLE8', + 2 => 'BI_RLE4', + 3 => 'Huffman 1D', + 4 => 'BI_RLE24', + ); + return (isset($lookup[$compression_id]) ? $lookup[$compression_id] : 'invalid'); + } + + + public static function FixedPoint2_30($raw_data) { + + $binary_string = getid3_lib::BigEndian2Bin($raw_data); + return bindec(substr($binary_string, 0, 2)) + (float)(bindec(substr($binary_string, 2, 30)) / 1073741824); // pow(2, 30) = 1073741824 + } + + +} + + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.graphic.gif.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.graphic.gif.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,92 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.graphic.gif.php | +// | Module for analyzing CompuServe GIF graphic files. | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.graphic.gif.php,v 1.2 2006/11/02 10:48:02 ah Exp $ + + + +class getid3_gif extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->info['fileformat'] = 'gif'; + $getid3->info['video']['dataformat'] = 'gif'; + $getid3->info['video']['lossless'] = true; + $getid3->info['video']['pixel_aspect_ratio'] = (float)1; + + $getid3->info['gif']['header'] = array (); + $info_gif_header = &$getid3->info['gif']['header']; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $gif_header = fread($getid3->fp, 13); + + // Magic bytes + $info_gif_header['raw']['identifier'] = 'GIF'; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_gif_header['raw'], $gif_header, 3, + array ( + 'version' => -3, // string + 'width' => 2, + 'height' => 2, + 'flags' => 1, + 'bg_color_index' => 1, + 'aspect_ratio' => 1 + ) + ); + + $getid3->info['video']['resolution_x'] = $info_gif_header['raw']['width']; + $getid3->info['video']['resolution_y'] = $info_gif_header['raw']['height']; + $getid3->info['gif']['version'] = $info_gif_header['raw']['version']; + + $info_gif_header['flags']['global_color_table'] = (bool)($info_gif_header['raw']['flags'] & 0x80); + + if ($info_gif_header['raw']['flags'] & 0x80) { + // Number of bits per primary color available to the original image, minus 1 + $info_gif_header['bits_per_pixel'] = 3 * ((($info_gif_header['raw']['flags'] & 0x70) >> 4) + 1); + } else { + $info_gif_header['bits_per_pixel'] = 0; + } + + $info_gif_header['flags']['global_color_sorted'] = (bool)($info_gif_header['raw']['flags'] & 0x40); + if ($info_gif_header['flags']['global_color_table']) { + // the number of bytes contained in the Global Color Table. To determine that + // actual size of the color table, raise 2 to [the value of the field + 1] + $info_gif_header['global_color_size'] = pow(2, ($info_gif_header['raw']['flags'] & 0x07) + 1); + $getid3->info['video']['bits_per_sample'] = ($info_gif_header['raw']['flags'] & 0x07) + 1; + } else { + $info_gif_header['global_color_size'] = 0; + } + + if ($info_gif_header['raw']['aspect_ratio'] != 0) { + // Aspect Ratio = (Pixel Aspect Ratio + 15) / 64 + $info_gif_header['aspect_ratio'] = ($info_gif_header['raw']['aspect_ratio'] + 15) / 64; + } + + return true; + } + +} + + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.graphic.jpeg.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.graphic.jpeg.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,62 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.graphic.jpeg.php | +// | Module for analyzing JPEG graphic files. | +// | dependencies: exif support in PHP (optional) | +// +----------------------------------------------------------------------+ +// +// $Id: module.graphic.jpeg.php,v 1.4 2006/11/02 10:48:02 ah Exp $ + + + +class getid3_jpeg extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->info['fileformat'] = 'jpg'; + $getid3->info['video']['dataformat'] = 'jpg'; + $getid3->info['video']['lossless'] = false; + $getid3->info['video']['bits_per_sample'] = 24; + $getid3->info['video']['pixel_aspect_ratio'] = (float)1; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + + list($getid3->info['video']['resolution_x'], $getid3->info['video']['resolution_y'], $type) = getimagesize($getid3->filename); + + if ($type != 2) { + throw new getid3_exception('File detected as JPEG, but is currupt.'); + } + + if (function_exists('exif_read_data')) { + + $getid3->info['jpg']['exif'] = exif_read_data($getid3->filename, '', true, false); + + } else { + + $getid3->warning('EXIF parsing only available when compiled with --enable-exif (or php_exif.dll enabled for Windows).'); + } + + return true; + } + +} + + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.graphic.pcd.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.graphic.pcd.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,56 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.graphic.pcd.php | +// | Module for analyzing PhotoCD (PCD) Image files. | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.graphic.pcd.php,v 1.2 2006/11/02 10:48:02 ah Exp $ + + + +class getid3_pcd extends getid3_handler +{ + + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->info['fileformat'] = 'pcd'; + $getid3->info['video']['dataformat'] = 'pcd'; + $getid3->info['video']['lossless'] = false; + + fseek($getid3->fp, $getid3->info['avdataoffset'] + 72, SEEK_SET); + + $pcd_flags = fread($getid3->fp, 1); + $pcd_is_vertical = ((ord($pcd_flags) & 0x01) ? true : false); + + if ($pcd_is_vertical) { + $getid3->info['video']['resolution_x'] = 3072; + $getid3->info['video']['resolution_y'] = 2048; + } else { + $getid3->info['video']['resolution_x'] = 2048; + $getid3->info['video']['resolution_y'] = 3072; + } + + } + + +} + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.graphic.png.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.graphic.png.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,556 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.graphic.png.php | +// | Module for analyzing PNG graphic files. | +// | dependencies: zlib support in PHP (optional) | +// +----------------------------------------------------------------------+ +// +// $Id: module.graphic.png.php,v 1.4 2006/11/02 10:48:02 ah Exp $ + + + +class getid3_png extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->info['png'] = array (); + $info_png = &$getid3->info['png']; + + $getid3->info['fileformat'] = 'png'; + $getid3->info['video']['dataformat'] = 'png'; + $getid3->info['video']['lossless'] = false; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $png_filedata = fread($getid3->fp, getid3::FREAD_BUFFER_SIZE); + + // Magic bytes "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A" + + $offset = 8; + + while (((ftell($getid3->fp) - (strlen($png_filedata) - $offset)) < $getid3->info['filesize'])) { + + $chunk['data_length'] = getid3_lib::BigEndian2Int(substr($png_filedata, $offset, 4)); + $offset += 4; + while (((strlen($png_filedata) - $offset) < ($chunk['data_length'] + 4)) && (ftell($getid3->fp) < $getid3->info['filesize'])) { + $png_filedata .= fread($getid3->fp, getid3::FREAD_BUFFER_SIZE); + } + + $chunk['type_text'] = substr($png_filedata, $offset, 4); + $chunk['type_raw'] = getid3_lib::BigEndian2Int($chunk['type_text']); + $offset += 4; + + $chunk['data'] = substr($png_filedata, $offset, $chunk['data_length']); + $offset += $chunk['data_length']; + + $chunk['crc'] = getid3_lib::BigEndian2Int(substr($png_filedata, $offset, 4)); + $offset += 4; + + $chunk['flags']['ancilliary'] = (bool)($chunk['type_raw'] & 0x20000000); + $chunk['flags']['private'] = (bool)($chunk['type_raw'] & 0x00200000); + $chunk['flags']['reserved'] = (bool)($chunk['type_raw'] & 0x00002000); + $chunk['flags']['safe_to_copy'] = (bool)($chunk['type_raw'] & 0x00000020); + + // shortcut + $info_png[$chunk['type_text']] = array (); + $info_png_chunk_type_text = &$info_png[$chunk['type_text']]; + + switch ($chunk['type_text']) { + + case 'IHDR': // Image Header + $info_png_chunk_type_text['header'] = $chunk; + $info_png_chunk_type_text['width'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 4)); + $info_png_chunk_type_text['height'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 4, 4)); + + getid3_lib::ReadSequence('BigEndian2Int', $info_png_chunk_type_text['raw'], $chunk['data'], 8, + array ( + 'bit_depth' => 1, + 'color_type' => 1, + 'compression_method' => 1, + 'filter_method' => 1, + 'interlace_method' => 1 + ) + ); + + $info_png_chunk_type_text['compression_method_text'] = getid3_png::PNGcompressionMethodLookup($info_png_chunk_type_text['raw']['compression_method']); + $info_png_chunk_type_text['color_type']['palette'] = (bool)($info_png_chunk_type_text['raw']['color_type'] & 0x01); + $info_png_chunk_type_text['color_type']['true_color'] = (bool)($info_png_chunk_type_text['raw']['color_type'] & 0x02); + $info_png_chunk_type_text['color_type']['alpha'] = (bool)($info_png_chunk_type_text['raw']['color_type'] & 0x04); + + $getid3->info['video']['resolution_x'] = $info_png_chunk_type_text['width']; + $getid3->info['video']['resolution_y'] = $info_png_chunk_type_text['height']; + + $getid3->info['video']['bits_per_sample'] = getid3_png::IHDRcalculateBitsPerSample($info_png_chunk_type_text['raw']['color_type'], $info_png_chunk_type_text['raw']['bit_depth']); + break; + + + case 'PLTE': // Palette + $info_png_chunk_type_text['header'] = $chunk; + $palette_offset = 0; + for ($i = 0; $i <= 255; $i++) { + $red = @getid3_lib::BigEndian2Int($chunk['data']{$palette_offset++}); + $green = @getid3_lib::BigEndian2Int($chunk['data']{$palette_offset++}); + $blue = @getid3_lib::BigEndian2Int($chunk['data']{$palette_offset++}); + $info_png_chunk_type_text[$i] = (($red << 16) | ($green << 8) | ($blue)); + } + break; + + + case 'tRNS': // Transparency + $info_png_chunk_type_text['header'] = $chunk; + switch ($info_png['IHDR']['raw']['color_type']) { + case 0: + $info_png_chunk_type_text['transparent_color_gray'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 2)); + break; + + case 2: + $info_png_chunk_type_text['transparent_color_red'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 2)); + $info_png_chunk_type_text['transparent_color_green'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 2, 2)); + $info_png_chunk_type_text['transparent_color_blue'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 4, 2)); + break; + + case 3: + for ($i = 0; $i < strlen($chunk['data']); $i++) { + $info_png_chunk_type_text['palette_opacity'][$i] = getid3_lib::BigEndian2Int($chunk['data'][$i]); + } + break; + + case 4: + case 6: + throw new getid3_exception('Invalid color_type in tRNS chunk: '.$info_png['IHDR']['raw']['color_type']); + + default: + $getid3->warning('Unhandled color_type in tRNS chunk: '.$info_png['IHDR']['raw']['color_type']); + break; + } + break; + + + case 'gAMA': // Image Gamma + $info_png_chunk_type_text['header'] = $chunk; + $info_png_chunk_type_text['gamma'] = getid3_lib::BigEndian2Int($chunk['data']) / 100000; + break; + + + case 'cHRM': // Primary Chromaticities + $info_png_chunk_type_text['header'] = $chunk; + $info_png_chunk_type_text['white_x'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 4)) / 100000; + $info_png_chunk_type_text['white_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 4, 4)) / 100000; + $info_png_chunk_type_text['red_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 8, 4)) / 100000; + $info_png_chunk_type_text['red_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 12, 4)) / 100000; + $info_png_chunk_type_text['green_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 16, 4)) / 100000; + $info_png_chunk_type_text['green_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 20, 4)) / 100000; + $info_png_chunk_type_text['blue_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 24, 4)) / 100000; + $info_png_chunk_type_text['blue_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 28, 4)) / 100000; + break; + + + case 'sRGB': // Standard RGB Color Space + $info_png_chunk_type_text['header'] = $chunk; + $info_png_chunk_type_text['reindering_intent'] = getid3_lib::BigEndian2Int($chunk['data']); + $info_png_chunk_type_text['reindering_intent_text'] = getid3_png::PNGsRGBintentLookup($info_png_chunk_type_text['reindering_intent']); + break; + + + case 'iCCP': // Embedded ICC Profile + $info_png_chunk_type_text['header'] = $chunk; + list($profilename, $compressiondata) = explode("\x00", $chunk['data'], 2); + $info_png_chunk_type_text['profile_name'] = $profilename; + $info_png_chunk_type_text['compression_method'] = getid3_lib::BigEndian2Int($compressiondata[0]); + $info_png_chunk_type_text['compression_profile'] = substr($compressiondata, 1); + $info_png_chunk_type_text['compression_method_text'] = getid3_png::PNGcompressionMethodLookup($info_png_chunk_type_text['compression_method']); + break; + + + case 'tEXt': // Textual Data + $info_png_chunk_type_text['header'] = $chunk; + list($keyword, $text) = explode("\x00", $chunk['data'], 2); + $info_png_chunk_type_text['keyword'] = $keyword; + $info_png_chunk_type_text['text'] = $text; + + $info_png['comments'][$info_png_chunk_type_text['keyword']][] = $info_png_chunk_type_text['text']; + break; + + + case 'zTXt': // Compressed Textual Data + $info_png_chunk_type_text['header'] = $chunk; + list($keyword, $otherdata) = explode("\x00", $chunk['data'], 2); + $info_png_chunk_type_text['keyword'] = $keyword; + $info_png_chunk_type_text['compression_method'] = getid3_lib::BigEndian2Int(substr($otherdata, 0, 1)); + $info_png_chunk_type_text['compressed_text'] = substr($otherdata, 1); + $info_png_chunk_type_text['compression_method_text'] = getid3_png::PNGcompressionMethodLookup($info_png_chunk_type_text['compression_method']); + + if ($info_png_chunk_type_text['compression_method'] != 0) { + // unknown compression method + break; + } + + if (function_exists('gzuncompress')) { + $info_png_chunk_type_text['text'] = gzuncompress($info_png_chunk_type_text['compressed_text']); + } + else { + if (!@$this->zlib_warning) { + $getid3->warning('PHP does not have --with-zlib support - cannot gzuncompress()'); + } + $this->zlib_warning = true; + } + + + if (isset($info_png_chunk_type_text['text'])) { + $info_png['comments'][$info_png_chunk_type_text['keyword']][] = $info_png_chunk_type_text['text']; + } + break; + + + case 'iTXt': // International Textual Data + $info_png_chunk_type_text['header'] = $chunk; + list($keyword, $otherdata) = explode("\x00", $chunk['data'], 2); + $info_png_chunk_type_text['keyword'] = $keyword; + $info_png_chunk_type_text['compression'] = (bool)getid3_lib::BigEndian2Int(substr($otherdata, 0, 1)); + $info_png_chunk_type_text['compression_method'] = getid3_lib::BigEndian2Int($otherdata[1]); + $info_png_chunk_type_text['compression_method_text'] = getid3_png::PNGcompressionMethodLookup($info_png_chunk_type_text['compression_method']); + list($languagetag, $translatedkeyword, $text) = explode("\x00", substr($otherdata, 2), 3); + $info_png_chunk_type_text['language_tag'] = $languagetag; + $info_png_chunk_type_text['translated_keyword'] = $translatedkeyword; + + if ($info_png_chunk_type_text['compression']) { + + switch ($info_png_chunk_type_text['compression_method']) { + case 0: + if (function_exists('gzuncompress')) { + $info_png_chunk_type_text['text'] = gzuncompress($text); + } + else { + if (!@$this->zlib_warning) { + $getid3->warning('PHP does not have --with-zlib support - cannot gzuncompress()'); + } + $this->zlib_warning = true; + } + break; + + default: + // unknown compression method + break; + } + + } else { + + $info_png_chunk_type_text['text'] = $text; + + } + + if (isset($info_png_chunk_type_text['text'])) { + $info_png['comments'][$info_png_chunk_type_text['keyword']][] = $info_png_chunk_type_text['text']; + } + break; + + + case 'bKGD': // Background Color + $info_png_chunk_type_text['header'] = $chunk; + switch ($info_png['IHDR']['raw']['color_type']) { + case 0: + case 4: + $info_png_chunk_type_text['background_gray'] = getid3_lib::BigEndian2Int($chunk['data']); + break; + + case 2: + case 6: + $info_png_chunk_type_text['background_red'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0 * $info_png['IHDR']['raw']['bit_depth'], $info_png['IHDR']['raw']['bit_depth'])); + $info_png_chunk_type_text['background_green'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 1 * $info_png['IHDR']['raw']['bit_depth'], $info_png['IHDR']['raw']['bit_depth'])); + $info_png_chunk_type_text['background_blue'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 2 * $info_png['IHDR']['raw']['bit_depth'], $info_png['IHDR']['raw']['bit_depth'])); + break; + + case 3: + $info_png_chunk_type_text['background_index'] = getid3_lib::BigEndian2Int($chunk['data']); + break; + + default: + break; + } + break; + + + case 'pHYs': // Physical Pixel Dimensions + $info_png_chunk_type_text['header'] = $chunk; + $info_png_chunk_type_text['pixels_per_unit_x'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 4)); + $info_png_chunk_type_text['pixels_per_unit_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 4, 4)); + $info_png_chunk_type_text['unit_specifier'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 8, 1)); + $info_png_chunk_type_text['unit'] = getid3_png::PNGpHYsUnitLookup($info_png_chunk_type_text['unit_specifier']); + break; + + + case 'sBIT': // Significant Bits + $info_png_chunk_type_text['header'] = $chunk; + switch ($info_png['IHDR']['raw']['color_type']) { + case 0: + $info_png_chunk_type_text['significant_bits_gray'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 1)); + break; + + case 2: + case 3: + $info_png_chunk_type_text['significant_bits_red'] = getid3_lib::BigEndian2Int($chunk['data'][0]); + $info_png_chunk_type_text['significant_bits_green'] = getid3_lib::BigEndian2Int($chunk['data'][1]); + $info_png_chunk_type_text['significant_bits_blue'] = getid3_lib::BigEndian2Int($chunk['data'][2]); + break; + + case 4: + $info_png_chunk_type_text['significant_bits_gray'] = getid3_lib::BigEndian2Int($chunk['data'][0]); + $info_png_chunk_type_text['significant_bits_alpha'] = getid3_lib::BigEndian2Int($chunk['data'][1]); + break; + + case 6: + $info_png_chunk_type_text['significant_bits_red'] = getid3_lib::BigEndian2Int($chunk['data'][0]); + $info_png_chunk_type_text['significant_bits_green'] = getid3_lib::BigEndian2Int($chunk['data'][1]); + $info_png_chunk_type_text['significant_bits_blue'] = getid3_lib::BigEndian2Int($chunk['data'][2]); + $info_png_chunk_type_text['significant_bits_alpha'] = getid3_lib::BigEndian2Int($chunk['data'][3]); + break; + + default: + break; + } + break; + + + case 'sPLT': // Suggested Palette + $info_png_chunk_type_text['header'] = $chunk; + + list($palettename, $otherdata) = explode("\x00", $chunk['data'], 2); + $info_png_chunk_type_text['palette_name'] = $palettename; + + $info_png_chunk_type_text['sample_depth_bits'] = getid3_lib::BigEndian2Int($otherdata[0]); + $info_png_chunk_type_text['sample_depth_bytes'] = $info_png_chunk_type_text['sample_depth_bits'] / 8; + + $s_plt_offset = 1; + $paletteCounter = 0; + while ($s_plt_offset < strlen($otherdata)) { + + $info_png_chunk_type_text['red'][$paletteCounter] = getid3_lib::BigEndian2Int(substr($otherdata, $s_plt_offset, $info_png_chunk_type_text['sample_depth_bytes'])); + $s_plt_offset += $info_png_chunk_type_text['sample_depth_bytes']; + + $info_png_chunk_type_text['green'][$paletteCounter] = getid3_lib::BigEndian2Int(substr($otherdata, $s_plt_offset, $info_png_chunk_type_text['sample_depth_bytes'])); + $s_plt_offset += $info_png_chunk_type_text['sample_depth_bytes']; + + $info_png_chunk_type_text['blue'][$paletteCounter] = getid3_lib::BigEndian2Int(substr($otherdata, $s_plt_offset, $info_png_chunk_type_text['sample_depth_bytes'])); + $s_plt_offset += $info_png_chunk_type_text['sample_depth_bytes']; + + $info_png_chunk_type_text['alpha'][$paletteCounter] = getid3_lib::BigEndian2Int(substr($otherdata, $s_plt_offset, $info_png_chunk_type_text['sample_depth_bytes'])); + $s_plt_offset += $info_png_chunk_type_text['sample_depth_bytes']; + + $info_png_chunk_type_text['frequency'][$paletteCounter] = getid3_lib::BigEndian2Int(substr($otherdata, $s_plt_offset, 2)); + $s_plt_offset += 2; + + $paletteCounter++; + } + break; + + + case 'hIST': // Palette Histogram + $info_png_chunk_type_text['header'] = $chunk; + $h_ist_counter = 0; + while ($h_ist_counter < strlen($chunk['data'])) { + $info_png_chunk_type_text[$h_ist_counter] = getid3_lib::BigEndian2Int(substr($chunk['data'], $h_ist_counter / 2, 2)); + $h_ist_counter += 2; + } + break; + + + case 'tIME': // Image Last-Modification Time + $info_png_chunk_type_text['header'] = $chunk; + $info_png_chunk_type_text['year'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 2)); + $info_png_chunk_type_text['month'] = getid3_lib::BigEndian2Int($chunk['data']{2}); + $info_png_chunk_type_text['day'] = getid3_lib::BigEndian2Int($chunk['data']{3}); + $info_png_chunk_type_text['hour'] = getid3_lib::BigEndian2Int($chunk['data']{4}); + $info_png_chunk_type_text['minute'] = getid3_lib::BigEndian2Int($chunk['data']{5}); + $info_png_chunk_type_text['second'] = getid3_lib::BigEndian2Int($chunk['data']{6}); + $info_png_chunk_type_text['unix'] = gmmktime($info_png_chunk_type_text['hour'], $info_png_chunk_type_text['minute'], $info_png_chunk_type_text['second'], $info_png_chunk_type_text['month'], $info_png_chunk_type_text['day'], $info_png_chunk_type_text['year']); + break; + + + case 'oFFs': // Image Offset + $info_png_chunk_type_text['header'] = $chunk; + $info_png_chunk_type_text['position_x'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 4), false, true); + $info_png_chunk_type_text['position_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 4, 4), false, true); + $info_png_chunk_type_text['unit_specifier'] = getid3_lib::BigEndian2Int($chunk['data'][8]); + $info_png_chunk_type_text['unit'] = getid3_png::PNGoFFsUnitLookup($info_png_chunk_type_text['unit_specifier']); + break; + + + case 'pCAL': // Calibration Of Pixel Values + $info_png_chunk_type_text['header'] = $chunk; + list($calibrationname, $otherdata) = explode("\x00", $chunk['data'], 2); + $info_png_chunk_type_text['calibration_name'] = $calibrationname; + $info_png_chunk_type_text['original_zero'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 4), false, true); + $info_png_chunk_type_text['original_max'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 4, 4), false, true); + $info_png_chunk_type_text['equation_type'] = getid3_lib::BigEndian2Int($chunk['data'][8]); + $info_png_chunk_type_text['equation_type_text'] = getid3_png::PNGpCALequationTypeLookup($info_png_chunk_type_text['equation_type']); + $info_png_chunk_type_text['parameter_count'] = getid3_lib::BigEndian2Int($chunk['data'][9]); + $info_png_chunk_type_text['parameters'] = explode("\x00", substr($chunk['data'], 10)); + break; + + + case 'sCAL': // Physical Scale Of Image Subject + $info_png_chunk_type_text['header'] = $chunk; + $info_png_chunk_type_text['unit_specifier'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 1)); + $info_png_chunk_type_text['unit'] = getid3_png::PNGsCALUnitLookup($info_png_chunk_type_text['unit_specifier']); + list($info_png_chunk_type_text['pixel_width'], $info_png_chunk_type_text['pixel_height']) = explode("\x00", substr($chunk['data'], 1)); + break; + + + case 'gIFg': // GIF Graphic Control Extension + $gIFg_counter = 0; + if (isset($info_png_chunk_type_text) && is_array($info_png_chunk_type_text)) { + $gIFg_counter = count($info_png_chunk_type_text); + } + $info_png_chunk_type_text[$gIFg_counter]['header'] = $chunk; + $info_png_chunk_type_text[$gIFg_counter]['disposal_method'] = getid3_lib::BigEndian2Int($chunk['data'][0]); + $info_png_chunk_type_text[$gIFg_counter]['user_input_flag'] = getid3_lib::BigEndian2Int($chunk['data'][1]); + $info_png_chunk_type_text[$gIFg_counter]['delay_time'] = getid3_lib::BigEndian2Int($chunk['data'][2]); + break; + + + case 'gIFx': // GIF Application Extension + $gIFx_counter = 0; + if (isset($info_png_chunk_type_text) && is_array($info_png_chunk_type_text)) { + $gIFx_counter = count($info_png_chunk_type_text); + } + $info_png_chunk_type_text[$gIFx_counter]['header'] = $chunk; + $info_png_chunk_type_text[$gIFx_counter]['application_identifier'] = substr($chunk['data'], 0, 8); + $info_png_chunk_type_text[$gIFx_counter]['authentication_code'] = substr($chunk['data'], 8, 3); + $info_png_chunk_type_text[$gIFx_counter]['application_data'] = substr($chunk['data'], 11); + break; + + + case 'IDAT': // Image Data + $idat_information_field_index = 0; + if (isset($info_png['IDAT']) && is_array($info_png['IDAT'])) { + $idat_information_field_index = count($info_png['IDAT']); + } + unset($chunk['data']); + $info_png_chunk_type_text[$idat_information_field_index]['header'] = $chunk; + break; + + + case 'IEND': // Image Trailer + $info_png_chunk_type_text['header'] = $chunk; + break; + + + default: + $info_png_chunk_type_text['header'] = $chunk; + $getid3->warning('Unhandled chunk type: '.$chunk['type_text']); + break; + } + } + + return true; + } + + + + public static function PNGsRGBintentLookup($sRGB) { + + static $lookup = array ( + 0 => 'Perceptual', + 1 => 'Relative colorimetric', + 2 => 'Saturation', + 3 => 'Absolute colorimetric' + ); + return (isset($lookup[$sRGB]) ? $lookup[$sRGB] : 'invalid'); + } + + + + public static function PNGcompressionMethodLookup($compression_method) { + + return ($compression_method == 0 ? 'deflate/inflate' : 'invalid'); + } + + + + public static function PNGpHYsUnitLookup($unit_id) { + + static $lookup = array ( + 0 => 'unknown', + 1 => 'meter' + ); + return (isset($lookup[$unit_id]) ? $lookup[$unit_id] : 'invalid'); + } + + + + public static function PNGoFFsUnitLookup($unit_id) { + + static $lookup = array ( + 0 => 'pixel', + 1 => 'micrometer' + ); + return (isset($lookup[$unit_id]) ? $lookup[$unit_id] : 'invalid'); + } + + + + public static function PNGpCALequationTypeLookup($equation_type) { + + static $lookup = array ( + 0 => 'Linear mapping', + 1 => 'Base-e exponential mapping', + 2 => 'Arbitrary-base exponential mapping', + 3 => 'Hyperbolic mapping' + ); + return (isset($lookup[$equation_type]) ? $lookup[$equation_type] : 'invalid'); + } + + + + public static function PNGsCALUnitLookup($unit_id) { + + static $lookup = array ( + 0 => 'meter', + 1 => 'radian' + ); + return (isset($lookup[$unit_id]) ? $lookup[$unit_id] : 'invalid'); + } + + + + public static function IHDRcalculateBitsPerSample($color_type, $bit_depth) { + + switch ($color_type) { + case 0: // Each pixel is a grayscale sample. + return $bit_depth; + + case 2: // Each pixel is an R,G,B triple + return 3 * $bit_depth; + + case 3: // Each pixel is a palette index; a PLTE chunk must appear. + return $bit_depth; + + case 4: // Each pixel is a grayscale sample, followed by an alpha sample. + return 2 * $bit_depth; + + case 6: // Each pixel is an R,G,B triple, followed by an alpha sample. + return 4 * $bit_depth; + } + return false; + } + +} + + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.graphic.tiff.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.graphic.tiff.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,215 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.graphic.tiff.php | +// | Module for analyzing TIFF graphic files. | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.graphic.tiff.php,v 1.2 2006/11/02 10:48:02 ah Exp $ + + + +class getid3_tiff extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $tiff_header = fread($getid3->fp, 4); + + $getid3->info['tiff']['byte_order'] = substr($tiff_header, 0, 2) == 'II' ? 'Intel' : 'Motorola'; + $endian2int = substr($tiff_header, 0, 2) == 'II' ? 'LittleEndian2Int' : 'BigEndian2Int'; + + $getid3->info['fileformat'] = 'tiff'; + $getid3->info['video']['dataformat'] = 'tiff'; + $getid3->info['video']['lossless'] = true; + $getid3->info['tiff']['ifd'] = array (); + $current_ifd = array (); + + $field_type_byte_length = array (1=>1, 2=>1, 3=>2, 4=>4, 5=>8); + + $next_ifd_offset = getid3_lib::$endian2int(fread($getid3->fp, 4)); + + while ($next_ifd_offset > 0) { + + $current_ifd['offset'] = $next_ifd_offset; + + fseek($getid3->fp, $getid3->info['avdataoffset'] + $next_ifd_offset, SEEK_SET); + $current_ifd['fieldcount'] = getid3_lib::$endian2int(fread($getid3->fp, 2)); + + for ($i = 0; $i < $current_ifd['fieldcount']; $i++) { + + // shortcut + $current_ifd['fields'][$i] = array (); + $current_ifd_fields_i = &$current_ifd['fields'][$i]; + + $current_ifd_fields_i['raw']['tag'] = getid3_lib::$endian2int(fread($getid3->fp, 2)); + $current_ifd_fields_i['raw']['type'] = getid3_lib::$endian2int(fread($getid3->fp, 2)); + $current_ifd_fields_i['raw']['length'] = getid3_lib::$endian2int(fread($getid3->fp, 4)); + $current_ifd_fields_i['raw']['offset'] = fread($getid3->fp, 4); + + switch ($current_ifd_fields_i['raw']['type']) { + case 1: // BYTE An 8-bit unsigned integer. + if ($current_ifd_fields_i['raw']['length'] <= 4) { + $current_ifd_fields_i['value'] = getid3_lib::$endian2int(substr($current_ifd_fields_i['raw']['offset'], 0, 1)); + } else { + $current_ifd_fields_i['offset'] = getid3_lib::$endian2int($current_ifd_fields_i['raw']['offset']); + } + break; + + case 2: // ASCII 8-bit bytes that store ASCII codes; the last byte must be null. + if ($current_ifd_fields_i['raw']['length'] <= 4) { + $current_ifd_fields_i['value'] = substr($current_ifd_fields_i['raw']['offset'], 3); + } else { + $current_ifd_fields_i['offset'] = getid3_lib::$endian2int($current_ifd_fields_i['raw']['offset']); + } + break; + + case 3: // SHORT A 16-bit (2-byte) unsigned integer. + if ($current_ifd_fields_i['raw']['length'] <= 2) { + $current_ifd_fields_i['value'] = getid3_lib::$endian2int(substr($current_ifd_fields_i['raw']['offset'], 0, 2)); + } else { + $current_ifd_fields_i['offset'] = getid3_lib::$endian2int($current_ifd_fields_i['raw']['offset']); + } + break; + + case 4: // LONG A 32-bit (4-byte) unsigned integer. + if ($current_ifd_fields_i['raw']['length'] <= 1) { + $current_ifd_fields_i['value'] = getid3_lib::$endian2int($current_ifd_fields_i['raw']['offset']); + } else { + $current_ifd_fields_i['offset'] = getid3_lib::$endian2int($current_ifd_fields_i['raw']['offset']); + } + break; + + case 5: // RATIONAL Two LONG_s: the first represents the numerator of a fraction, the second the denominator. + break; + } + } + + $getid3->info['tiff']['ifd'][] = $current_ifd; + $current_ifd = array (); + $next_ifd_offset = getid3_lib::$endian2int(fread($getid3->fp, 4)); + + } + + foreach ($getid3->info['tiff']['ifd'] as $ifd_id => $ifd_array) { + foreach ($ifd_array['fields'] as $key => $field_array) { + switch ($field_array['raw']['tag']) { + case 256: // ImageWidth + case 257: // ImageLength + case 258: // BitsPerSample + case 259: // Compression + if (!isset($field_array['value'])) { + fseek($getid3->fp, $field_array['offset'], SEEK_SET); + $getid3->info['tiff']['ifd'][$ifd_id]['fields'][$key]['raw']['data'] = fread($getid3->fp, $field_array['raw']['length'] * $field_type_byte_length[$field_array['raw']['type']]); + } + break; + + case 270: // ImageDescription + case 271: // Make + case 272: // Model + case 305: // Software + case 306: // DateTime + case 315: // Artist + case 316: // HostComputer + if (isset($field_array['value'])) { + $getid3->info['tiff']['ifd'][$ifd_id]['fields'][$key]['raw']['data'] = $field_array['value']; + } else { + fseek($getid3->fp, $field_array['offset'], SEEK_SET); + $getid3->info['tiff']['ifd'][$ifd_id]['fields'][$key]['raw']['data'] = fread($getid3->fp, $field_array['raw']['length'] * $field_type_byte_length[$field_array['raw']['type']]); + } + break; + } + switch ($field_array['raw']['tag']) { + case 256: // ImageWidth + $getid3->info['video']['resolution_x'] = $field_array['value']; + break; + + case 257: // ImageLength + $getid3->info['video']['resolution_y'] = $field_array['value']; + break; + + case 258: // BitsPerSample + if (isset($field_array['value'])) { + $getid3->info['video']['bits_per_sample'] = $field_array['value']; + } else { + $getid3->info['video']['bits_per_sample'] = 0; + for ($i = 0; $i < $field_array['raw']['length']; $i++) { + $getid3->info['video']['bits_per_sample'] += getid3_lib::$endian2int(substr($getid3->info['tiff']['ifd'][$ifd_id]['fields'][$key]['raw']['data'], $i * $field_type_byte_length[$field_array['raw']['type']], $field_type_byte_length[$field_array['raw']['type']])); + } + } + break; + + case 259: // Compression + $getid3->info['video']['codec'] = getid3_tiff::TIFFcompressionMethod($field_array['value']); + break; + + case 270: // ImageDescription + case 271: // Make + case 272: // Model + case 305: // Software + case 306: // DateTime + case 315: // Artist + case 316: // HostComputer + @$getid3->info['tiff']['comments'][getid3_tiff::TIFFcommentName($field_array['raw']['tag'])][] = $getid3->info['tiff']['ifd'][$ifd_id]['fields'][$key]['raw']['data']; + break; + + default: + break; + } + } + } + + return true; + } + + + + public static function TIFFcompressionMethod($id) { + + static $lookup = array ( + 1 => 'Uncompressed', + 2 => 'Huffman', + 3 => 'Fax - CCITT 3', + 5 => 'LZW', + 32773 => 'PackBits', + ); + return (isset($lookup[$id]) ? $lookup[$id] : 'unknown/invalid ('.$id.')'); + } + + + + public static function TIFFcommentName($id) { + + static $lookup = array ( + 270 => 'imagedescription', + 271 => 'make', + 272 => 'model', + 305 => 'software', + 306 => 'datetime', + 315 => 'artist', + 316 => 'hostcomputer', + ); + return (isset($lookup[$id]) ? $lookup[$id] : 'unknown/invalid ('.$id.')'); + } + +} + + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.lib.data_hash.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.lib.data_hash.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,196 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.lib.data-hash.php | +// | getID3() library file. | +// | dependencies: NONE. | +// +----------------------------------------------------------------------+ +// +// $Id: module.lib.data_hash.php,v 1.5 2006/12/03 19:28:18 ah Exp $ + + + +class getid3_lib_data_hash +{ + + private $getid3; + + + // constructer - calculate md5/sha1 data + public function __construct(getID3 $getid3, $algorithm) { + + $this->getid3 = $getid3; + + // Check algorithm + if (!preg_match('/^(md5|sha1)$/', $algorithm)) { + throw new getid3_exception('Unsupported algorithm, "'.$algorithm.'", in GetHashdata()'); + } + + + //// Handle ogg vorbis files + + if ((@$getid3->info['fileformat'] == 'ogg') && (@$getid3->info['audio']['dataformat'] == 'vorbis')) { + + // We cannot get an identical md5_data value for Ogg files where the comments + // span more than 1 Ogg page (compared to the same audio data with smaller + // comments) using the normal getID3() method of MD5'ing the data between the + // end of the comments and the end of the file (minus any trailing tags), + // because the page sequence numbers of the pages that the audio data is on + // do not match. Under normal circumstances, where comments are smaller than + // the nominal 4-8kB page size, then this is not a problem, but if there are + // very large comments, the only way around it is to strip off the comment + // tags with vorbiscomment and MD5 that file. + // This procedure must be applied to ALL Ogg files, not just the ones with + // comments larger than 1 page, because the below method simply MD5's the + // whole file with the comments stripped, not just the portion after the + // comments block (which is the standard getID3() method. + + // The above-mentioned problem of comments spanning multiple pages and changing + // page sequence numbers likely happens for OggSpeex and OggFLAC as well, but + // currently vorbiscomment only works on OggVorbis files. + + if ((bool)ini_get('safe_mode')) { + throw new getid3_exception('PHP running in Safe Mode - cannot make system call to vorbiscomment[.exe] needed for '.$algorithm.'_data.'); + } + + if (!preg_match('/^Vorbiscomment /', `vorbiscomment --version 2>&1`)) { + throw new getid3_exception('vorbiscomment[.exe] binary not found in path. UNIX: typically /usr/bin. Windows: typically c:\windows\system32.'); + } + + // Prevent user from aborting script + $old_abort = ignore_user_abort(true); + + // Create empty file + $empty = tempnam('*', 'getID3'); + touch($empty); + + // Use vorbiscomment to make temp file without comments + $temp = tempnam('*', 'getID3'); + + $command_line = 'vorbiscomment -w -c '.escapeshellarg($empty).' '.escapeshellarg(realpath($getid3->filename)).' '.escapeshellarg($temp).' 2>&1'; + + // Error from vorbiscomment + if ($vorbis_comment_error = `$command_line`) { + throw new getid3_exception('System call to vorbiscomment[.exe] failed.'); + } + + // Get hash of newly created file + $hash_function = $algorithm . '_file'; + $getid3->info[$algorithm.'_data'] = $hash_function($temp); + + // Clean up + unlink($empty); + unlink($temp); + + // Reset abort setting + ignore_user_abort($old_abort); + + // Return success + return true; + } + + //// Handle other file formats + + // Get hash from part of file + if (@$getid3->info['avdataoffset'] || (@$getid3->info['avdataend'] && @$getid3->info['avdataend'] < $getid3->info['filesize'])) { + + if ((bool)ini_get('safe_mode')) { + $getid3->warning('PHP running in Safe Mode - backtick operator not available, using slower non-system-call '.$algorithm.' algorithm.'); + $hash_function = 'hash_file_partial_safe_mode'; + } + else { + $hash_function = 'hash_file_partial'; + } + + $getid3->info[$algorithm.'_data'] = $this->$hash_function($getid3->filename, $getid3->info['avdataoffset'], $getid3->info['avdataend'], $algorithm); + } + + // Get hash from whole file - use built-in md5_file() and sha1_file() + else { + $hash_function = $algorithm . '_file'; + $getid3->info[$algorithm.'_data'] = $hash_function($getid3->filename); + } + } + + + + // Return md5/sha1sum for a file from starting position to absolute end position + // Using windows system call + private function hash_file_partial($file, $offset, $end, $algorithm) { + + // It seems that sha1sum.exe for Windows only works on physical files, does not accept piped data + // Fall back to create-temp-file method: + if ($algorithm == 'sha1' && strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') { + return $this->hash_file_partial_safe_mode($file, $offset, $end, $algorithm); + } + + // Check for presence of binaries and revert to safe mode if not found + if (!`head --version`) { + return $this->hash_file_partial_safe_mode($file, $offset, $end, $algorithm); + } + + if (!`tail --version`) { + return $this->hash_file_partial_safe_mode($file, $offset, $end, $algorithm); + } + + if (!`${algorithm}sum --version`) { + return $this->hash_file_partial_safe_mode($file, $offset, $end, $algorithm); + } + + $size = $end - $offset; + $command_line = 'head -c'.$end.' '.escapeshellarg(realpath($file)).' | tail -c'.$size.' | '.$algorithm.'sum'; + return substr(`$command_line`, 0, $algorithm == 'md5' ? 32 : 40); + } + + + + // Return md5/sha1sum for a file from starting position to absolute end position + // Using slow safe_mode temp file + private function hash_file_partial_safe_mode($file, $offset, $end, $algorithm) { + + // Attempt to create a temporary file in the system temp directory - invalid dirname should force to system temp dir + if (($data_filename = tempnam('*', 'getID3')) === false) { + throw new getid3_exception('Unable to create temporary file.'); + } + + // Init + $result = false; + + // Copy parts of file + if ($fp = @fopen($file, 'rb')) { + + if ($fp_data = @fopen($data_filename, 'wb')) { + + fseek($fp, $offset, SEEK_SET); + $bytes_left_to_write = $end - $offset; + while (($bytes_left_to_write > 0) && ($buffer = fread($fp, getid3::FREAD_BUFFER_SIZE))) { + $bytes_written = fwrite($fp_data, $buffer, $bytes_left_to_write); + $bytes_left_to_write -= $bytes_written; + } + fclose($fp_data); + $hash_function = $algorithm . '_file'; + $result = $hash_function($data_filename); + + } + fclose($fp); + } + unlink($data_filename); + return $result; + } + +} + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.lib.iconv_replacement.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.lib.iconv_replacement.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,415 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.lib.iconv_replacement.php | +// | getID3() library file. | +// | dependencies: NONE, required by getid3.php if no iconv() present. | +// +----------------------------------------------------------------------+ +// +// $Id: module.lib.iconv_replacement.php,v 1.4 2006/11/02 10:48:02 ah Exp $ + + +class getid3_iconv_replacement +{ + + public static function iconv($in_charset, $out_charset, $string) { + + if ($in_charset == $out_charset) { + return $string; + } + + static $supported_charsets = array ( + 'ISO-8859-1' => 'iso88591', + 'UTF-8' => 'utf8', + 'UTF-16BE' => 'utf16be', + 'UTF-16LE' => 'utf16le', + 'UTF-16' => 'utf16' + ); + + // Convert + $function_name = 'iconv_' . @$supported_charsets[$in_charset] . '_' . @$supported_charsets[$out_charset]; + + if (is_callable(array('getid3_iconv_replacement', $function_name))) { + return getid3_iconv_replacement::$function_name($string); + } + + // Invalid charset used + if (!@$supported_charsets[$in_charset]) { + throw new getid3_exception('PHP does not have iconv() support - cannot use ' . $in_charset . ' charset.'); + } + + if (!@$supported_charsets[$out_charset]) { + throw new getid3_exception('PHP does not have iconv() support - cannot use ' . $out_charset . ' charset.'); + } + } + + + + public static function iconv_int_utf8($charval) { + if ($charval < 128) { + // 0bbbbbbb + $newcharstring = chr($charval); + } elseif ($charval < 2048) { + // 110bbbbb 10bbbbbb + $newcharstring = chr(($charval >> 6) | 0xC0); + $newcharstring .= chr(($charval & 0x3F) | 0x80); + } elseif ($charval < 65536) { + // 1110bbbb 10bbbbbb 10bbbbbb + $newcharstring = chr(($charval >> 12) | 0xE0); + $newcharstring .= chr(($charval >> 6) | 0xC0); + $newcharstring .= chr(($charval & 0x3F) | 0x80); + } else { + // 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb + $newcharstring = chr(($charval >> 18) | 0xF0); + $newcharstring .= chr(($charval >> 12) | 0xC0); + $newcharstring .= chr(($charval >> 6) | 0xC0); + $newcharstring .= chr(($charval & 0x3F) | 0x80); + } + return $newcharstring; + } + + + + // ISO-8859-1 => UTF-8 + public static function iconv_iso88591_utf8($string, $bom=false) { + if (function_exists('utf8_encode')) { + return utf8_encode($string); + } + // utf8_encode() unavailable, use getID3()'s iconv() conversions (possibly PHP is compiled without XML support) + $newcharstring = ''; + if ($bom) { + $newcharstring .= "\xEF\xBB\xBF"; + } + for ($i = 0; $i < strlen($string); $i++) { + $charval = ord($string{$i}); + $newcharstring .= getid3_iconv_replacement::iconv_int_utf8($charval); + } + return $newcharstring; + } + + + + // ISO-8859-1 => UTF-16BE + public static function iconv_iso88591_utf16be($string, $bom=false) { + $newcharstring = ''; + if ($bom) { + $newcharstring .= "\xFE\xFF"; + } + for ($i = 0; $i < strlen($string); $i++) { + $newcharstring .= "\x00".$string{$i}; + } + return $newcharstring; + } + + + + // ISO-8859-1 => UTF-16LE + public static function iconv_iso88591_utf16le($string, $bom=false) { + $newcharstring = ''; + if ($bom) { + $newcharstring .= "\xFF\xFE"; + } + for ($i = 0; $i < strlen($string); $i++) { + $newcharstring .= $string{$i}."\x00"; + } + return $newcharstring; + } + + + + // ISO-8859-1 => UTF-16 + public static function iconv_iso88591_utf16($string) { + return getid3_lib::iconv_iso88591_utf16le($string, true); + } + + + + // UTF-8 => ISO-8859-1 + public static function iconv_utf8_iso88591($string) { + if (function_exists('utf8_decode')) { + return utf8_decode($string); + } + // utf8_decode() unavailable, use getID3()'s iconv() conversions (possibly PHP is compiled without XML support) + $newcharstring = ''; + $offset = 0; + $stringlength = strlen($string); + while ($offset < $stringlength) { + if ((ord($string{$offset}) | 0x07) == 0xF7) { + // 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb + $charval = ((ord($string{($offset + 0)}) & 0x07) << 18) & + ((ord($string{($offset + 1)}) & 0x3F) << 12) & + ((ord($string{($offset + 2)}) & 0x3F) << 6) & + (ord($string{($offset + 3)}) & 0x3F); + $offset += 4; + } elseif ((ord($string{$offset}) | 0x0F) == 0xEF) { + // 1110bbbb 10bbbbbb 10bbbbbb + $charval = ((ord($string{($offset + 0)}) & 0x0F) << 12) & + ((ord($string{($offset + 1)}) & 0x3F) << 6) & + (ord($string{($offset + 2)}) & 0x3F); + $offset += 3; + } elseif ((ord($string{$offset}) | 0x1F) == 0xDF) { + // 110bbbbb 10bbbbbb + $charval = ((ord($string{($offset + 0)}) & 0x1F) << 6) & + (ord($string{($offset + 1)}) & 0x3F); + $offset += 2; + } elseif ((ord($string{$offset}) | 0x7F) == 0x7F) { + // 0bbbbbbb + $charval = ord($string{$offset}); + $offset += 1; + } else { + // error? throw some kind of warning here? + $charval = false; + $offset += 1; + } + if ($charval !== false) { + $newcharstring .= (($charval < 256) ? chr($charval) : '?'); + } + } + return $newcharstring; + } + + + + // UTF-8 => UTF-16BE + public static function iconv_utf8_utf16be($string, $bom=false) { + $newcharstring = ''; + if ($bom) { + $newcharstring .= "\xFE\xFF"; + } + $offset = 0; + $stringlength = strlen($string); + while ($offset < $stringlength) { + if ((ord($string{$offset}) | 0x07) == 0xF7) { + // 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb + $charval = ((ord($string{($offset + 0)}) & 0x07) << 18) & + ((ord($string{($offset + 1)}) & 0x3F) << 12) & + ((ord($string{($offset + 2)}) & 0x3F) << 6) & + (ord($string{($offset + 3)}) & 0x3F); + $offset += 4; + } elseif ((ord($string{$offset}) | 0x0F) == 0xEF) { + // 1110bbbb 10bbbbbb 10bbbbbb + $charval = ((ord($string{($offset + 0)}) & 0x0F) << 12) & + ((ord($string{($offset + 1)}) & 0x3F) << 6) & + (ord($string{($offset + 2)}) & 0x3F); + $offset += 3; + } elseif ((ord($string{$offset}) | 0x1F) == 0xDF) { + // 110bbbbb 10bbbbbb + $charval = ((ord($string{($offset + 0)}) & 0x1F) << 6) & + (ord($string{($offset + 1)}) & 0x3F); + $offset += 2; + } elseif ((ord($string{$offset}) | 0x7F) == 0x7F) { + // 0bbbbbbb + $charval = ord($string{$offset}); + $offset += 1; + } else { + // error? throw some kind of warning here? + $charval = false; + $offset += 1; + } + if ($charval !== false) { + $newcharstring .= (($charval < 65536) ? getid3_lib::BigEndian2String($charval, 2) : "\x00".'?'); + } + } + return $newcharstring; + } + + + + // UTF-8 => UTF-16LE + public static function iconv_utf8_utf16le($string, $bom=false) { + $newcharstring = ''; + if ($bom) { + $newcharstring .= "\xFF\xFE"; + } + $offset = 0; + $stringlength = strlen($string); + while ($offset < $stringlength) { + if ((ord($string{$offset}) | 0x07) == 0xF7) { + // 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb + $charval = ((ord($string{($offset + 0)}) & 0x07) << 18) & + ((ord($string{($offset + 1)}) & 0x3F) << 12) & + ((ord($string{($offset + 2)}) & 0x3F) << 6) & + (ord($string{($offset + 3)}) & 0x3F); + $offset += 4; + } elseif ((ord($string{$offset}) | 0x0F) == 0xEF) { + // 1110bbbb 10bbbbbb 10bbbbbb + $charval = ((ord($string{($offset + 0)}) & 0x0F) << 12) & + ((ord($string{($offset + 1)}) & 0x3F) << 6) & + (ord($string{($offset + 2)}) & 0x3F); + $offset += 3; + } elseif ((ord($string{$offset}) | 0x1F) == 0xDF) { + // 110bbbbb 10bbbbbb + $charval = ((ord($string{($offset + 0)}) & 0x1F) << 6) & + (ord($string{($offset + 1)}) & 0x3F); + $offset += 2; + } elseif ((ord($string{$offset}) | 0x7F) == 0x7F) { + // 0bbbbbbb + $charval = ord($string{$offset}); + $offset += 1; + } else { + // error? maybe throw some warning here? + $charval = false; + $offset += 1; + } + if ($charval !== false) { + $newcharstring .= (($charval < 65536) ? getid3_lib::LittleEndian2String($charval, 2) : '?'."\x00"); + } + } + return $newcharstring; + } + + + + // UTF-8 => UTF-16 + public static function iconv_utf8_utf16($string) { + return getid3_lib::iconv_utf8_utf16le($string, true); + } + + + + // UTF-16BE => ISO-8859-1 + public static function iconv_utf16be_iso88591($string) { + if (substr($string, 0, 2) == "\xFE\xFF") { + // strip BOM + $string = substr($string, 2); + } + $newcharstring = ''; + for ($i = 0; $i < strlen($string); $i += 2) { + $charval = getid3_lib::BigEndian2Int(substr($string, $i, 2)); + $newcharstring .= (($charval < 256) ? chr($charval) : '?'); + } + return $newcharstring; + } + + + + // UTF-16BE => UTF-8 + public static function iconv_utf16be_utf8($string) { + if (substr($string, 0, 2) == "\xFE\xFF") { + // strip BOM + $string = substr($string, 2); + } + $newcharstring = ''; + for ($i = 0; $i < strlen($string); $i += 2) { + $charval = getid3_lib::BigEndian2Int(substr($string, $i, 2)); + $newcharstring .= getid3_iconv_replacement::iconv_int_utf8($charval); + } + return $newcharstring; + } + + + + // UTF-16BE => UTF-16LE + public static function iconv_utf16be_utf16le($string) { + return getid3_iconv_replacement::iconv_utf8_utf16le(getid3_iconv_replacement::iconv_utf16be_utf8($string)); + } + + + + // UTF-16BE => UTF-16 + public static function iconv_utf16be_utf16($string) { + return getid3_iconv_replacement::iconv_utf8_utf16(getid3_iconv_replacement::iconv_utf16be_utf8($string)); + } + + + + // UTF-16LE => ISO-8859-1 + public static function iconv_utf16le_iso88591($string) { + if (substr($string, 0, 2) == "\xFF\xFE") { + // strip BOM + $string = substr($string, 2); + } + $newcharstring = ''; + for ($i = 0; $i < strlen($string); $i += 2) { + $charval = getid3_lib::LittleEndian2Int(substr($string, $i, 2)); + $newcharstring .= (($charval < 256) ? chr($charval) : '?'); + } + return $newcharstring; + } + + + + // UTF-16LE => UTF-8 + public static function iconv_utf16le_utf8($string) { + if (substr($string, 0, 2) == "\xFF\xFE") { + // strip BOM + $string = substr($string, 2); + } + $newcharstring = ''; + for ($i = 0; $i < strlen($string); $i += 2) { + $charval = getid3_lib::LittleEndian2Int(substr($string, $i, 2)); + $newcharstring .= getid3_iconv_replacement::iconv_int_utf8($charval); + } + return $newcharstring; + } + + + + // UTF-16LE => UTF-16BE + public static function iconv_utf16le_utf16be($string) { + return getid3_iconv_replacement::iconv_utf8_utf16be(getid3_iconv_replacement::iconv_utf16le_utf8($string)); + } + + + + // UTF-16LE => UTF-16 + public static function iconv_utf16le_utf16($string) { + return getid3_iconv_replacement::iconv_utf8_utf16(getid3_iconv_replacement::iconv_utf16le_utf8($string)); + } + + + + // UTF-16 => ISO-8859-1 + public static function iconv_utf16_iso88591($string) { + $bom = substr($string, 0, 2); + if ($bom == "\xFE\xFF") { + return getid3_lib::iconv_utf16be_iso88591(substr($string, 2)); + } elseif ($bom == "\xFF\xFE") { + return getid3_lib::iconv_utf16le_iso88591(substr($string, 2)); + } + return $string; + } + + + + // UTF-16 => UTF-8 + public static function iconv_utf16_utf8($string) { + $bom = substr($string, 0, 2); + if ($bom == "\xFE\xFF") { + return getid3_iconv_replacement::iconv_utf16be_utf8(substr($string, 2)); + } elseif ($bom == "\xFF\xFE") { + return getid3_iconv_replacement::iconv_utf16le_utf8(substr($string, 2)); + } + return $string; + } + + + + // UTF-16 => UTF-16BE + public static function iconv_utf16_utf16be($string) { + return getid3_iconv_replacement::iconv_utf8_utf16be(getid3_iconv_replacement::iconv_utf16_utf8($string)); + } + + + + // UTF-16 => UTF-16LE + public static function iconv_utf16_utf16le($string) { + return getid3_iconv_replacement::iconv_utf8_utf16le(getid3_iconv_replacement::iconv_utf16_utf8($string)); + } + +} + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.lib.image_size.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.lib.image_size.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,126 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.lib.data-hash.php | +// | getID3() library file. | +// | dependencies: NONE. | +// +----------------------------------------------------------------------+ +// +// $Id: module.lib.image_size.php,v 1.2 2006/11/02 10:48:02 ah Exp $ + + + +class getid3_lib_image_size +{ + + const GIF_SIG = "\x47\x49\x46"; // 'GIF' + const PNG_SIG = "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A"; + const JPG_SIG = "\xFF\xD8\xFF"; + const JPG_SOS = "\xDA"; // Start Of Scan - image data start + const JPG_SOF0 = "\xC0"; // Start Of Frame N + const JPG_SOF1 = "\xC1"; // N indicates which compression process + const JPG_SOF2 = "\xC2"; // Only SOF0-SOF2 are now in common use + const JPG_SOF3 = "\xC3"; // NB: codes C4 and CC are *not* SOF markers + const JPG_SOF5 = "\xC5"; + const JPG_SOF6 = "\xC6"; + const JPG_SOF7 = "\xC7"; + const JPG_SOF9 = "\xC9"; + const JPG_SOF10 = "\xCA"; + const JPG_SOF11 = "\xCB"; // NB: codes C4 and CC are *not* SOF markers + const JPG_SOF13 = "\xCD"; + const JPG_SOF14 = "\xCE"; + const JPG_SOF15 = "\xCF"; + const JPG_EOI = "\xD9"; // End Of Image (end of datastream) + + + static public function get($img_data) { + + $height = $width = $type = ''; + + if ((substr($img_data, 0, 3) == getid3_lib_image_size::GIF_SIG) && (strlen($img_data) > 10)) { + + $dim = unpack('v2dim', substr($img_data, 6, 4)); + $width = $dim['dim1']; + $height = $dim['dim2']; + $type = 1; + + } elseif ((substr($img_data, 0, 8) == getid3_lib_image_size::PNG_SIG) && (strlen($img_data) > 24)) { + + $dim = unpack('N2dim', substr($img_data, 16, 8)); + $width = $dim['dim1']; + $height = $dim['dim2']; + $type = 3; + + } elseif ((substr($img_data, 0, 3) == getid3_lib_image_size::JPG_SIG) && (strlen($img_data) > 4)) { + + ///////////////// JPG CHUNK SCAN //////////////////// + $img_pos = $type = 2; + $buffer = strlen($img_data) - 2; + while ($img_pos < strlen($img_data)) { + + // synchronize to the marker 0xFF + $img_pos = strpos($img_data, 0xFF, $img_pos) + 1; + $marker = $img_data[$img_pos]; + do { + $marker = ord($img_data[$img_pos++]); + } while ($marker == 255); + + // find dimensions of block + switch (chr($marker)) { + + // Grab width/height from SOF segment (these are acceptable chunk types) + case getid3_lib_image_size::JPG_SOF0: + case getid3_lib_image_size::JPG_SOF1: + case getid3_lib_image_size::JPG_SOF2: + case getid3_lib_image_size::JPG_SOF3: + case getid3_lib_image_size::JPG_SOF5: + case getid3_lib_image_size::JPG_SOF6: + case getid3_lib_image_size::JPG_SOF7: + case getid3_lib_image_size::JPG_SOF9: + case getid3_lib_image_size::JPG_SOF10: + case getid3_lib_image_size::JPG_SOF11: + case getid3_lib_image_size::JPG_SOF13: + case getid3_lib_image_size::JPG_SOF14: + case getid3_lib_image_size::JPG_SOF15: + $dim = unpack('n2dim', substr($img_data, $img_pos + 3, 4)); + $height = $dim['dim1']; + $width = $dim['dim2']; + break 2; // found it so exit + + case getid3_lib_image_size::JPG_EOI: + case getid3_lib_image_size::JPG_SOS: + return false; + + default: // We're not interested in other markers + $skiplen = (ord($img_data[$img_pos++]) << 8) + ord($img_data[$img_pos++]) - 2; + // if the skip is more than what we've read in, read more + $buffer -= $skiplen; + if ($buffer < 512) { // if the buffer of data is too low, read more file. + return false; + } + $img_pos += $skiplen; + break; + } + } + } + + return array ($width, $height, $type); + } // end function + + +} + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.misc.iso.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.misc.iso.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,450 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.misc.iso.php | +// | Module for analyzing ISO files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.misc.iso.php,v 1.3 2006/11/02 10:48:02 ah Exp $ + + + +class getid3_iso extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->info['fileformat'] = 'iso'; + + for ($i = 16; $i <= 19; $i++) { + fseek($getid3->fp, 2048 * $i, SEEK_SET); + $iso_header = fread($getid3->fp, 2048); + if (substr($iso_header, 1, 5) == 'CD001') { + switch (ord($iso_header{0})) { + case 1: + $getid3->info['iso']['primary_volume_descriptor']['offset'] = 2048 * $i; + $this->ParsePrimaryVolumeDescriptor($iso_header); + break; + + case 2: + $getid3->info['iso']['supplementary_volume_descriptor']['offset'] = 2048 * $i; + $this->ParseSupplementaryVolumeDescriptor($iso_header); + break; + + default: + // skip + break; + } + } + } + + $this->ParsePathTable(); + + $getid3->info['iso']['files'] = array (); + foreach ($getid3->info['iso']['path_table']['directories'] as $directory_num => $directory_data) { + $getid3->info['iso']['directories'][$directory_num] = $this->ParseDirectoryRecord($directory_data); + } + + return true; + } + + + + private function ParsePrimaryVolumeDescriptor(&$iso_header) { + + $getid3 = $this->getid3; + + // ISO integer values are stored *BOTH* Little-Endian AND Big-Endian format!! + // ie 12345 == 0x3039 is stored as $39 $30 $30 $39 in a 4-byte field + + $getid3->info['iso']['primary_volume_descriptor']['raw'] = array (); + $info_iso_primaryVD = &$getid3->info['iso']['primary_volume_descriptor']; + $info_iso_primaryVD_raw = &$info_iso_primaryVD['raw']; + + $info_iso_primaryVD_raw['volume_descriptor_type'] = getid3_lib::LittleEndian2Int(substr($iso_header, 0, 1)); + $info_iso_primaryVD_raw['standard_identifier'] = substr($iso_header, 1, 5); + if ($info_iso_primaryVD_raw['standard_identifier'] != 'CD001') { + throw new getid3_exception('Expected "CD001" at offset ('.($info_iso_primaryVD['offset'] + 1).'), found "'.$info_iso_primaryVD_raw['standard_identifier'].'" instead'); + } + + getid3_lib::ReadSequence('LittleEndian2Int', $info_iso_primaryVD_raw, $iso_header, 6, + array ( + 'volume_descriptor_version' => 1, + 'IGNORE-unused_1' => 1, + 'system_identifier' => -32, // string + 'volume_identifier' => -32, // string + 'IGNORE-unused_2' => 8, + 'volume_space_size' => 4, + 'IGNORE-1' => 4, + 'IGNORE-unused_3' => 32, + 'volume_set_size' => 2, + 'IGNORE-2' => 2, + 'volume_sequence_number' => 2, + 'IGNORE-3' => 2, + 'logical_block_size' => 2, + 'IGNORE-4' => 2, + 'path_table_size' => 4, + 'IGNORE-5' => 4, + 'path_table_l_location' => 2, + 'IGNORE-6' => 2, + 'path_table_l_opt_location' => 2, + 'IGNORE-7' => 2, + 'path_table_m_location' => 2, + 'IGNORE-8' => 2, + 'path_table_m_opt_location' => 2, + 'IGNORE-9' => 2, + 'root_directory_record' => -34, // string + 'volume_set_identifier' => -128, // string + 'publisher_identifier' => -128, // string + 'data_preparer_identifier' => -128, // string + 'application_identifier' => -128, // string + 'copyright_file_identifier' => -37, // string + 'abstract_file_identifier' => -37, // string + 'bibliographic_file_identifier' => -37, // string + 'volume_creation_date_time' => -17, // string + 'volume_modification_date_time' => -17, // string + 'volume_expiration_date_time' => -17, // string + 'volume_effective_date_time' => -17, // string + 'file_structure_version' => 1, + 'IGNORE-unused_4' => 1, + 'application_data' => -512 // string + ) + ); + + $info_iso_primaryVD['system_identifier'] = trim($info_iso_primaryVD_raw['system_identifier']); + $info_iso_primaryVD['volume_identifier'] = trim($info_iso_primaryVD_raw['volume_identifier']); + $info_iso_primaryVD['volume_set_identifier'] = trim($info_iso_primaryVD_raw['volume_set_identifier']); + $info_iso_primaryVD['publisher_identifier'] = trim($info_iso_primaryVD_raw['publisher_identifier']); + $info_iso_primaryVD['data_preparer_identifier'] = trim($info_iso_primaryVD_raw['data_preparer_identifier']); + $info_iso_primaryVD['application_identifier'] = trim($info_iso_primaryVD_raw['application_identifier']); + $info_iso_primaryVD['copyright_file_identifier'] = trim($info_iso_primaryVD_raw['copyright_file_identifier']); + $info_iso_primaryVD['abstract_file_identifier'] = trim($info_iso_primaryVD_raw['abstract_file_identifier']); + $info_iso_primaryVD['bibliographic_file_identifier'] = trim($info_iso_primaryVD_raw['bibliographic_file_identifier']); + + $info_iso_primaryVD['volume_creation_date_time'] = getid3_iso::ISOtimeText2UNIXtime($info_iso_primaryVD_raw['volume_creation_date_time']); + $info_iso_primaryVD['volume_modification_date_time'] = getid3_iso::ISOtimeText2UNIXtime($info_iso_primaryVD_raw['volume_modification_date_time']); + $info_iso_primaryVD['volume_expiration_date_time'] = getid3_iso::ISOtimeText2UNIXtime($info_iso_primaryVD_raw['volume_expiration_date_time']); + $info_iso_primaryVD['volume_effective_date_time'] = getid3_iso::ISOtimeText2UNIXtime($info_iso_primaryVD_raw['volume_effective_date_time']); + + if (($info_iso_primaryVD_raw['volume_space_size'] * 2048) > $getid3->info['filesize']) { + throw new getid3_exception('Volume Space Size ('.($info_iso_primaryVD_raw['volume_space_size'] * 2048).' bytes) is larger than the file size ('.$getid3->info['filesize'].' bytes) (truncated file?)'); + } + + return true; + } + + + + private function ParseSupplementaryVolumeDescriptor(&$iso_header) { + + $getid3 = $this->getid3; + + // ISO integer values are stored Both-Endian format!! + // ie 12345 == 0x3039 is stored as $39 $30 $30 $39 in a 4-byte field + + $getid3->info['iso']['supplementary_volume_descriptor']['raw'] = array (); + $info_iso_supplementaryVD = &$getid3->info['iso']['supplementary_volume_descriptor']; + $info_iso_supplementaryVD_raw = &$info_iso_supplementaryVD['raw']; + + $info_iso_supplementaryVD_raw['volume_descriptor_type'] = getid3_lib::LittleEndian2Int(substr($iso_header, 0, 1)); + $info_iso_supplementaryVD_raw['standard_identifier'] = substr($iso_header, 1, 5); + if ($info_iso_supplementaryVD_raw['standard_identifier'] != 'CD001') { + throw new getid3_exception('Expected "CD001" at offset ('.($info_iso_supplementaryVD['offset'] + 1).'), found "'.$info_iso_supplementaryVD_raw['standard_identifier'].'" instead'); + } + + getid3_lib::ReadSequence('LittleEndian2Int', $info_iso_supplementaryVD_raw, $iso_header, 6, + array ( + 'volume_descriptor_version' => 1, + 'IGNORE-unused_1' => -1, + 'system_identifier' => -32, + 'volume_identifier' => -32, + 'IGNORE-unused_2' => -8, + 'volume_space_size' => 4, + 'IGNORE-1' => 4, + 'IGNORE-unused_3' => -32, + 'volume_set_size' => 2, + 'IGNORE-2' => 2, + 'volume_sequence_number' => 2, + 'IGNORE-3' => 2, + 'logical_block_size' => 2, + 'IGNORE-4' => 2, + 'path_table_size' => 4, + 'IGNORE-5' => 4, + 'path_table_l_location' => 2, + 'IGNORE-6' => 2, + 'path_table_l_opt_location' => 2, + 'IGNORE-7' => 2, + 'path_table_m_location' => 2, + 'IGNORE-8' => 2, + 'path_table_m_opt_location' => 2, + 'IGNORE-9' => 2, + 'root_directory_record' => -34, + 'volume_set_identifier' => -128, + 'publisher_identifier' => -128, + 'data_preparer_identifier' => -128, + 'application_identifier' => -128, + 'copyright_file_identifier' => -37, + 'abstract_file_identifier' => -37, + 'bibliographic_file_identifier' => -37, + 'volume_creation_date_time' => -17, + 'volume_modification_date_time' => -17, + 'volume_expiration_date_time' => -17, + 'volume_effective_date_time' => -17, + 'file_structure_version' => 1, + 'IGNORE-unused_4' => 1, + 'application_data' => -512 + ) + ); + + $info_iso_supplementaryVD['system_identifier'] = trim($info_iso_supplementaryVD_raw['system_identifier']); + $info_iso_supplementaryVD['volume_identifier'] = trim($info_iso_supplementaryVD_raw['volume_identifier']); + $info_iso_supplementaryVD['volume_set_identifier'] = trim($info_iso_supplementaryVD_raw['volume_set_identifier']); + $info_iso_supplementaryVD['publisher_identifier'] = trim($info_iso_supplementaryVD_raw['publisher_identifier']); + $info_iso_supplementaryVD['data_preparer_identifier'] = trim($info_iso_supplementaryVD_raw['data_preparer_identifier']); + $info_iso_supplementaryVD['application_identifier'] = trim($info_iso_supplementaryVD_raw['application_identifier']); + $info_iso_supplementaryVD['copyright_file_identifier'] = trim($info_iso_supplementaryVD_raw['copyright_file_identifier']); + $info_iso_supplementaryVD['abstract_file_identifier'] = trim($info_iso_supplementaryVD_raw['abstract_file_identifier']); + $info_iso_supplementaryVD['bibliographic_file_identifier'] = trim($info_iso_supplementaryVD_raw['bibliographic_file_identifier']); + + $info_iso_supplementaryVD['volume_creation_date_time'] = getid3_iso::ISOtimeText2UNIXtime($info_iso_supplementaryVD_raw['volume_creation_date_time']); + $info_iso_supplementaryVD['volume_modification_date_time'] = getid3_iso::ISOtimeText2UNIXtime($info_iso_supplementaryVD_raw['volume_modification_date_time']); + $info_iso_supplementaryVD['volume_expiration_date_time'] = getid3_iso::ISOtimeText2UNIXtime($info_iso_supplementaryVD_raw['volume_expiration_date_time']); + $info_iso_supplementaryVD['volume_effective_date_time'] = getid3_iso::ISOtimeText2UNIXtime($info_iso_supplementaryVD_raw['volume_effective_date_time']); + + if (($info_iso_supplementaryVD_raw['volume_space_size'] * $info_iso_supplementaryVD_raw['logical_block_size']) > $getid3->info['filesize']) { + throw new getid3_exception('Volume Space Size ('.($info_iso_supplementaryVD_raw['volume_space_size'] * $info_iso_supplementaryVD_raw['logical_block_size']).' bytes) is larger than the file size ('.$getid3->info['filesize'].' bytes) (truncated file?)'); + } + + return true; + } + + + + private function ParsePathTable() { + + $getid3 = $this->getid3; + + if (!isset($getid3->info['iso']['supplementary_volume_descriptor']['raw']['path_table_l_location']) && !isset($getid3->info['iso']['primary_volume_descriptor']['raw']['path_table_l_location'])) { + return false; + } + if (isset($getid3->info['iso']['supplementary_volume_descriptor']['raw']['path_table_l_location'])) { + $path_table_location = $getid3->info['iso']['supplementary_volume_descriptor']['raw']['path_table_l_location']; + $path_table_size = $getid3->info['iso']['supplementary_volume_descriptor']['raw']['path_table_size']; + $text_encoding = 'UTF-16BE'; // Big-Endian Unicode + } + else { + $path_table_location = $getid3->info['iso']['primary_volume_descriptor']['raw']['path_table_l_location']; + $path_table_size = $getid3->info['iso']['primary_volume_descriptor']['raw']['path_table_size']; + $text_encoding = 'ISO-8859-1'; // Latin-1 + } + + if (($path_table_location * 2048) > $getid3->info['filesize']) { + throw new getid3_exception('Path Table Location specifies an offset ('.($path_table_location * 2048).') beyond the end-of-file ('.$getid3->info['filesize'].')'); + } + + $getid3->info['iso']['path_table']['offset'] = $path_table_location * 2048; + fseek($getid3->fp, $getid3->info['iso']['path_table']['offset'], SEEK_SET); + $getid3->info['iso']['path_table']['raw'] = fread($getid3->fp, $path_table_size); + + $offset = 0; + $pathcounter = 1; + while ($offset < $path_table_size) { + + $getid3->info['iso']['path_table']['directories'][$pathcounter] = array (); + $info_iso_pathtable_directories_current = &$getid3->info['iso']['path_table']['directories'][$pathcounter]; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_iso_pathtable_directories_current, $getid3->info['iso']['path_table']['raw'], $offset, + array ( + 'length' => 1, + 'extended_length' => 1, + 'location_logical' => 4, + 'parent_directory' => 2, + ) + ); + + $info_iso_pathtable_directories_current['name'] = substr($getid3->info['iso']['path_table']['raw'], $offset+8, $info_iso_pathtable_directories_current['length']); + + $offset += 8 + $info_iso_pathtable_directories_current['length'] + ($info_iso_pathtable_directories_current['length'] % 2); + + $info_iso_pathtable_directories_current['name_ascii'] = $getid3->iconv($text_encoding, $getid3->encoding, $info_iso_pathtable_directories_current['name'], true); + + $info_iso_pathtable_directories_current['location_bytes'] = $info_iso_pathtable_directories_current['location_logical'] * 2048; + if ($pathcounter == 1) { + $info_iso_pathtable_directories_current['full_path'] = '/'; + } + else { + $info_iso_pathtable_directories_current['full_path'] = $getid3->info['iso']['path_table']['directories'][$info_iso_pathtable_directories_current['parent_directory']]['full_path'].$info_iso_pathtable_directories_current['name_ascii'].'/'; + } + $full_path_array[] = $info_iso_pathtable_directories_current['full_path']; + + $pathcounter++; + } + + return true; + } + + + + private function ParseDirectoryRecord($directory_data) { + + $getid3 = $this->getid3; + + $text_encoding = isset($getid3->info['iso']['supplementary_volume_descriptor']) ? 'UTF-16BE' : 'ISO-8859-1'; + + fseek($getid3->fp, $directory_data['location_bytes'], SEEK_SET); + $directory_record_data = fread($getid3->fp, 1); + + while (ord($directory_record_data{0}) > 33) { + + $directory_record_data .= fread($getid3->fp, ord($directory_record_data{0}) - 1); + + $this_directory_record = array (); + $this_directory_record['raw'] = array (); + $this_directory_record_raw = &$this_directory_record['raw']; + + getid3_lib::ReadSequence('LittleEndian2Int', $this_directory_record_raw, $directory_record_data, 0, + array ( + 'length' => 1, + 'extended_attribute_length' => 1, + 'offset_logical' => 4, + 'IGNORE-1' => 4, + 'filesize' => 4, + 'IGNORE-2' => 4, + 'recording_date_time' => -7, + 'file_flags' => 1, + 'file_unit_size' => 1, + 'interleave_gap_size' => 1, + 'volume_sequence_number' => 2, + 'IGNORE-3' => 2, + 'file_identifier_length' => 1, + ) + ); + + $this_directory_record_raw['file_identifier'] = substr($directory_record_data, 33, $this_directory_record_raw['file_identifier_length']); + + $this_directory_record['file_identifier_ascii'] = $getid3->iconv($text_encoding, $getid3->encoding, $this_directory_record_raw['file_identifier'], true); + $this_directory_record['filesize'] = $this_directory_record_raw['filesize']; + $this_directory_record['offset_bytes'] = $this_directory_record_raw['offset_logical'] * 2048; + $this_directory_record['file_flags']['hidden'] = (bool)($this_directory_record_raw['file_flags'] & 0x01); + $this_directory_record['file_flags']['directory'] = (bool)($this_directory_record_raw['file_flags'] & 0x02); + $this_directory_record['file_flags']['associated'] = (bool)($this_directory_record_raw['file_flags'] & 0x04); + $this_directory_record['file_flags']['extended'] = (bool)($this_directory_record_raw['file_flags'] & 0x08); + $this_directory_record['file_flags']['permissions'] = (bool)($this_directory_record_raw['file_flags'] & 0x10); + $this_directory_record['file_flags']['multiple'] = (bool)($this_directory_record_raw['file_flags'] & 0x80); + $this_directory_record['recording_timestamp'] = getid3_iso::ISOtime2UNIXtime($this_directory_record_raw['recording_date_time']); + + if ($this_directory_record['file_flags']['directory']) { + $this_directory_record['filename'] = $directory_data['full_path']; + } + else { + $this_directory_record['filename'] = $directory_data['full_path'].getid3_iso::ISOstripFilenameVersion($this_directory_record['file_identifier_ascii']); + $getid3->info['iso']['files'] = getid3_iso::array_merge_clobber($getid3->info['iso']['files'], getid3_iso::CreateDeepArray($this_directory_record['filename'], '/', $this_directory_record['filesize'])); + } + + $directory_record[] = $this_directory_record; + $directory_record_data = fread($getid3->fp, 1); + } + + return $directory_record; + } + + + + public static function ISOstripFilenameVersion($iso_filename) { + + // convert 'filename.ext;1' to 'filename.ext' + if (!strstr($iso_filename, ';')) { + return $iso_filename; + } + return substr($iso_filename, 0, strpos($iso_filename, ';')); + } + + + + public static function ISOtimeText2UNIXtime($iso_time) { + + if (!(int)substr($iso_time, 0, 4)) { + return false; + } + + return gmmktime((int)substr($iso_time, 8, 2), (int)substr($iso_time, 10, 2), (int)substr($iso_time, 12, 2), (int)substr($iso_time, 4, 2), (int)substr($iso_time, 6, 2), (int)substr($iso_time, 0, 4)); + } + + + + public static function ISOtime2UNIXtime($iso_time) { + + // Represented by seven bytes: + // 1: Number of years since 1900 + // 2: Month of the year from 1 to 12 + // 3: Day of the Month from 1 to 31 + // 4: Hour of the day from 0 to 23 + // 5: Minute of the hour from 0 to 59 + // 6: second of the minute from 0 to 59 + // 7: Offset from Greenwich Mean Time in number of 15 minute intervals from -48 (West) to +52 (East) + + return gmmktime(ord($iso_time[3]), ord($iso_time[4]), ord($iso_time[5]), ord($iso_time[1]), ord($iso_time[2]), ord($iso_time[0]) + 1900); + } + + + + public static function array_merge_clobber($array1, $array2) { + + // written by kcØhireability*com + // taken from http://www.php.net/manual/en/function.array-merge-recursive.php + + if (!is_array($array1) || !is_array($array2)) { + return false; + } + + $newarray = $array1; + foreach ($array2 as $key => $val) { + if (is_array($val) && isset($newarray[$key]) && is_array($newarray[$key])) { + $newarray[$key] = getid3_iso::array_merge_clobber($newarray[$key], $val); + } else { + $newarray[$key] = $val; + } + } + return $newarray; + } + + + + public static function CreateDeepArray($array_path, $separator, $value) { + + // assigns $value to a nested array path: + // $foo = getid3_lib::CreateDeepArray('/path/to/my', '/', 'file.txt') + // is the same as: + // $foo = array ('path'=>array('to'=>'array('my'=>array('file.txt')))); + // or + // $foo['path']['to']['my'] = 'file.txt'; + + while ($array_path{0} == $separator) { + $array_path = substr($array_path, 1); + } + if (($pos = strpos($array_path, $separator)) !== false) { + return array (substr($array_path, 0, $pos) => getid3_iso::CreateDeepArray(substr($array_path, $pos + 1), $separator, $value)); + } + + return array ($array_path => $value); + } + +} + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.tag.apetag.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.tag.apetag.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,312 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.tag.apetag.php | +// | module for analyzing APE tags | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.tag.apetag.php,v 1.5 2006/11/16 14:05:21 ah Exp $ + + + +class getid3_apetag extends getid3_handler +{ + /* + ID3v1_TAG_SIZE = 128; + APETAG_HEADER_SIZE = 32; + LYRICS3_TAG_SIZE = 10; + */ + + public $option_override_end_offset = 0; + + + + public function Analyze() { + + $getid3 = $this->getid3; + + if ($this->option_override_end_offset == 0) { + + fseek($getid3->fp, 0 - 170, SEEK_END); // 170 = ID3v1_TAG_SIZE + APETAG_HEADER_SIZE + LYRICS3_TAG_SIZE + $apetag_footer_id3v1 = fread($getid3->fp, 170); // 170 = ID3v1_TAG_SIZE + APETAG_HEADER_SIZE + LYRICS3_TAG_SIZE + + // APE tag found before ID3v1 + if (substr($apetag_footer_id3v1, strlen($apetag_footer_id3v1) - 160, 8) == 'APETAGEX') { // 160 = ID3v1_TAG_SIZE + APETAG_HEADER_SIZE + $getid3->info['ape']['tag_offset_end'] = filesize($getid3->filename) - 128; // 128 = ID3v1_TAG_SIZE + } + + // APE tag found, no ID3v1 + elseif (substr($apetag_footer_id3v1, strlen($apetag_footer_id3v1) - 32, 8) == 'APETAGEX') { // 32 = APETAG_HEADER_SIZE + $getid3->info['ape']['tag_offset_end'] = filesize($getid3->filename); + } + + } + else { + + fseek($getid3->fp, $this->option_override_end_offset - 32, SEEK_SET); // 32 = APETAG_HEADER_SIZE + if (fread($getid3->fp, 8) == 'APETAGEX') { + $getid3->info['ape']['tag_offset_end'] = $this->option_override_end_offset; + } + + } + + // APE tag not found + if (!@$getid3->info['ape']['tag_offset_end']) { + return false; + } + + // Shortcut + $info_ape = &$getid3->info['ape']; + + // Read and parse footer + fseek($getid3->fp, $info_ape['tag_offset_end'] - 32, SEEK_SET); // 32 = APETAG_HEADER_SIZE + $apetag_footer_data = fread($getid3->fp, 32); + if (!($this->ParseAPEHeaderFooter($apetag_footer_data, $info_ape['footer']))) { + throw new getid3_exception('Error parsing APE footer at offset '.$info_ape['tag_offset_end']); + } + + if (isset($info_ape['footer']['flags']['header']) && $info_ape['footer']['flags']['header']) { + fseek($getid3->fp, $info_ape['tag_offset_end'] - $info_ape['footer']['raw']['tagsize'] - 32, SEEK_SET); + $info_ape['tag_offset_start'] = ftell($getid3->fp); + $apetag_data = fread($getid3->fp, $info_ape['footer']['raw']['tagsize'] + 32); + } + else { + $info_ape['tag_offset_start'] = $info_ape['tag_offset_end'] - $info_ape['footer']['raw']['tagsize']; + fseek($getid3->fp, $info_ape['tag_offset_start'], SEEK_SET); + $apetag_data = fread($getid3->fp, $info_ape['footer']['raw']['tagsize']); + } + $getid3->info['avdataend'] = $info_ape['tag_offset_start']; + + if (isset($getid3->info['id3v1']['tag_offset_start']) && ($getid3->info['id3v1']['tag_offset_start'] < $info_ape['tag_offset_end'])) { + $getid3->warning('ID3v1 tag information ignored since it appears to be a false synch in APEtag data'); + unset($getid3->info['id3v1']); + } + + $offset = 0; + if (isset($info_ape['footer']['flags']['header']) && $info_ape['footer']['flags']['header']) { + if (!$this->ParseAPEHeaderFooter(substr($apetag_data, 0, 32), $info_ape['header'])) { + throw new getid3_exception('Error parsing APE header at offset '.$info_ape['tag_offset_start']); + } + $offset = 32; + } + + // Shortcut + $getid3->info['replay_gain'] = array (); + $info_replaygain = &$getid3->info['replay_gain']; + + for ($i = 0; $i < $info_ape['footer']['raw']['tag_items']; $i++) { + $value_size = getid3_lib::LittleEndian2Int(substr($apetag_data, $offset, 4)); + $item_flags = getid3_lib::LittleEndian2Int(substr($apetag_data, $offset + 4, 4)); + $offset += 8; + + if (strstr(substr($apetag_data, $offset), "\x00") === false) { + throw new getid3_exception('Cannot find null-byte (0x00) seperator between ItemKey #'.$i.' and value. ItemKey starts ' . $offset . ' bytes into the APE tag, at file offset '.($info_ape['tag_offset_start'] + $offset)); + } + + $item_key_length = strpos($apetag_data, "\x00", $offset) - $offset; + $item_key = strtolower(substr($apetag_data, $offset, $item_key_length)); + + // Shortcut + $info_ape['items'][$item_key] = array (); + $info_ape_items_current = &$info_ape['items'][$item_key]; + + $offset += $item_key_length + 1; // skip 0x00 terminator + $info_ape_items_current['data'] = substr($apetag_data, $offset, $value_size); + $offset += $value_size; + + + $info_ape_items_current['flags'] = $this->ParseAPEtagFlags($item_flags); + + switch ($info_ape_items_current['flags']['item_contents_raw']) { + case 0: // UTF-8 + case 3: // Locator (URL, filename, etc), UTF-8 encoded + $info_ape_items_current['data'] = explode("\x00", trim($info_ape_items_current['data'])); + break; + + default: // binary data + break; + } + + switch (strtolower($item_key)) { + case 'replaygain_track_gain': + $info_replaygain['track']['adjustment'] = (float)str_replace(',', '.', $info_ape_items_current['data'][0]); // float casting will see "0,95" as zero! + $info_replaygain['track']['originator'] = 'unspecified'; + break; + + case 'replaygain_track_peak': + $info_replaygain['track']['peak'] = (float)str_replace(',', '.', $info_ape_items_current['data'][0]); // float casting will see "0,95" as zero! + $info_replaygain['track']['originator'] = 'unspecified'; + if ($info_replaygain['track']['peak'] <= 0) { + $getid3->warning('ReplayGain Track peak from APEtag appears invalid: '.$info_replaygain['track']['peak'].' (original value = "'.$info_ape_items_current['data'][0].'")'); + } + break; + + case 'replaygain_album_gain': + $info_replaygain['album']['adjustment'] = (float)str_replace(',', '.', $info_ape_items_current['data'][0]); // float casting will see "0,95" as zero! + $info_replaygain['album']['originator'] = 'unspecified'; + break; + + case 'replaygain_album_peak': + $info_replaygain['album']['peak'] = (float)str_replace(',', '.', $info_ape_items_current['data'][0]); // float casting will see "0,95" as zero! + $info_replaygain['album']['originator'] = 'unspecified'; + if ($info_replaygain['album']['peak'] <= 0) { + $getid3->warning('ReplayGain Album peak from APEtag appears invalid: '.$info_replaygain['album']['peak'].' (original value = "'.$info_ape_items_current['data'][0].'")'); + } + break; + + case 'mp3gain_undo': + list($mp3gain_undo_left, $mp3gain_undo_right, $mp3gain_undo_wrap) = explode(',', $info_ape_items_current['data'][0]); + $info_replaygain['mp3gain']['undo_left'] = intval($mp3gain_undo_left); + $info_replaygain['mp3gain']['undo_right'] = intval($mp3gain_undo_right); + $info_replaygain['mp3gain']['undo_wrap'] = (($mp3gain_undo_wrap == 'Y') ? true : false); + break; + + case 'mp3gain_minmax': + list($mp3gain_globalgain_min, $mp3gain_globalgain_max) = explode(',', $info_ape_items_current['data'][0]); + $info_replaygain['mp3gain']['globalgain_track_min'] = intval($mp3gain_globalgain_min); + $info_replaygain['mp3gain']['globalgain_track_max'] = intval($mp3gain_globalgain_max); + break; + + case 'mp3gain_album_minmax': + list($mp3gain_globalgain_album_min, $mp3gain_globalgain_album_max) = explode(',', $info_ape_items_current['data'][0]); + $info_replaygain['mp3gain']['globalgain_album_min'] = intval($mp3gain_globalgain_album_min); + $info_replaygain['mp3gain']['globalgain_album_max'] = intval($mp3gain_globalgain_album_max); + break; + + case 'tracknumber': + foreach ($info_ape_items_current['data'] as $comment) { + $info_ape['comments']['track'][] = $comment; + } + break; + + default: + foreach ($info_ape_items_current['data'] as $comment) { + $info_ape['comments'][strtolower($item_key)][] = $comment; + } + break; + } + + } + if (empty($info_replaygain)) { + unset($getid3->info['replay_gain']); + } + + return true; + } + + + + protected function ParseAPEheaderFooter($data, &$target) { + + // http://www.uni-jena.de/~pfk/mpp/sv8/apeheader.html + + if (substr($data, 0, 8) != 'APETAGEX') { + return false; + } + + // shortcut + $target['raw'] = array (); + $target_raw = &$target['raw']; + + $target_raw['footer_tag'] = 'APETAGEX'; + + getid3_lib::ReadSequence("LittleEndian2Int", $target_raw, $data, 8, + array ( + 'version' => 4, + 'tagsize' => 4, + 'tag_items' => 4, + 'global_flags' => 4 + ) + ); + $target_raw['reserved'] = substr($data, 24, 8); + + $target['tag_version'] = $target_raw['version'] / 1000; + if ($target['tag_version'] >= 2) { + + $target['flags'] = $this->ParseAPEtagFlags($target_raw['global_flags']); + } + + return true; + } + + + + protected function ParseAPEtagFlags($raw_flag_int) { + + // "Note: APE Tags 1.0 do not use any of the APE Tag flags. + // All are set to zero on creation and ignored on reading." + // http://www.uni-jena.de/~pfk/mpp/sv8/apetagflags.html + + $target['header'] = (bool) ($raw_flag_int & 0x80000000); + $target['footer'] = (bool) ($raw_flag_int & 0x40000000); + $target['this_is_header'] = (bool) ($raw_flag_int & 0x20000000); + $target['item_contents_raw'] = ($raw_flag_int & 0x00000006) >> 1; + $target['read_only'] = (bool) ($raw_flag_int & 0x00000001); + + $target['item_contents'] = getid3_apetag::APEcontentTypeFlagLookup($target['item_contents_raw']); + + return $target; + } + + + + public static function APEcontentTypeFlagLookup($content_type_id) { + + static $lookup = array ( + 0 => 'utf-8', + 1 => 'binary', + 2 => 'external', + 3 => 'reserved' + ); + return (isset($lookup[$content_type_id]) ? $lookup[$content_type_id] : 'invalid'); + } + + + + public static function APEtagItemIsUTF8Lookup($item_key) { + + static $lookup = array ( + 'title', + 'subtitle', + 'artist', + 'album', + 'debut album', + 'publisher', + 'conductor', + 'track', + 'composer', + 'comment', + 'copyright', + 'publicationright', + 'file', + 'year', + 'record date', + 'record location', + 'genre', + 'media', + 'related', + 'isrc', + 'abstract', + 'language', + 'bibliography' + ); + return in_array(strtolower($item_key), $lookup); + } + +} + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.tag.id3v1.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.tag.id3v1.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,324 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.tag.id3v1.php | +// | module for analyzing ID3v1 tags | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.tag.id3v1.php,v 1.6 2006/11/16 16:19:52 ah Exp $ + + + +class getid3_id3v1 extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + fseek($getid3->fp, -256, SEEK_END); + $pre_id3v1 = fread($getid3->fp, 128); + $id3v1_tag = fread($getid3->fp, 128); + + if (substr($id3v1_tag, 0, 3) == 'TAG') { + + $getid3->info['avdataend'] -= 128; + + // Shortcut + $getid3->info['id3v1'] = array (); + $info_id3v1 = &$getid3->info['id3v1']; + + $info_id3v1['title'] = getid3_id3v1::cutfield(substr($id3v1_tag, 3, 30)); + $info_id3v1['artist'] = getid3_id3v1::cutfield(substr($id3v1_tag, 33, 30)); + $info_id3v1['album'] = getid3_id3v1::cutfield(substr($id3v1_tag, 63, 30)); + $info_id3v1['year'] = getid3_id3v1::cutfield(substr($id3v1_tag, 93, 4)); + $info_id3v1['comment'] = substr($id3v1_tag, 97, 30); // can't remove nulls yet, track detection depends on them + $info_id3v1['genreid'] = ord(substr($id3v1_tag, 127, 1)); + + // If second-last byte of comment field is null and last byte of comment field is non-null then this is ID3v1.1 and the comment field is 28 bytes long and the 30th byte is the track number + if (($id3v1_tag{125} === "\x00") && ($id3v1_tag{126} !== "\x00")) { + $info_id3v1['track'] = ord(substr($info_id3v1['comment'], 29, 1)); + $info_id3v1['comment'] = substr($info_id3v1['comment'], 0, 28); + } + $info_id3v1['comment'] = getid3_id3v1::cutfield($info_id3v1['comment']); + + $info_id3v1['genre'] = getid3_id3v1::LookupGenreName($info_id3v1['genreid']); + if (!empty($info_id3v1['genre'])) { + unset($info_id3v1['genreid']); + } + if (empty($info_id3v1['genre']) || (@$info_id3v1['genre'] == 'Unknown')) { + unset($info_id3v1['genre']); + } + + foreach ($info_id3v1 as $key => $value) { + $key != 'comments' and $info_id3v1['comments'][$key][0] = $value; + } + + $info_id3v1['tag_offset_end'] = filesize($getid3->filename); + $info_id3v1['tag_offset_start'] = $info_id3v1['tag_offset_end'] - 128; + } + + if (substr($pre_id3v1, 0, 3) == 'TAG') { + // The way iTunes handles tags is, well, brain-damaged. + // It completely ignores v1 if ID3v2 is present. + // This goes as far as adding a new v1 tag *even if there already is one* + + // A suspected double-ID3v1 tag has been detected, but it could be that the "TAG" identifier is a legitimate part of an APE or Lyrics3 tag + if (substr($pre_id3v1, 96, 8) == 'APETAGEX') { + // an APE tag footer was found before the last ID3v1, assume false "TAG" synch + } elseif (substr($pre_id3v1, 119, 6) == 'LYRICS') { + // a Lyrics3 tag footer was found before the last ID3v1, assume false "TAG" synch + } else { + // APE and Lyrics3 footers not found - assume double ID3v1 + $getid3->warning('Duplicate ID3v1 tag detected - this has been known to happen with iTunes.'); + $getid3->info['avdataend'] -= 128; + } + } + + return true; + } + + + + public static function cutfield($str) { + + return trim(substr($str, 0, strcspn($str, "\x00"))); + } + + + + public static function ArrayOfGenres($allow_SCMPX_extended=false) { + + static $lookup = array ( + 0 => 'Blues', + 1 => 'Classic Rock', + 2 => 'Country', + 3 => 'Dance', + 4 => 'Disco', + 5 => 'Funk', + 6 => 'Grunge', + 7 => 'Hip-Hop', + 8 => 'Jazz', + 9 => 'Metal', + 10 => 'New Age', + 11 => 'Oldies', + 12 => 'Other', + 13 => 'Pop', + 14 => 'R&B', + 15 => 'Rap', + 16 => 'Reggae', + 17 => 'Rock', + 18 => 'Techno', + 19 => 'Industrial', + 20 => 'Alternative', + 21 => 'Ska', + 22 => 'Death Metal', + 23 => 'Pranks', + 24 => 'Soundtrack', + 25 => 'Euro-Techno', + 26 => 'Ambient', + 27 => 'Trip-Hop', + 28 => 'Vocal', + 29 => 'Jazz+Funk', + 30 => 'Fusion', + 31 => 'Trance', + 32 => 'Classical', + 33 => 'Instrumental', + 34 => 'Acid', + 35 => 'House', + 36 => 'Game', + 37 => 'Sound Clip', + 38 => 'Gospel', + 39 => 'Noise', + 40 => 'Alt. Rock', + 41 => 'Bass', + 42 => 'Soul', + 43 => 'Punk', + 44 => 'Space', + 45 => 'Meditative', + 46 => 'Instrumental Pop', + 47 => 'Instrumental Rock', + 48 => 'Ethnic', + 49 => 'Gothic', + 50 => 'Darkwave', + 51 => 'Techno-Industrial', + 52 => 'Electronic', + 53 => 'Pop-Folk', + 54 => 'Eurodance', + 55 => 'Dream', + 56 => 'Southern Rock', + 57 => 'Comedy', + 58 => 'Cult', + 59 => 'Gangsta Rap', + 60 => 'Top 40', + 61 => 'Christian Rap', + 62 => 'Pop/Funk', + 63 => 'Jungle', + 64 => 'Native American', + 65 => 'Cabaret', + 66 => 'New Wave', + 67 => 'Psychedelic', + 68 => 'Rave', + 69 => 'Showtunes', + 70 => 'Trailer', + 71 => 'Lo-Fi', + 72 => 'Tribal', + 73 => 'Acid Punk', + 74 => 'Acid Jazz', + 75 => 'Polka', + 76 => 'Retro', + 77 => 'Musical', + 78 => 'Rock & Roll', + 79 => 'Hard Rock', + 80 => 'Folk', + 81 => 'Folk/Rock', + 82 => 'National Folk', + 83 => 'Swing', + 84 => 'Fast-Fusion', + 85 => 'Bebob', + 86 => 'Latin', + 87 => 'Revival', + 88 => 'Celtic', + 89 => 'Bluegrass', + 90 => 'Avantgarde', + 91 => 'Gothic Rock', + 92 => 'Progressive Rock', + 93 => 'Psychedelic Rock', + 94 => 'Symphonic Rock', + 95 => 'Slow Rock', + 96 => 'Big Band', + 97 => 'Chorus', + 98 => 'Easy Listening', + 99 => 'Acoustic', + 100 => 'Humour', + 101 => 'Speech', + 102 => 'Chanson', + 103 => 'Opera', + 104 => 'Chamber Music', + 105 => 'Sonata', + 106 => 'Symphony', + 107 => 'Booty Bass', + 108 => 'Primus', + 109 => 'Porn Groove', + 110 => 'Satire', + 111 => 'Slow Jam', + 112 => 'Club', + 113 => 'Tango', + 114 => 'Samba', + 115 => 'Folklore', + 116 => 'Ballad', + 117 => 'Power Ballad', + 118 => 'Rhythmic Soul', + 119 => 'Freestyle', + 120 => 'Duet', + 121 => 'Punk Rock', + 122 => 'Drum Solo', + 123 => 'A Cappella', + 124 => 'Euro-House', + 125 => 'Dance Hall', + 126 => 'Goa', + 127 => 'Drum & Bass', + 128 => 'Club-House', + 129 => 'Hardcore', + 130 => 'Terror', + 131 => 'Indie', + 132 => 'BritPop', + 133 => 'Negerpunk', + 134 => 'Polsk Punk', + 135 => 'Beat', + 136 => 'Christian Gangsta Rap', + 137 => 'Heavy Metal', + 138 => 'Black Metal', + 139 => 'Crossover', + 140 => 'Contemporary Christian', + 141 => 'Christian Rock', + 142 => 'Merengue', + 143 => 'Salsa', + 144 => 'Trash Metal', + 145 => 'Anime', + 146 => 'JPop', + 147 => 'Synthpop', + + 255 => 'Unknown', + + 'CR' => 'Cover', + 'RX' => 'Remix' + ); + + static $lookupSCMPX = array (); + if ($allow_SCMPX_extended && empty($lookupSCMPX)) { + $lookupSCMPX = $lookup; + // http://www.geocities.co.jp/SiliconValley-Oakland/3664/alittle.html#GenreExtended + // Extended ID3v1 genres invented by SCMPX + // Note that 255 "Japanese Anime" conflicts with standard "Unknown" + $lookupSCMPX[240] = 'Sacred'; + $lookupSCMPX[241] = 'Northern Europe'; + $lookupSCMPX[242] = 'Irish & Scottish'; + $lookupSCMPX[243] = 'Scotland'; + $lookupSCMPX[244] = 'Ethnic Europe'; + $lookupSCMPX[245] = 'Enka'; + $lookupSCMPX[246] = 'Children\'s Song'; + $lookupSCMPX[247] = 'Japanese Sky'; + $lookupSCMPX[248] = 'Japanese Heavy Rock'; + $lookupSCMPX[249] = 'Japanese Doom Rock'; + $lookupSCMPX[250] = 'Japanese J-POP'; + $lookupSCMPX[251] = 'Japanese Seiyu'; + $lookupSCMPX[252] = 'Japanese Ambient Techno'; + $lookupSCMPX[253] = 'Japanese Moemoe'; + $lookupSCMPX[254] = 'Japanese Tokusatsu'; + //$lookupSCMPX[255] = 'Japanese Anime'; + } + + return ($allow_SCMPX_extended ? $lookupSCMPX : $lookup); + } + + + + public static function LookupGenreName($genre_id, $allow_SCMPX_extended=true) { + + switch ($genre_id) { + case 'RX': + case 'CR': + break; + default: + $genre_id = intval($genre_id); // to handle 3 or '3' or '03' + break; + } + $lookup = getid3_id3v1::ArrayOfGenres($allow_SCMPX_extended); + return (isset($lookup[$genre_id]) ? $lookup[$genre_id] : false); + } + + + public static function LookupGenreID($genre, $allow_SCMPX_extended=false) { + + $lookup = getid3_id3v1::ArrayOfGenres($allow_SCMPX_extended); + $lower_case_no_space_search_term = strtolower(str_replace(' ', '', $genre)); + foreach ($lookup as $key => $value) { + foreach ($lookup as $key => $value) { + if (strtolower(str_replace(' ', '', $value)) == $lower_case_no_space_search_term) { + return $key; + } + } + return false; + } + return (isset($lookup[$genre_id]) ? $lookup[$genre_id] : false); + } + +} + + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.tag.id3v2.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.tag.id3v2.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,3280 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.tag.id3v2.php | +// | module for analyzing ID3v2 tags | +// | dependencies: module.tag.id3v1.php | +// | module.lib.image_size.php (optional) | +// | zlib support in PHP (optional) | +// +----------------------------------------------------------------------+ +// +// $Id: module.tag.id3v2.php,v 1.15 2006/12/03 23:47:29 ah Exp $ + + + + +class getid3_id3v2 extends getid3_handler +{ + + public $option_starting_offset = 0; + + + public function Analyze() { + + $getid3 = $this->getid3; + + // dependency + $getid3->include_module('tag.id3v1'); + + if ($getid3->option_tags_images) { + $getid3->include_module('lib.image_size'); + } + + + // Overall tag structure: + // +-----------------------------+ + // | Header (10 bytes) | + // +-----------------------------+ + // | Extended Header | + // | (variable length, OPTIONAL) | + // +-----------------------------+ + // | Frames (variable length) | + // +-----------------------------+ + // | Padding | + // | (variable length, OPTIONAL) | + // +-----------------------------+ + // | Footer (10 bytes, OPTIONAL) | + // +-----------------------------+ + // + // Header + // ID3v2/file identifier "ID3" + // ID3v2 version $04 00 + // ID3v2 flags (%ab000000 in v2.2, %abc00000 in v2.3, %abcd0000 in v2.4.x) + // ID3v2 size 4 * %0xxxxxxx + + + // shortcuts + $getid3->info['id3v2']['header'] = true; + $info_id3v2 = &$getid3->info['id3v2']; + $info_id3v2['flags'] = array (); + $info_id3v2_flags = &$info_id3v2['flags']; + + + $this->fseek($this->option_starting_offset, SEEK_SET); + $header = $this->fread(10); + if (substr($header, 0, 3) == 'ID3' && strlen($header) == 10) { + + $info_id3v2['majorversion'] = ord($header{3}); + $info_id3v2['minorversion'] = ord($header{4}); + + // shortcut + $id3v2_major_version = &$info_id3v2['majorversion']; + + } else { + unset($getid3->info['id3v2']); + return false; + + } + + if ($id3v2_major_version > 4) { // this script probably won't correctly parse ID3v2.5.x and above (if it ever exists) + throw new getid3_exception('this script only parses up to ID3v2.4.x - this tag is ID3v2.'.$id3v2_major_version.'.'.$info_id3v2['minorversion']); + } + + $id3_flags = ord($header{5}); + switch ($id3v2_major_version) { + case 2: + // %ab000000 in v2.2 + $info_id3v2_flags['unsynch'] = (bool)($id3_flags & 0x80); // a - Unsynchronisation + $info_id3v2_flags['compression'] = (bool)($id3_flags & 0x40); // b - Compression + break; + + case 3: + // %abc00000 in v2.3 + $info_id3v2_flags['unsynch'] = (bool)($id3_flags & 0x80); // a - Unsynchronisation + $info_id3v2_flags['exthead'] = (bool)($id3_flags & 0x40); // b - Extended header + $info_id3v2_flags['experim'] = (bool)($id3_flags & 0x20); // c - Experimental indicator + break; + + case 4: + // %abcd0000 in v2.4 + $info_id3v2_flags['unsynch'] = (bool)($id3_flags & 0x80); // a - Unsynchronisation + $info_id3v2_flags['exthead'] = (bool)($id3_flags & 0x40); // b - Extended header + $info_id3v2_flags['experim'] = (bool)($id3_flags & 0x20); // c - Experimental indicator + $info_id3v2_flags['isfooter'] = (bool)($id3_flags & 0x10); // d - Footer present + break; + } + + $info_id3v2['headerlength'] = getid3_lib::BigEndianSyncSafe2Int(substr($header, 6, 4)) + 10; // length of ID3v2 tag in 10-byte header doesn't include 10-byte header length + + $info_id3v2['tag_offset_start'] = $this->option_starting_offset; + $info_id3v2['tag_offset_end'] = $info_id3v2['tag_offset_start'] + $info_id3v2['headerlength']; + + + // Frames + + // All ID3v2 frames consists of one frame header followed by one or more + // fields containing the actual information. The header is always 10 + // bytes and laid out as follows: + // + // Frame ID $xx xx xx xx (four characters) + // Size 4 * %0xxxxxxx + // Flags $xx xx + + $size_of_frames = $info_id3v2['headerlength'] - 10; // not including 10-byte initial header + if (@$info_id3v2['exthead']['length']) { + $size_of_frames -= ($info_id3v2['exthead']['length'] + 4); + } + + if (@$info_id3v2_flags['isfooter']) { + $size_of_frames -= 10; // footer takes last 10 bytes of ID3v2 header, after frame data, before audio + } + + if ($size_of_frames > 0) { + $frame_data = $this->fread($size_of_frames); // read all frames from file into $frame_data variable + + // if entire frame data is unsynched, de-unsynch it now (ID3v2.3.x) + if (@$info_id3v2_flags['unsynch'] && ($id3v2_major_version <= 3)) { + $frame_data = str_replace("\xFF\x00", "\xFF", $frame_data); + } + + // [in ID3v2.4.0] Unsynchronisation [S:6.1] is done on frame level, instead + // of on tag level, making it easier to skip frames, increasing the streamability + // of the tag. The unsynchronisation flag in the header [S:3.1] indicates that + // there exists an unsynchronised frame, while the new unsynchronisation flag in + // the frame header [S:4.1.2] indicates unsynchronisation. + + //$frame_data_offset = 10 + (@$info_id3v2['exthead']['length'] ? $info_id3v2['exthead']['length'] + 4 : 0); // how many bytes into the stream - start from after the 10-byte header (and extended header length+4, if present) + $frame_data_offset = 10; // how many bytes into the stream - start from after the 10-byte header + + // Extended Header + if (@$info_id3v2_flags['exthead']) { + $extended_header_offset = 0; + + if ($id3v2_major_version == 3) { + + // v2.3 definition: + //Extended header size $xx xx xx xx // 32-bit integer + //Extended Flags $xx xx + // %x0000000 %00000000 // v2.3 + // x - CRC data present + //Size of padding $xx xx xx xx + + $info_id3v2['exthead']['length'] = getid3_lib::BigEndian2Int(substr($frame_data, $extended_header_offset, 4), 0); + $extended_header_offset += 4; + + $info_id3v2['exthead']['flag_bytes'] = 2; + $info_id3v2['exthead']['flag_raw'] = getid3_lib::BigEndian2Int(substr($frame_data, $extended_header_offset, $info_id3v2['exthead']['flag_bytes'])); + $extended_header_offset += $info_id3v2['exthead']['flag_bytes']; + + $info_id3v2['exthead']['flags']['crc'] = (bool) ($info_id3v2['exthead']['flag_raw'] & 0x8000); + + $info_id3v2['exthead']['padding_size'] = getid3_lib::BigEndian2Int(substr($frame_data, $extended_header_offset, 4)); + $extended_header_offset += 4; + + if ($info_id3v2['exthead']['flags']['crc']) { + $info_id3v2['exthead']['flag_data']['crc'] = getid3_lib::BigEndian2Int(substr($frame_data, $extended_header_offset, 4)); + $extended_header_offset += 4; + } + $extended_header_offset += $info_id3v2['exthead']['padding_size']; + + } + + elseif ($id3v2_major_version == 4) { + + // v2.4 definition: + //Extended header size 4 * %0xxxxxxx // 28-bit synchsafe integer + //Number of flag bytes $01 + //Extended Flags $xx + // %0bcd0000 // v2.4 + // b - Tag is an update + // Flag data length $00 + // c - CRC data present + // Flag data length $05 + // Total frame CRC 5 * %0xxxxxxx + // d - Tag restrictions + // Flag data length $01 + + $info_id3v2['exthead']['length'] = getid3_lib::BigEndian2Int(substr($frame_data, $extended_header_offset, 4), 1); + $extended_header_offset += 4; + + $info_id3v2['exthead']['flag_bytes'] = 1; + $info_id3v2['exthead']['flag_raw'] = getid3_lib::BigEndian2Int(substr($frame_data, $extended_header_offset, $info_id3v2['exthead']['flag_bytes'])); + $extended_header_offset += $info_id3v2['exthead']['flag_bytes']; + + $info_id3v2['exthead']['flags']['update'] = (bool) ($info_id3v2['exthead']['flag_raw'] & 0x4000); + $info_id3v2['exthead']['flags']['crc'] = (bool) ($info_id3v2['exthead']['flag_raw'] & 0x2000); + $info_id3v2['exthead']['flags']['restrictions'] = (bool) ($info_id3v2['exthead']['flag_raw'] & 0x1000); + + if ($info_id3v2['exthead']['flags']['crc']) { + $info_id3v2['exthead']['flag_data']['crc'] = getid3_lib::BigEndian2Int(substr($frame_data, $extended_header_offset, 5), 1); + $extended_header_offset += 5; + } + if ($info_id3v2['exthead']['flags']['restrictions']) { + // %ppqrrstt + $restrictions_raw = getid3_lib::BigEndian2Int(substr($frame_data, $extended_header_offset, 1)); + $extended_header_offset += 1; + $info_id3v2['exthead']['flags']['restrictions']['tagsize'] = ($restrictions_raw && 0xC0) >> 6; // p - Tag size restrictions + $info_id3v2['exthead']['flags']['restrictions']['textenc'] = ($restrictions_raw && 0x20) >> 5; // q - Text encoding restrictions + $info_id3v2['exthead']['flags']['restrictions']['textsize'] = ($restrictions_raw && 0x18) >> 3; // r - Text fields size restrictions + $info_id3v2['exthead']['flags']['restrictions']['imgenc'] = ($restrictions_raw && 0x04) >> 2; // s - Image encoding restrictions + $info_id3v2['exthead']['flags']['restrictions']['imgsize'] = ($restrictions_raw && 0x03) >> 0; // t - Image size restrictions + } + + } + $frame_data_offset += $extended_header_offset; + $frame_data = substr($frame_data, $extended_header_offset); + } // end extended header + + + + + + + while (isset($frame_data) && (strlen($frame_data) > 0)) { // cycle through until no more frame data is left to parse + if (strlen($frame_data) <= ($id3v2_major_version == 2 ? 6 : 10)) { + // insufficient room left in ID3v2 header for actual data - must be padding + $info_id3v2['padding']['start'] = $frame_data_offset; + $info_id3v2['padding']['length'] = strlen($frame_data); + $info_id3v2['padding']['valid'] = true; + for ($i = 0; $i < $info_id3v2['padding']['length']; $i++) { + if ($frame_data{$i} != "\x00") { + $info_id3v2['padding']['valid'] = false; + $info_id3v2['padding']['errorpos'] = $info_id3v2['padding']['start'] + $i; + $getid3->warning('Invalid ID3v2 padding found at offset '.$info_id3v2['padding']['errorpos'].' (the remaining '.($info_id3v2['padding']['length'] - $i).' bytes are considered invalid)'); + break; + } + } + break; // skip rest of ID3v2 header + } + + if ($id3v2_major_version == 2) { + // Frame ID $xx xx xx (three characters) + // Size $xx xx xx (24-bit integer) + // Flags $xx xx + + $frame_header = substr($frame_data, 0, 6); // take next 6 bytes for header + $frame_data = substr($frame_data, 6); // and leave the rest in $frame_data + $frame_name = substr($frame_header, 0, 3); + $frame_size = getid3_lib::BigEndian2Int(substr($frame_header, 3, 3)); + $frame_flags = 0; // not used for anything in ID3v2.2, just set to avoid E_NOTICEs + + + } elseif ($id3v2_major_version > 2) { + + // Frame ID $xx xx xx xx (four characters) + // Size $xx xx xx xx (32-bit integer in v2.3, 28-bit synchsafe in v2.4+) + // Flags $xx xx + + $frame_header = substr($frame_data, 0, 10); // take next 10 bytes for header + $frame_data = substr($frame_data, 10); // and leave the rest in $frame_data + + $frame_name = substr($frame_header, 0, 4); + + if ($id3v2_major_version == 3) { + $frame_size = getid3_lib::BigEndian2Int(substr($frame_header, 4, 4)); // 32-bit integer + + } else { // ID3v2.4+ + $frame_size = getid3_lib::BigEndianSyncSafe2Int(substr($frame_header, 4, 4)); // 32-bit synchsafe integer (28-bit value) + } + + if ($frame_size < (strlen($frame_data) + 4)) { + $nextFrameID = substr($frame_data, $frame_size, 4); + if (getid3_id3v2::IsValidID3v2FrameName($nextFrameID, $id3v2_major_version)) { + // next frame is OK + } elseif (($frame_name == "\x00".'MP3') || ($frame_name == "\x00\x00".'MP') || ($frame_name == ' MP3') || ($frame_name == 'MP3e')) { + // MP3ext known broken frames - "ok" for the purposes of this test + } elseif (($id3v2_major_version == 4) && (getid3_id3v2::IsValidID3v2FrameName(substr($frame_data, getid3_lib::BigEndian2Int(substr($frame_header, 4, 4)), 4), 3))) { + $getid3->warning('ID3v2 tag written as ID3v2.4, but with non-synchsafe integers (ID3v2.3 style). Older versions of (Helium2; iTunes) are known culprits of this. Tag has been parsed as ID3v2.3'); + $id3v2_major_version = 3; + $frame_size = getid3_lib::BigEndian2Int(substr($frame_header, 4, 4)); // 32-bit integer + } + } + + + $frame_flags = getid3_lib::BigEndian2Int(substr($frame_header, 8, 2)); + } + + if ((($id3v2_major_version == 2) && ($frame_name == "\x00\x00\x00")) || ($frame_name == "\x00\x00\x00\x00")) { + // padding encountered + + $info_id3v2['padding']['start'] = $frame_data_offset; + $info_id3v2['padding']['length'] = strlen($frame_header) + strlen($frame_data); + $info_id3v2['padding']['valid'] = true; + + $len = strlen($frame_data); + for ($i = 0; $i < $len; $i++) { + if ($frame_data{$i} != "\x00") { + $info_id3v2['padding']['valid'] = false; + $info_id3v2['padding']['errorpos'] = $info_id3v2['padding']['start'] + $i; + $getid3->warning('Invalid ID3v2 padding found at offset '.$info_id3v2['padding']['errorpos'].' (the remaining '.($info_id3v2['padding']['length'] - $i).' bytes are considered invalid)'); + break; + } + } + break; // skip rest of ID3v2 header + } + + if ($frame_name == 'COM ') { + $getid3->warning('error parsing "'.$frame_name.'" ('.$frame_data_offset.' bytes into the ID3v2.'.$id3v2_major_version.' tag). (ERROR: IsValidID3v2FrameName("'.str_replace("\x00", ' ', $frame_name).'", '.$id3v2_major_version.'))). [Note: this particular error has been known to happen with tags edited by iTunes (versions "X v2.0.3", "v3.0.1" are known-guilty, probably others too)]'); + $frame_name = 'COMM'; + } + if (($frame_size <= strlen($frame_data)) && (getid3_id3v2::IsValidID3v2FrameName($frame_name, $id3v2_major_version))) { + + unset($parsed_frame); + $parsed_frame['frame_name'] = $frame_name; + $parsed_frame['frame_flags_raw'] = $frame_flags; + $parsed_frame['data'] = substr($frame_data, 0, $frame_size); + $parsed_frame['datalength'] = (int)($frame_size); + $parsed_frame['dataoffset'] = $frame_data_offset; + + $this->ParseID3v2Frame($parsed_frame); + $info_id3v2[$frame_name][] = $parsed_frame; + + $frame_data = substr($frame_data, $frame_size); + + } else { // invalid frame length or FrameID + + if ($frame_size <= strlen($frame_data)) { + + if (getid3_id3v2::IsValidID3v2FrameName(substr($frame_data, $frame_size, 4), $id3v2_major_version)) { + + // next frame is valid, just skip the current frame + $frame_data = substr($frame_data, $frame_size); + $getid3->warning('Next ID3v2 frame is valid, skipping current frame.'); + + } else { + + // next frame is invalid too, abort processing + throw new getid3_exception('Next ID3v2 frame is also invalid, aborting processing.'); + + } + + } elseif ($frame_size == strlen($frame_data)) { + + // this is the last frame, just skip + $getid3->warning('This was the last ID3v2 frame.'); + + } else { + + // next frame is invalid too, abort processing + $frame_data = null; + $getid3->warning('Invalid ID3v2 frame size, aborting.'); + + } + if (!getid3_id3v2::IsValidID3v2FrameName($frame_name, $id3v2_major_version)) { + + switch ($frame_name) { + + case "\x00\x00".'MP': + case "\x00".'MP3': + case ' MP3': + case 'MP3e': + case "\x00".'MP': + case ' MP': + case 'MP3': + $getid3->warning('error parsing "'.$frame_name.'" ('.$frame_data_offset.' bytes into the ID3v2.'.$id3v2_major_version.' tag). (ERROR: !IsValidID3v2FrameName("'.str_replace("\x00", ' ', $frame_name).'", '.$id3v2_major_version.'))). [Note: this particular error has been known to happen with tags edited by "MP3ext (www.mutschler.de/mp3ext/)"]'); + break; + + default: + $getid3->warning('error parsing "'.$frame_name.'" ('.$frame_data_offset.' bytes into the ID3v2.'.$id3v2_major_version.' tag). (ERROR: !IsValidID3v2FrameName("'.str_replace("\x00", ' ', $frame_name).'", '.$id3v2_major_version.'))).'); + break; + } + + } elseif ($frame_size > strlen(@$frame_data)){ + + throw new getid3_exception('error parsing "'.$frame_name.'" ('.$frame_data_offset.' bytes into the ID3v2.'.$id3v2_major_version.' tag). (ERROR: $frame_size ('.$frame_size.') > strlen($frame_data) ('.strlen($frame_data).')).'); + + } else { + + throw new getid3_exception('error parsing "'.$frame_name.'" ('.$frame_data_offset.' bytes into the ID3v2.'.$id3v2_major_version.' tag).'); + + } + + } + $frame_data_offset += ($frame_size + ($id3v2_major_version == 2 ? 6 : 10)); + + } + + } + + + // Footer + + // The footer is a copy of the header, but with a different identifier. + // ID3v2 identifier "3DI" + // ID3v2 version $04 00 + // ID3v2 flags %abcd0000 + // ID3v2 size 4 * %0xxxxxxx + + if (isset($info_id3v2_flags['isfooter']) && $info_id3v2_flags['isfooter']) { + $footer = fread ($getid3->fp, 10); + if (substr($footer, 0, 3) == '3DI') { + $info_id3v2['footer'] = true; + $info_id3v2['majorversion_footer'] = ord($footer{3}); + $info_id3v2['minorversion_footer'] = ord($footer{4}); + } + if ($info_id3v2['majorversion_footer'] <= 4) { + $id3_flags = ord($footer{5}); + $info_id3v2_flags['unsynch_footer'] = (bool)($id3_flags & 0x80); + $info_id3v2_flags['extfoot_footer'] = (bool)($id3_flags & 0x40); + $info_id3v2_flags['experim_footer'] = (bool)($id3_flags & 0x20); + $info_id3v2_flags['isfooter_footer'] = (bool)($id3_flags & 0x10); + + $info_id3v2['footerlength'] = getid3_lib::BigEndianSyncSafe2Int(substr($footer, 6, 4)); + } + } // end footer + + if (isset($info_id3v2['comments']['genre'])) { + foreach ($info_id3v2['comments']['genre'] as $key => $value) { + unset($info_id3v2['comments']['genre'][$key]); + $info_id3v2['comments'] = getid3_id3v2::array_merge_noclobber($info_id3v2['comments'], getid3_id3v2::ParseID3v2GenreString($value)); + } + } + + if (isset($info_id3v2['comments']['track'])) { + foreach ($info_id3v2['comments']['track'] as $key => $value) { + if (strstr($value, '/')) { + list($info_id3v2['comments']['track'][$key], $info_id3v2['comments']['totaltracks'][$key]) = explode('/', $info_id3v2['comments']['track'][$key]); + } + } + } + + // Use year from recording time if year not set + if (!isset($info_id3v2['comments']['year']) && ereg('^([0-9]{4})', @$info_id3v2['comments']['recording_time'][0], $matches)) { + $info_id3v2['comments']['year'] = array ($matches[1]); + } + + // Set avdataoffset + $getid3->info['avdataoffset'] = $info_id3v2['headerlength']; + if (isset($info_id3v2['footer'])) { + $getid3->info['avdataoffset'] += 10; + } + + return true; + } + + + + private function ParseID3v2Frame(&$parsed_frame) { + + $getid3 = $this->getid3; + + $id3v2_major_version = $getid3->info['id3v2']['majorversion']; + + $frame_name_long = getid3_id3v2::FrameNameLongLookup($parsed_frame['frame_name']); + if ($frame_name_long) { + $parsed_frame['framenamelong'] = $frame_name_long; + } + + $frame_name_short = getid3_id3v2::FrameNameShortLookup($parsed_frame['frame_name']); + if ($frame_name_short) { + $parsed_frame['framenameshort'] = $frame_name_short; + } + + if ($id3v2_major_version >= 3) { // frame flags are not part of the ID3v2.2 standard + + if ($id3v2_major_version == 3) { + + // Frame Header Flags + // %abc00000 %ijk00000 + + $parsed_frame['flags']['TagAlterPreservation'] = (bool)($parsed_frame['frame_flags_raw'] & 0x8000); // a - Tag alter preservation + $parsed_frame['flags']['FileAlterPreservation'] = (bool)($parsed_frame['frame_flags_raw'] & 0x4000); // b - File alter preservation + $parsed_frame['flags']['ReadOnly'] = (bool)($parsed_frame['frame_flags_raw'] & 0x2000); // c - Read only + $parsed_frame['flags']['compression'] = (bool)($parsed_frame['frame_flags_raw'] & 0x0080); // i - Compression + $parsed_frame['flags']['Encryption'] = (bool)($parsed_frame['frame_flags_raw'] & 0x0040); // j - Encryption + $parsed_frame['flags']['GroupingIdentity'] = (bool)($parsed_frame['frame_flags_raw'] & 0x0020); // k - Grouping identity + + + } elseif ($id3v2_major_version == 4) { + + // Frame Header Flags + // %0abc0000 %0h00kmnp + + $parsed_frame['flags']['TagAlterPreservation'] = (bool)($parsed_frame['frame_flags_raw'] & 0x4000); // a - Tag alter preservation + $parsed_frame['flags']['FileAlterPreservation'] = (bool)($parsed_frame['frame_flags_raw'] & 0x2000); // b - File alter preservation + $parsed_frame['flags']['ReadOnly'] = (bool)($parsed_frame['frame_flags_raw'] & 0x1000); // c - Read only + $parsed_frame['flags']['GroupingIdentity'] = (bool)($parsed_frame['frame_flags_raw'] & 0x0040); // h - Grouping identity + $parsed_frame['flags']['compression'] = (bool)($parsed_frame['frame_flags_raw'] & 0x0008); // k - Compression + $parsed_frame['flags']['Encryption'] = (bool)($parsed_frame['frame_flags_raw'] & 0x0004); // m - Encryption + $parsed_frame['flags']['Unsynchronisation'] = (bool)($parsed_frame['frame_flags_raw'] & 0x0002); // n - Unsynchronisation + $parsed_frame['flags']['DataLengthIndicator'] = (bool)($parsed_frame['frame_flags_raw'] & 0x0001); // p - Data length indicator + + // Frame-level de-unsynchronisation - ID3v2.4 + if ($parsed_frame['flags']['Unsynchronisation']) { + $parsed_frame['data'] = str_replace("\xFF\x00", "\xFF", $parsed_frame['data']); + } + } + + // Frame-level de-compression + if ($parsed_frame['flags']['compression']) { + $parsed_frame['decompressed_size'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], 0, 4)); + + if (!function_exists('gzuncompress')) { + $getid3->warning('gzuncompress() support required to decompress ID3v2 frame "'.$parsed_frame['frame_name'].'"'); + } elseif ($decompressed_data = @gzuncompress(substr($parsed_frame['data'], 4))) { + $parsed_frame['data'] = $decompressed_data; + } else { + $getid3->warning('gzuncompress() failed on compressed contents of ID3v2 frame "'.$parsed_frame['frame_name'].'"'); + } + } + } + + + if (isset($parsed_frame['datalength']) && ($parsed_frame['datalength'] == 0)) { + + $warning = 'Frame "'.$parsed_frame['frame_name'].'" at offset '.$parsed_frame['dataoffset'].' has no data portion'; + switch ($parsed_frame['frame_name']) { + case 'WCOM': + $warning .= ' (this is known to happen with files tagged by RioPort)'; + break; + + default: + break; + } + $getid3->warning($warning); + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'UFID')) || // 4.1 UFID Unique file identifier + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'UFI'))) { // 4.1 UFI Unique file identifier + + // There may be more than one 'UFID' frame in a tag, + // but only one with the same 'Owner identifier'. + //
+ // Owner identifier $00 + // Identifier + + $frame_terminator_pos = strpos($parsed_frame['data'], "\x00"); + $frame_id_string = substr($parsed_frame['data'], 0, $frame_terminator_pos); + $parsed_frame['ownerid'] = $frame_id_string; + $parsed_frame['data'] = substr($parsed_frame['data'], $frame_terminator_pos + strlen("\x00")); + unset($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'TXXX')) || // 4.2.2 TXXX User defined text information frame + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'TXX'))) { // 4.2.2 TXX User defined text information frame + + // There may be more than one 'TXXX' frame in each tag, + // but only one with the same description. + //
+ // Text encoding $xx + // Description $00 (00) + // Value + + $frame_offset = 0; + $frame_text_encoding = ord($parsed_frame['data']{$frame_offset++}); + + if ((($id3v2_major_version <= 3) && ($frame_text_encoding > 1)) || (($id3v2_major_version == 4) && ($frame_text_encoding > 3))) { + $getid3->warning('Invalid text encoding byte ('.$frame_text_encoding.') in frame "'.$parsed_frame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + } + $frame_terminator_pos = @strpos($parsed_frame['data'], getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding), $frame_offset); + if (ord(substr($parsed_frame['data'], $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)), 1)) === 0) { + $frame_terminator_pos++; // @strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + $frame_description = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_description) === 0) { + $frame_description = ''; + } + $parsed_frame['encodingid'] = $frame_text_encoding; + $parsed_frame['encoding'] = $this->TextEncodingNameLookup($frame_text_encoding); + + $parsed_frame['description'] = $frame_description; + $parsed_frame['data'] = substr($parsed_frame['data'], $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding))); + if (!empty($parsed_frame['framenameshort']) && !empty($parsed_frame['data'])) { + $getid3->info['id3v2']['comments'][$parsed_frame['framenameshort']][] = trim($getid3->iconv($parsed_frame['encoding'], 'UTF-8', $parsed_frame['data'])); + } + unset($parsed_frame['data']); + return true; + } + + + if ($parsed_frame['frame_name']{0} == 'T') { // 4.2. T??[?] Text information frame + + // There may only be one text information frame of its kind in an tag. + //
+ // Text encoding $xx + // Information + + $frame_offset = 0; + $frame_text_encoding = ord($parsed_frame['data']{$frame_offset++}); + if ((($id3v2_major_version <= 3) && ($frame_text_encoding > 1)) || (($id3v2_major_version == 4) && ($frame_text_encoding > 3))) { + $getid3->warning('Invalid text encoding byte ('.$frame_text_encoding.') in frame "'.$parsed_frame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + } + + $parsed_frame['data'] = (string)substr($parsed_frame['data'], $frame_offset); + + $parsed_frame['encodingid'] = $frame_text_encoding; + $parsed_frame['encoding'] = $this->TextEncodingNameLookup($frame_text_encoding); + + if (!empty($parsed_frame['framenameshort']) && !empty($parsed_frame['data'])) { + + // remove possible terminating \x00 (put by encoding id or software bug) + $string = $getid3->iconv($parsed_frame['encoding'], 'UTF-8', $parsed_frame['data']); + if ($string[strlen($string)-1] = "\x00") { + $string = substr($string, 0, strlen($string)-1); + } + $getid3->info['id3v2']['comments'][$parsed_frame['framenameshort']][] = $string; + unset($string); + } + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'WXXX')) || // 4.3.2 WXXX User defined URL link frame + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'WXX'))) { // 4.3.2 WXX User defined URL link frame + + // There may be more than one 'WXXX' frame in each tag, + // but only one with the same description + //
+ // Text encoding $xx + // Description $00 (00) + // URL + + $frame_offset = 0; + $frame_text_encoding = ord($parsed_frame['data']{$frame_offset++}); + if ((($id3v2_major_version <= 3) && ($frame_text_encoding > 1)) || (($id3v2_major_version == 4) && ($frame_text_encoding > 3))) { + $getid3->warning('Invalid text encoding byte ('.$frame_text_encoding.') in frame "'.$parsed_frame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + } + $frame_terminator_pos = @strpos($parsed_frame['data'], getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding), $frame_offset); + if (ord(substr($parsed_frame['data'], $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)), 1)) === 0) { + $frame_terminator_pos++; // @strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + $frame_description = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + + if (ord($frame_description) === 0) { + $frame_description = ''; + } + $parsed_frame['data'] = substr($parsed_frame['data'], $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding))); + + $frame_terminator_pos = strpos($parsed_frame['data'], getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)); + if (ord(substr($parsed_frame['data'], $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)), 1)) === 0) { + $frame_terminator_pos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + if ($frame_terminator_pos) { + // there are null bytes after the data - this is not according to spec + // only use data up to first null byte + $frame_urldata = (string)substr($parsed_frame['data'], 0, $frame_terminator_pos); + } else { + // no null bytes following data, just use all data + $frame_urldata = (string)$parsed_frame['data']; + } + + $parsed_frame['encodingid'] = $frame_text_encoding; + $parsed_frame['encoding'] = $this->TextEncodingNameLookup($frame_text_encoding); + + $parsed_frame['url'] = $frame_urldata; + $parsed_frame['description'] = $frame_description; + if (!empty($parsed_frame['framenameshort']) && $parsed_frame['url']) { + $getid3->info['id3v2']['comments'][$parsed_frame['framenameshort']][] = $getid3->iconv($parsed_frame['encoding'], 'UTF-8', $parsed_frame['url']); + } + unset($parsed_frame['data']); + return true; + } + + + if ($parsed_frame['frame_name']{0} == 'W') { // 4.3. W??? URL link frames + + // There may only be one URL link frame of its kind in a tag, + // except when stated otherwise in the frame description + //
+ // URL + + $parsed_frame['url'] = trim($parsed_frame['data']); + if (!empty($parsed_frame['framenameshort']) && $parsed_frame['url']) { + $getid3->info['id3v2']['comments'][$parsed_frame['framenameshort']][] = $parsed_frame['url']; + } + unset($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version == 3) && ($parsed_frame['frame_name'] == 'IPLS')) || // 4.4 IPLS Involved people list (ID3v2.3 only) + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'IPL'))) { // 4.4 IPL Involved people list (ID3v2.2 only) + + // There may only be one 'IPL' frame in each tag + //
+ // Text encoding $xx + // People list strings + + $frame_offset = 0; + $frame_text_encoding = ord($parsed_frame['data']{$frame_offset++}); + if ((($id3v2_major_version <= 3) && ($frame_text_encoding > 1)) || (($id3v2_major_version == 4) && ($frame_text_encoding > 3))) { + $getid3->warning('Invalid text encoding byte ('.$frame_text_encoding.') in frame "'.$parsed_frame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + } + $parsed_frame['encodingid'] = $frame_text_encoding; + $parsed_frame['encoding'] = $this->TextEncodingNameLookup($parsed_frame['encodingid']); + + $parsed_frame['data'] = (string)substr($parsed_frame['data'], $frame_offset); + if (!empty($parsed_frame['framenameshort']) && !empty($parsed_frame['data'])) { + $getid3->info['id3v2']['comments'][$parsed_frame['framenameshort']][] = $getid3->iconv($parsed_frame['encoding'], 'UTF-8', $parsed_frame['data']); + } + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'MCDI')) || // 4.4 MCDI Music CD identifier + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'MCI'))) { // 4.5 MCI Music CD identifier + + // There may only be one 'MCDI' frame in each tag + //
+ // CD TOC + + if (!empty($parsed_frame['framenameshort']) && !empty($parsed_frame['data'])) { + $getid3->info['id3v2']['comments'][$parsed_frame['framenameshort']][] = $parsed_frame['data']; + } + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'ETCO')) || // 4.5 ETCO Event timing codes + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'ETC'))) { // 4.6 ETC Event timing codes + + // There may only be one 'ETCO' frame in each tag + //
+ // Time stamp format $xx + // Where time stamp format is: + // $01 (32-bit value) MPEG frames from beginning of file + // $02 (32-bit value) milliseconds from beginning of file + // Followed by a list of key events in the following format: + // Type of event $xx + // Time stamp $xx (xx ...) + // The 'Time stamp' is set to zero if directly at the beginning of the sound + // or after the previous event. All events MUST be sorted in chronological order. + + $frame_offset = 0; + $parsed_frame['timestampformat'] = ord($parsed_frame['data']{$frame_offset++}); + + while ($frame_offset < strlen($parsed_frame['data'])) { + $parsed_frame['typeid'] = $parsed_frame['data']{$frame_offset++}; + $parsed_frame['type'] = getid3_id3v2::ETCOEventLookup($parsed_frame['typeid']); + $parsed_frame['timestamp'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, 4)); + $frame_offset += 4; + } + unset($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'MLLT')) || // 4.6 MLLT MPEG location lookup table + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'MLL'))) { // 4.7 MLL MPEG location lookup table + + // There may only be one 'MLLT' frame in each tag + //
+ // MPEG frames between reference $xx xx + // Bytes between reference $xx xx xx + // Milliseconds between reference $xx xx xx + // Bits for bytes deviation $xx + // Bits for milliseconds dev. $xx + // Then for every reference the following data is included; + // Deviation in bytes %xxx.... + // Deviation in milliseconds %xxx.... + + $frame_offset = 0; + $parsed_frame['framesbetweenreferences'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], 0, 2)); + $parsed_frame['bytesbetweenreferences'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], 2, 3)); + $parsed_frame['msbetweenreferences'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], 5, 3)); + $parsed_frame['bitsforbytesdeviation'] = getid3_lib::BigEndian2Int($parsed_frame['data'][8]); + $parsed_frame['bitsformsdeviation'] = getid3_lib::BigEndian2Int($parsed_frame['data'][9]); + $parsed_frame['data'] = substr($parsed_frame['data'], 10); + + while ($frame_offset < strlen($parsed_frame['data'])) { + $deviation_bitstream .= getid3_lib::BigEndian2Bin($parsed_frame['data']{$frame_offset++}); + } + $reference_counter = 0; + while (strlen($deviation_bitstream) > 0) { + $parsed_frame[$reference_counter]['bytedeviation'] = bindec(substr($deviation_bitstream, 0, $parsed_frame['bitsforbytesdeviation'])); + $parsed_frame[$reference_counter]['msdeviation'] = bindec(substr($deviation_bitstream, $parsed_frame['bitsforbytesdeviation'], $parsed_frame['bitsformsdeviation'])); + $deviation_bitstream = substr($deviation_bitstream, $parsed_frame['bitsforbytesdeviation'] + $parsed_frame['bitsformsdeviation']); + $reference_counter++; + } + unset($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'SYTC')) || // 4.7 SYTC Synchronised tempo codes + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'STC'))) { // 4.8 STC Synchronised tempo codes + + // There may only be one 'SYTC' frame in each tag + //
+ // Time stamp format $xx + // Tempo data + // Where time stamp format is: + // $01 (32-bit value) MPEG frames from beginning of file + // $02 (32-bit value) milliseconds from beginning of file + + $frame_offset = 0; + $parsed_frame['timestampformat'] = ord($parsed_frame['data']{$frame_offset++}); + $timestamp_counter = 0; + while ($frame_offset < strlen($parsed_frame['data'])) { + $parsed_frame[$timestamp_counter]['tempo'] = ord($parsed_frame['data']{$frame_offset++}); + if ($parsed_frame[$timestamp_counter]['tempo'] == 255) { + $parsed_frame[$timestamp_counter]['tempo'] += ord($parsed_frame['data']{$frame_offset++}); + } + $parsed_frame[$timestamp_counter]['timestamp'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, 4)); + $frame_offset += 4; + $timestamp_counter++; + } + unset($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'USLT')) || // 4.8 USLT Unsynchronised lyric/text transcription + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'ULT'))) { // 4.9 ULT Unsynchronised lyric/text transcription + + // There may be more than one 'Unsynchronised lyrics/text transcription' frame + // in each tag, but only one with the same language and content descriptor. + //
+ // Text encoding $xx + // Language $xx xx xx + // Content descriptor $00 (00) + // Lyrics/text + + $frame_offset = 0; + $frame_text_encoding = ord($parsed_frame['data']{$frame_offset++}); + if ((($id3v2_major_version <= 3) && ($frame_text_encoding > 1)) || (($id3v2_major_version == 4) && ($frame_text_encoding > 3))) { + $getid3->warning('Invalid text encoding byte ('.$frame_text_encoding.') in frame "'.$parsed_frame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + } + $frame_language = substr($parsed_frame['data'], $frame_offset, 3); + $frame_offset += 3; + if ($frame_offset > strlen($parsed_frame['data'])) { + $frame_offset = strlen($parsed_frame['data']) - 1; + } + $frame_terminator_pos = @strpos($parsed_frame['data'], getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding), $frame_offset); + if (ord(substr($parsed_frame['data'], $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)), 1)) === 0) { + $frame_terminator_pos++; // @strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + $frame_description = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_description) === 0) { + $frame_description = ''; + } + $parsed_frame['data'] = substr($parsed_frame['data'], $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding))); + + $parsed_frame['encodingid'] = $frame_text_encoding; + $parsed_frame['encoding'] = $this->TextEncodingNameLookup($frame_text_encoding); + + $parsed_frame['data'] = $parsed_frame['data']; + $parsed_frame['language'] = $frame_language; + $parsed_frame['languagename'] = getid3_id3v2::LanguageLookup($frame_language, false); + $parsed_frame['description'] = $frame_description; + if (!empty($parsed_frame['framenameshort']) && !empty($parsed_frame['data'])) { + $getid3->info['id3v2']['comments'][$parsed_frame['framenameshort']][] = $getid3->iconv($parsed_frame['encoding'], 'UTF-8', $parsed_frame['data']); + } + unset($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'SYLT')) || // 4.9 SYLT Synchronised lyric/text + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'SLT'))) { // 4.10 SLT Synchronised lyric/text + + // There may be more than one 'SYLT' frame in each tag, + // but only one with the same language and content descriptor. + //
+ // Text encoding $xx + // Language $xx xx xx + // Time stamp format $xx + // $01 (32-bit value) MPEG frames from beginning of file + // $02 (32-bit value) milliseconds from beginning of file + // Content type $xx + // Content descriptor $00 (00) + // Terminated text to be synced (typically a syllable) + // Sync identifier (terminator to above string) $00 (00) + // Time stamp $xx (xx ...) + + $frame_offset = 0; + $frame_text_encoding = ord($parsed_frame['data']{$frame_offset++}); + if ((($id3v2_major_version <= 3) && ($frame_text_encoding > 1)) || (($id3v2_major_version == 4) && ($frame_text_encoding > 3))) { + $getid3->warning('Invalid text encoding byte ('.$frame_text_encoding.') in frame "'.$parsed_frame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + } + $frame_language = substr($parsed_frame['data'], $frame_offset, 3); + $frame_offset += 3; + $parsed_frame['timestampformat'] = ord($parsed_frame['data']{$frame_offset++}); + $parsed_frame['contenttypeid'] = ord($parsed_frame['data']{$frame_offset++}); + $parsed_frame['contenttype'] = getid3_id3v2::SYTLContentTypeLookup($parsed_frame['contenttypeid']); + $parsed_frame['encodingid'] = $frame_text_encoding; + $parsed_frame['encoding'] = $this->TextEncodingNameLookup($frame_text_encoding); + + $parsed_frame['language'] = $frame_language; + $parsed_frame['languagename'] = getid3_id3v2::LanguageLookup($frame_language, false); + + $timestamp_index = 0; + $frame_remaining_data = substr($parsed_frame['data'], $frame_offset); + while (strlen($frame_remaining_data)) { + $frame_offset = 0; + $frame_terminator_pos = strpos($frame_remaining_data, getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)); + if ($frame_terminator_pos === false) { + $frame_remaining_data = ''; + } else { + if (ord(substr($frame_remaining_data, $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)), 1)) === 0) { + $frame_terminator_pos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + $parsed_frame['lyrics'][$timestamp_index]['data'] = substr($frame_remaining_data, $frame_offset, $frame_terminator_pos - $frame_offset); + + $frame_remaining_data = substr($frame_remaining_data, $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding))); + if (($timestamp_index == 0) && (ord($frame_remaining_data{0}) != 0)) { + // timestamp probably omitted for first data item + } else { + $parsed_frame['lyrics'][$timestamp_index]['timestamp'] = getid3_lib::BigEndian2Int(substr($frame_remaining_data, 0, 4)); + $frame_remaining_data = substr($frame_remaining_data, 4); + } + $timestamp_index++; + } + } + unset($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'COMM')) || // 4.10 COMM Comments + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'COM'))) { // 4.11 COM Comments + + // There may be more than one comment frame in each tag, + // but only one with the same language and content descriptor. + //
+ // Text encoding $xx + // Language $xx xx xx + // Short content descrip. $00 (00) + // The actual text + + if (strlen($parsed_frame['data']) < 5) { + + $getid3->warning('Invalid data (too short) for "'.$parsed_frame['frame_name'].'" frame at offset '.$parsed_frame['dataoffset']); + return true; + } + + $frame_offset = 0; + $frame_text_encoding = ord($parsed_frame['data']{$frame_offset++}); + if ((($id3v2_major_version <= 3) && ($frame_text_encoding > 1)) || (($id3v2_major_version == 4) && ($frame_text_encoding > 3))) { + $getid3->warning('Invalid text encoding byte ('.$frame_text_encoding.') in frame "'.$parsed_frame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + } + $frame_language = substr($parsed_frame['data'], $frame_offset, 3); + $frame_offset += 3; + $frame_terminator_pos = @strpos($parsed_frame['data'], getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding), $frame_offset); + if (ord(substr($parsed_frame['data'], $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)), 1)) === 0) { + $frame_terminator_pos++; // @strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + $frame_description = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_description) === 0) { + $frame_description = ''; + } + $frame_text = (string)substr($parsed_frame['data'], $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding))); + + $parsed_frame['encodingid'] = $frame_text_encoding; + $parsed_frame['encoding'] = $this->TextEncodingNameLookup($frame_text_encoding); + + $parsed_frame['language'] = $frame_language; + $parsed_frame['languagename'] = getid3_id3v2::LanguageLookup($frame_language, false); + $parsed_frame['description'] = $frame_description; + $parsed_frame['data'] = $frame_text; + if (!empty($parsed_frame['framenameshort']) && !empty($parsed_frame['data'])) { + $getid3->info['id3v2']['comments'][$parsed_frame['framenameshort']][] = $getid3->iconv($parsed_frame['encoding'], 'UTF-8', $parsed_frame['data']); + } + return true; + } + + + if (($id3v2_major_version >= 4) && ($parsed_frame['frame_name'] == 'RVA2')) { // 4.11 RVA2 Relative volume adjustment (2) (ID3v2.4+ only) + + // There may be more than one 'RVA2' frame in each tag, + // but only one with the same identification string + //
+ // Identification $00 + // The 'identification' string is used to identify the situation and/or + // device where this adjustment should apply. The following is then + // repeated for every channel: + // Type of channel $xx + // Volume adjustment $xx xx + // Bits representing peak $xx + // Peak volume $xx (xx ...) + + $frame_terminator_pos = strpos($parsed_frame['data'], "\x00"); + $frame_id_string = substr($parsed_frame['data'], 0, $frame_terminator_pos); + if (ord($frame_id_string) === 0) { + $frame_id_string = ''; + } + $frame_remaining_data = substr($parsed_frame['data'], $frame_terminator_pos + strlen("\x00")); + $parsed_frame['description'] = $frame_id_string; + + while (strlen($frame_remaining_data)) { + $frame_offset = 0; + $frame_channeltypeid = ord(substr($frame_remaining_data, $frame_offset++, 1)); + $parsed_frame[$frame_channeltypeid]['channeltypeid'] = $frame_channeltypeid; + $parsed_frame[$frame_channeltypeid]['channeltype'] = getid3_id3v2::RVA2ChannelTypeLookup($frame_channeltypeid); + $parsed_frame[$frame_channeltypeid]['volumeadjust'] = getid3_lib::BigEndian2Int(substr($frame_remaining_data, $frame_offset, 2), true); // 16-bit signed + $frame_offset += 2; + $parsed_frame[$frame_channeltypeid]['bitspeakvolume'] = ord(substr($frame_remaining_data, $frame_offset++, 1)); + $frame_bytespeakvolume = ceil($parsed_frame[$frame_channeltypeid]['bitspeakvolume'] / 8); + $parsed_frame[$frame_channeltypeid]['peakvolume'] = getid3_lib::BigEndian2Int(substr($frame_remaining_data, $frame_offset, $frame_bytespeakvolume)); + $frame_remaining_data = substr($frame_remaining_data, $frame_offset + $frame_bytespeakvolume); + } + unset($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version == 3) && ($parsed_frame['frame_name'] == 'RVAD')) || // 4.12 RVAD Relative volume adjustment (ID3v2.3 only) + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'RVA'))) { // 4.12 RVA Relative volume adjustment (ID3v2.2 only) + + // There may only be one 'RVA' frame in each tag + //
+ // ID3v2.2 => Increment/decrement %000000ba + // ID3v2.3 => Increment/decrement %00fedcba + // Bits used for volume descr. $xx + // Relative volume change, right $xx xx (xx ...) // a + // Relative volume change, left $xx xx (xx ...) // b + // Peak volume right $xx xx (xx ...) + // Peak volume left $xx xx (xx ...) + // ID3v2.3 only, optional (not present in ID3v2.2): + // Relative volume change, right back $xx xx (xx ...) // c + // Relative volume change, left back $xx xx (xx ...) // d + // Peak volume right back $xx xx (xx ...) + // Peak volume left back $xx xx (xx ...) + // ID3v2.3 only, optional (not present in ID3v2.2): + // Relative volume change, center $xx xx (xx ...) // e + // Peak volume center $xx xx (xx ...) + // ID3v2.3 only, optional (not present in ID3v2.2): + // Relative volume change, bass $xx xx (xx ...) // f + // Peak volume bass $xx xx (xx ...) + + $frame_offset = 0; + $frame_incrdecrflags = getid3_lib::BigEndian2Bin($parsed_frame['data']{$frame_offset++}); + $parsed_frame['incdec']['right'] = (bool)substr($frame_incrdecrflags, 6, 1); + $parsed_frame['incdec']['left'] = (bool)substr($frame_incrdecrflags, 7, 1); + $parsed_frame['bitsvolume'] = ord($parsed_frame['data']{$frame_offset++}); + $frame_bytesvolume = ceil($parsed_frame['bitsvolume'] / 8); + $parsed_frame['volumechange']['right'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, $frame_bytesvolume)); + if ($parsed_frame['incdec']['right'] === false) { + $parsed_frame['volumechange']['right'] *= -1; + } + $frame_offset += $frame_bytesvolume; + $parsed_frame['volumechange']['left'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, $frame_bytesvolume)); + if ($parsed_frame['incdec']['left'] === false) { + $parsed_frame['volumechange']['left'] *= -1; + } + $frame_offset += $frame_bytesvolume; + $parsed_frame['peakvolume']['right'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, $frame_bytesvolume)); + $frame_offset += $frame_bytesvolume; + $parsed_frame['peakvolume']['left'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, $frame_bytesvolume)); + $frame_offset += $frame_bytesvolume; + if ($id3v2_major_version == 3) { + $parsed_frame['data'] = substr($parsed_frame['data'], $frame_offset); + if (strlen($parsed_frame['data']) > 0) { + $parsed_frame['incdec']['rightrear'] = (bool)substr($frame_incrdecrflags, 4, 1); + $parsed_frame['incdec']['leftrear'] = (bool)substr($frame_incrdecrflags, 5, 1); + $parsed_frame['volumechange']['rightrear'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, $frame_bytesvolume)); + if ($parsed_frame['incdec']['rightrear'] === false) { + $parsed_frame['volumechange']['rightrear'] *= -1; + } + $frame_offset += $frame_bytesvolume; + $parsed_frame['volumechange']['leftrear'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, $frame_bytesvolume)); + if ($parsed_frame['incdec']['leftrear'] === false) { + $parsed_frame['volumechange']['leftrear'] *= -1; + } + $frame_offset += $frame_bytesvolume; + $parsed_frame['peakvolume']['rightrear'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, $frame_bytesvolume)); + $frame_offset += $frame_bytesvolume; + $parsed_frame['peakvolume']['leftrear'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, $frame_bytesvolume)); + $frame_offset += $frame_bytesvolume; + } + $parsed_frame['data'] = substr($parsed_frame['data'], $frame_offset); + if (strlen($parsed_frame['data']) > 0) { + $parsed_frame['incdec']['center'] = (bool)substr($frame_incrdecrflags, 3, 1); + $parsed_frame['volumechange']['center'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, $frame_bytesvolume)); + if ($parsed_frame['incdec']['center'] === false) { + $parsed_frame['volumechange']['center'] *= -1; + } + $frame_offset += $frame_bytesvolume; + $parsed_frame['peakvolume']['center'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, $frame_bytesvolume)); + $frame_offset += $frame_bytesvolume; + } + $parsed_frame['data'] = substr($parsed_frame['data'], $frame_offset); + if (strlen($parsed_frame['data']) > 0) { + $parsed_frame['incdec']['bass'] = (bool)substr($frame_incrdecrflags, 2, 1); + $parsed_frame['volumechange']['bass'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, $frame_bytesvolume)); + if ($parsed_frame['incdec']['bass'] === false) { + $parsed_frame['volumechange']['bass'] *= -1; + } + $frame_offset += $frame_bytesvolume; + $parsed_frame['peakvolume']['bass'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, $frame_bytesvolume)); + $frame_offset += $frame_bytesvolume; + } + } + unset($parsed_frame['data']); + return true; + } + + + if (($id3v2_major_version >= 4) && ($parsed_frame['frame_name'] == 'EQU2')) { // 4.12 EQU2 Equalisation (2) (ID3v2.4+ only) + + // There may be more than one 'EQU2' frame in each tag, + // but only one with the same identification string + //
+ // Interpolation method $xx + // $00 Band + // $01 Linear + // Identification $00 + // The following is then repeated for every adjustment point + // Frequency $xx xx + // Volume adjustment $xx xx + + $frame_offset = 0; + $frame_interpolationmethod = ord($parsed_frame['data']{$frame_offset++}); + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_id_string = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_id_string) === 0) { + $frame_id_string = ''; + } + $parsed_frame['description'] = $frame_id_string; + $frame_remaining_data = substr($parsed_frame['data'], $frame_terminator_pos + strlen("\x00")); + while (strlen($frame_remaining_data)) { + $frame_frequency = getid3_lib::BigEndian2Int(substr($frame_remaining_data, 0, 2)) / 2; + $parsed_frame['data'][$frame_frequency] = getid3_lib::BigEndian2Int(substr($frame_remaining_data, 2, 2), true); + $frame_remaining_data = substr($frame_remaining_data, 4); + } + $parsed_frame['interpolationmethod'] = $frame_interpolationmethod; + unset($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version == 3) && ($parsed_frame['frame_name'] == 'EQUA')) || // 4.12 EQUA Equalisation (ID3v2.3 only) + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'EQU'))) { // 4.13 EQU Equalisation (ID3v2.2 only) + + // There may only be one 'EQUA' frame in each tag + //
+ // Adjustment bits $xx + // This is followed by 2 bytes + ('adjustment bits' rounded up to the + // nearest byte) for every equalisation band in the following format, + // giving a frequency range of 0 - 32767Hz: + // Increment/decrement %x (MSB of the Frequency) + // Frequency (lower 15 bits) + // Adjustment $xx (xx ...) + + $frame_offset = 0; + $parsed_frame['adjustmentbits'] = $parsed_frame['data']{$frame_offset++}; + $frame_adjustment_bytes = ceil($parsed_frame['adjustmentbits'] / 8); + + $frame_remaining_data = (string)substr($parsed_frame['data'], $frame_offset); + while (strlen($frame_remaining_data) > 0) { + $frame_frequencystr = getid3_lib::BigEndian2Bin(substr($frame_remaining_data, 0, 2)); + $frame_incdec = (bool)substr($frame_frequencystr, 0, 1); + $frame_frequency = bindec(substr($frame_frequencystr, 1, 15)); + $parsed_frame[$frame_frequency]['incdec'] = $frame_incdec; + $parsed_frame[$frame_frequency]['adjustment'] = getid3_lib::BigEndian2Int(substr($frame_remaining_data, 2, $frame_adjustment_bytes)); + if ($parsed_frame[$frame_frequency]['incdec'] === false) { + $parsed_frame[$frame_frequency]['adjustment'] *= -1; + } + $frame_remaining_data = substr($frame_remaining_data, 2 + $frame_adjustment_bytes); + } + unset($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'RVRB')) || // 4.13 RVRB Reverb + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'REV'))) { // 4.14 REV Reverb + + // There may only be one 'RVRB' frame in each tag. + //
+ // Reverb left (ms) $xx xx + // Reverb right (ms) $xx xx + // Reverb bounces, left $xx + // Reverb bounces, right $xx + // Reverb feedback, left to left $xx + // Reverb feedback, left to right $xx + // Reverb feedback, right to right $xx + // Reverb feedback, right to left $xx + // Premix left to right $xx + // Premix right to left $xx + + $frame_offset = 0; + $parsed_frame['left'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, 2)); + $frame_offset += 2; + $parsed_frame['right'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, 2)); + $frame_offset += 2; + $parsed_frame['bouncesL'] = ord($parsed_frame['data']{$frame_offset++}); + $parsed_frame['bouncesR'] = ord($parsed_frame['data']{$frame_offset++}); + $parsed_frame['feedbackLL'] = ord($parsed_frame['data']{$frame_offset++}); + $parsed_frame['feedbackLR'] = ord($parsed_frame['data']{$frame_offset++}); + $parsed_frame['feedbackRR'] = ord($parsed_frame['data']{$frame_offset++}); + $parsed_frame['feedbackRL'] = ord($parsed_frame['data']{$frame_offset++}); + $parsed_frame['premixLR'] = ord($parsed_frame['data']{$frame_offset++}); + $parsed_frame['premixRL'] = ord($parsed_frame['data']{$frame_offset++}); + unset($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'APIC')) || // 4.14 APIC Attached picture + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'PIC'))) { // 4.15 PIC Attached picture + + // There may be several pictures attached to one file, + // each in their individual 'APIC' frame, but only one + // with the same content descriptor + //
+ // Text encoding $xx + // ID3v2.3+ => MIME type $00 + // ID3v2.2 => Image format $xx xx xx + // Picture type $xx + // Description $00 (00) + // Picture data + + $frame_offset = 0; + $frame_text_encoding = ord($parsed_frame['data']{$frame_offset++}); + if ((($id3v2_major_version <= 3) && ($frame_text_encoding > 1)) || (($id3v2_major_version == 4) && ($frame_text_encoding > 3))) { + $getid3->warning('Invalid text encoding byte ('.$frame_text_encoding.') in frame "'.$parsed_frame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + } + + if ($id3v2_major_version == 2 && strlen($parsed_frame['data']) > $frame_offset) { + $frame_imagetype = substr($parsed_frame['data'], $frame_offset, 3); + if (strtolower($frame_imagetype) == 'ima') { + // complete hack for mp3Rage (www.chaoticsoftware.com) that puts ID3v2.3-formatted + // MIME type instead of 3-char ID3v2.2-format image type (thanks xbhoffØpacbell*net) + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_mimetype = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_mimetype) === 0) { + $frame_mimetype = ''; + } + $frame_imagetype = strtoupper(str_replace('image/', '', strtolower($frame_mimetype))); + if ($frame_imagetype == 'JPEG') { + $frame_imagetype = 'JPG'; + } + $frame_offset = $frame_terminator_pos + strlen("\x00"); + } else { + $frame_offset += 3; + } + } + + if ($id3v2_major_version > 2 && strlen($parsed_frame['data']) > $frame_offset) { + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_mimetype = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_mimetype) === 0) { + $frame_mimetype = ''; + } + $frame_offset = $frame_terminator_pos + strlen("\x00"); + } + + $frame_picturetype = ord($parsed_frame['data']{$frame_offset++}); + + $frame_terminator_pos = @strpos($parsed_frame['data'], getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding), $frame_offset); + if (ord(substr($parsed_frame['data'], $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)), 1)) === 0) { + $frame_terminator_pos++; // @strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + $frame_description = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_description) === 0) { + $frame_description = ''; + } + $parsed_frame['encodingid'] = $frame_text_encoding; + $parsed_frame['encoding'] = $this->TextEncodingNameLookup($frame_text_encoding); + + if ($id3v2_major_version == 2) { + $parsed_frame['imagetype'] = $frame_imagetype; + } else { + $parsed_frame['mime'] = $frame_mimetype; + } + $parsed_frame['picturetypeid'] = $frame_picturetype; + $parsed_frame['picturetype'] = getid3_id3v2::APICPictureTypeLookup($frame_picturetype); + $parsed_frame['description'] = $frame_description; + $parsed_frame['data'] = substr($parsed_frame['data'], $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding))); + + if ($getid3->option_tags_images) { + + $image_chunk_check = getid3_lib_image_size::get($parsed_frame['data']); + if (($image_chunk_check[2] >= 1) && ($image_chunk_check[2] <= 3)) { + $parsed_frame['image_mime'] = image_type_to_mime_type($image_chunk_check[2]); + + if ($image_chunk_check[0]) { + $parsed_frame['image_width'] = $image_chunk_check[0]; + } + + if ($image_chunk_check[1]) { + $parsed_frame['image_height'] = $image_chunk_check[1]; + } + + $parsed_frame['image_bytes'] = strlen($parsed_frame['data']); + } + } + + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'GEOB')) || // 4.15 GEOB General encapsulated object + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'GEO'))) { // 4.16 GEO General encapsulated object + + // There may be more than one 'GEOB' frame in each tag, + // but only one with the same content descriptor + //
+ // Text encoding $xx + // MIME type $00 + // Filename $00 (00) + // Content description $00 (00) + // Encapsulated object + + $frame_offset = 0; + $frame_text_encoding = ord($parsed_frame['data']{$frame_offset++}); + if ((($id3v2_major_version <= 3) && ($frame_text_encoding > 1)) || (($id3v2_major_version == 4) && ($frame_text_encoding > 3))) { + $getid3->warning('Invalid text encoding byte ('.$frame_text_encoding.') in frame "'.$parsed_frame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + } + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_mimetype = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_mimetype) === 0) { + $frame_mimetype = ''; + } + $frame_offset = $frame_terminator_pos + strlen("\x00"); + + $frame_terminator_pos = @strpos($parsed_frame['data'], getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding), $frame_offset); + if (ord(substr($parsed_frame['data'], $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)), 1)) === 0) { + $frame_terminator_pos++; // @strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + $frame_filename = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_filename) === 0) { + $frame_filename = ''; + } + $frame_offset = $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)); + + $frame_terminator_pos = @strpos($parsed_frame['data'], getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding), $frame_offset); + if (ord(substr($parsed_frame['data'], $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)), 1)) === 0) { + $frame_terminator_pos++; // @strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + $frame_description = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_description) === 0) { + $frame_description = ''; + } + $frame_offset = $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)); + + $parsed_frame['objectdata'] = (string)substr($parsed_frame['data'], $frame_offset); + $parsed_frame['encodingid'] = $frame_text_encoding; + $parsed_frame['encoding'] = $this->TextEncodingNameLookup($frame_text_encoding); + + $parsed_frame['mime'] = $frame_mimetype; + $parsed_frame['filename'] = $frame_filename; + $parsed_frame['description'] = $frame_description; + unset($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'PCNT')) || // 4.16 PCNT Play counter + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'CNT'))) { // 4.17 CNT Play counter + + // There may only be one 'PCNT' frame in each tag. + // When the counter reaches all one's, one byte is inserted in + // front of the counter thus making the counter eight bits bigger + //
+ // Counter $xx xx xx xx (xx ...) + + $parsed_frame['data'] = getid3_lib::BigEndian2Int($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'POPM')) || // 4.17 POPM Popularimeter + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'POP'))) { // 4.18 POP Popularimeter + + // There may be more than one 'POPM' frame in each tag, + // but only one with the same email address + //
+ // Email to user $00 + // Rating $xx + // Counter $xx xx xx xx (xx ...) + + $frame_offset = 0; + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_email_address = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_email_address) === 0) { + $frame_email_address = ''; + } + $frame_offset = $frame_terminator_pos + strlen("\x00"); + $frame_rating = ord($parsed_frame['data']{$frame_offset++}); + $parsed_frame['data'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset)); + $parsed_frame['email'] = $frame_email_address; + $parsed_frame['rating'] = $frame_rating; + unset($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'RBUF')) || // 4.18 RBUF Recommended buffer size + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'BUF'))) { // 4.19 BUF Recommended buffer size + + // There may only be one 'RBUF' frame in each tag + //
+ // Buffer size $xx xx xx + // Embedded info flag %0000000x + // Offset to next tag $xx xx xx xx + + $frame_offset = 0; + $parsed_frame['buffersize'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, 3)); + $frame_offset += 3; + + $frame_embeddedinfoflags = getid3_lib::BigEndian2Bin($parsed_frame['data']{$frame_offset++}); + $parsed_frame['flags']['embededinfo'] = (bool)substr($frame_embeddedinfoflags, 7, 1); + $parsed_frame['nexttagoffset'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, 4)); + unset($parsed_frame['data']); + return true; + } + + + if (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'CRM')) { // 4.20 Encrypted meta frame (ID3v2.2 only) + + // There may be more than one 'CRM' frame in a tag, + // but only one with the same 'owner identifier' + //
+ // Owner identifier $00 (00) + // Content/explanation $00 (00) + // Encrypted datablock + + $frame_offset = 0; + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_owner_id = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + $frame_offset = $frame_terminator_pos + strlen("\x00"); + + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_description = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_description) === 0) { + $frame_description = ''; + } + $frame_offset = $frame_terminator_pos + strlen("\x00"); + + $parsed_frame['ownerid'] = $frame_owner_id; + $parsed_frame['data'] = (string)substr($parsed_frame['data'], $frame_offset); + $parsed_frame['description'] = $frame_description; + unset($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'AENC')) || // 4.19 AENC Audio encryption + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'CRA'))) { // 4.21 CRA Audio encryption + + // There may be more than one 'AENC' frames in a tag, + // but only one with the same 'Owner identifier' + //
+ // Owner identifier $00 + // Preview start $xx xx + // Preview length $xx xx + // Encryption info + + $frame_offset = 0; + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_owner_id = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_owner_id) === 0) { + $frame_owner_id == ''; + } + $frame_offset = $frame_terminator_pos + strlen("\x00"); + $parsed_frame['ownerid'] = $frame_owner_id; + $parsed_frame['previewstart'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, 2)); + $frame_offset += 2; + $parsed_frame['previewlength'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, 2)); + $frame_offset += 2; + $parsed_frame['encryptioninfo'] = (string)substr($parsed_frame['data'], $frame_offset); + unset($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'LINK')) || // 4.20 LINK Linked information + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'LNK'))) { // 4.22 LNK Linked information + + // There may be more than one 'LINK' frame in a tag, + // but only one with the same contents + //
+ // ID3v2.3+ => Frame identifier $xx xx xx xx + // ID3v2.2 => Frame identifier $xx xx xx + // URL $00 + // ID and additional data + + $frame_offset = 0; + if ($id3v2_major_version == 2) { + $parsed_frame['frameid'] = substr($parsed_frame['data'], $frame_offset, 3); + $frame_offset += 3; + } else { + $parsed_frame['frameid'] = substr($parsed_frame['data'], $frame_offset, 4); + $frame_offset += 4; + } + + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_url = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_url) === 0) { + $frame_url = ''; + } + $frame_offset = $frame_terminator_pos + strlen("\x00"); + $parsed_frame['url'] = $frame_url; + + $parsed_frame['additionaldata'] = (string)substr($parsed_frame['data'], $frame_offset); + if (!empty($parsed_frame['framenameshort']) && $parsed_frame['url']) { + $getid3->info['id3v2']['comments'][$parsed_frame['framenameshort']][] = utf8_encode($parsed_frame['url']); + } + unset($parsed_frame['data']); + return true; + } + + + if (($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'POSS')) { // 4.21 POSS Position synchronisation frame (ID3v2.3+ only) + + // There may only be one 'POSS' frame in each tag + // + // Time stamp format $xx + // Position $xx (xx ...) + + $frame_offset = 0; + $parsed_frame['timestampformat'] = ord($parsed_frame['data']{$frame_offset++}); + $parsed_frame['position'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset)); + unset($parsed_frame['data']); + return true; + } + + + if (($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'USER')) { // 4.22 USER Terms of use (ID3v2.3+ only) + + // There may be more than one 'Terms of use' frame in a tag, + // but only one with the same 'Language' + //
+ // Text encoding $xx + // Language $xx xx xx + // The actual text + + $frame_offset = 0; + $frame_text_encoding = ord($parsed_frame['data']{$frame_offset++}); + if ((($id3v2_major_version <= 3) && ($frame_text_encoding > 1)) || (($id3v2_major_version == 4) && ($frame_text_encoding > 3))) { + $getid3->warning('Invalid text encoding byte ('.$frame_text_encoding.') in frame "'.$parsed_frame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + } + $frame_language = substr($parsed_frame['data'], $frame_offset, 3); + $frame_offset += 3; + $parsed_frame['language'] = $frame_language; + $parsed_frame['languagename'] = getid3_id3v2::LanguageLookup($frame_language, false); + $parsed_frame['encodingid'] = $frame_text_encoding; + $parsed_frame['encoding'] = $this->TextEncodingNameLookup($frame_text_encoding); + + $parsed_frame['data'] = (string)substr($parsed_frame['data'], $frame_offset); + if (!empty($parsed_frame['framenameshort']) && !empty($parsed_frame['data'])) { + $getid3->info['id3v2']['comments'][$parsed_frame['framenameshort']][] = $getid3->iconv($parsed_frame['encoding'], 'UTF-8', $parsed_frame['data']); + } + unset($parsed_frame['data']); + return true; + } + + + if (($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'OWNE')) { // 4.23 OWNE Ownership frame (ID3v2.3+ only) + + // There may only be one 'OWNE' frame in a tag + //
+ // Text encoding $xx + // Price paid $00 + // Date of purch. + // Seller + + $frame_offset = 0; + $frame_text_encoding = ord($parsed_frame['data']{$frame_offset++}); + if ((($id3v2_major_version <= 3) && ($frame_text_encoding > 1)) || (($id3v2_major_version == 4) && ($frame_text_encoding > 3))) { + $getid3->warning('Invalid text encoding byte ('.$frame_text_encoding.') in frame "'.$parsed_frame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + } + $parsed_frame['encodingid'] = $frame_text_encoding; + $parsed_frame['encoding'] = $this->TextEncodingNameLookup($frame_text_encoding); + + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_pricepaid = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + $frame_offset = $frame_terminator_pos + strlen("\x00"); + + $parsed_frame['pricepaid']['currencyid'] = substr($frame_pricepaid, 0, 3); + $parsed_frame['pricepaid']['currency'] = getid3_id3v2::LookupCurrencyUnits($parsed_frame['pricepaid']['currencyid']); + $parsed_frame['pricepaid']['value'] = substr($frame_pricepaid, 3); + + $parsed_frame['purchasedate'] = substr($parsed_frame['data'], $frame_offset, 8); + if (!getid3_id3v2::IsValidDateStampString($parsed_frame['purchasedate'])) { + $parsed_frame['purchasedateunix'] = gmmktime (0, 0, 0, substr($parsed_frame['purchasedate'], 4, 2), substr($parsed_frame['purchasedate'], 6, 2), substr($parsed_frame['purchasedate'], 0, 4)); + } + $frame_offset += 8; + + $parsed_frame['seller'] = (string)substr($parsed_frame['data'], $frame_offset); + unset($parsed_frame['data']); + return true; + } + + + if (($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'COMR')) { // 4.24 COMR Commercial frame (ID3v2.3+ only) + + // There may be more than one 'commercial frame' in a tag, + // but no two may be identical + //
+ // Text encoding $xx + // Price string $00 + // Valid until + // Contact URL $00 + // Received as $xx + // Name of seller $00 (00) + // Description $00 (00) + // Picture MIME type $00 + // Seller logo + + $frame_offset = 0; + $frame_text_encoding = ord($parsed_frame['data']{$frame_offset++}); + if ((($id3v2_major_version <= 3) && ($frame_text_encoding > 1)) || (($id3v2_major_version == 4) && ($frame_text_encoding > 3))) { + $getid3->warning('Invalid text encoding byte ('.$frame_text_encoding.') in frame "'.$parsed_frame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + } + + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_price_string = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + $frame_offset = $frame_terminator_pos + strlen("\x00"); + $frame_rawpricearray = explode('/', $frame_price_string); + foreach ($frame_rawpricearray as $key => $val) { + $frame_currencyid = substr($val, 0, 3); + $parsed_frame['price'][$frame_currencyid]['currency'] = getid3_id3v2::LookupCurrencyUnits($frame_currencyid); + $parsed_frame['price'][$frame_currencyid]['value'] = substr($val, 3); + } + + $frame_date_string = substr($parsed_frame['data'], $frame_offset, 8); + $frame_offset += 8; + + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_contacturl = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + $frame_offset = $frame_terminator_pos + strlen("\x00"); + + $frame_received_as_id = ord($parsed_frame['data']{$frame_offset++}); + + $frame_terminator_pos = @strpos($parsed_frame['data'], getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding), $frame_offset); + if (ord(substr($parsed_frame['data'], $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)), 1)) === 0) { + $frame_terminator_pos++; // @strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + + $frame_sellername = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_sellername) === 0) { + $frame_sellername = ''; + } + + $frame_offset = $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)); + + $frame_terminator_pos = @strpos($parsed_frame['data'], getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding), $frame_offset); + if (ord(substr($parsed_frame['data'], $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)), 1)) === 0) { + $frame_terminator_pos++; // @strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + + $frame_description = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_description) === 0) { + $frame_description = ''; + } + + $frame_offset = $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)); + + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_mimetype = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + $frame_offset = $frame_terminator_pos + strlen("\x00"); + + $frame_sellerlogo = substr($parsed_frame['data'], $frame_offset); + + $parsed_frame['encodingid'] = $frame_text_encoding; + $parsed_frame['encoding'] = $this->TextEncodingNameLookup($frame_text_encoding); + + $parsed_frame['pricevaliduntil'] = $frame_date_string; + $parsed_frame['contacturl'] = $frame_contacturl; + $parsed_frame['receivedasid'] = $frame_received_as_id; + $parsed_frame['receivedas'] = getid3_id3v2::COMRReceivedAsLookup($frame_received_as_id); + $parsed_frame['sellername'] = $frame_sellername; + $parsed_frame['description'] = $frame_description; + $parsed_frame['mime'] = $frame_mimetype; + $parsed_frame['logo'] = $frame_sellerlogo; + unset($parsed_frame['data']); + } + + + if (($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'ENCR')) { // 4.25 ENCR Encryption method registration (ID3v2.3+ only) + + // There may be several 'ENCR' frames in a tag, + // but only one containing the same symbol + // and only one containing the same owner identifier + //
+ // Owner identifier $00 + // Method symbol $xx + // Encryption data + + $frame_offset = 0; + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_owner_id = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_owner_id) === 0) { + $frame_owner_id = ''; + } + $frame_offset = $frame_terminator_pos + strlen("\x00"); + + $parsed_frame['ownerid'] = $frame_owner_id; + $parsed_frame['methodsymbol'] = ord($parsed_frame['data']{$frame_offset++}); + $parsed_frame['data'] = (string)substr($parsed_frame['data'], $frame_offset); + return true; + } + + + if (($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'GRID')) { // 4.26 GRID Group identification registration (ID3v2.3+ only) + + // There may be several 'GRID' frames in a tag, + // but only one containing the same symbol + // and only one containing the same owner identifier + //
+ // Owner identifier $00 + // Group symbol $xx + // Group dependent data + + $frame_offset = 0; + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_owner_id = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_owner_id) === 0) { + $frame_owner_id = ''; + } + $frame_offset = $frame_terminator_pos + strlen("\x00"); + + $parsed_frame['ownerid'] = $frame_owner_id; + $parsed_frame['groupsymbol'] = ord($parsed_frame['data']{$frame_offset++}); + $parsed_frame['data'] = (string)substr($parsed_frame['data'], $frame_offset); + return true; + } + + + if (($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'PRIV')) { // 4.27 PRIV Private frame (ID3v2.3+ only) + + // The tag may contain more than one 'PRIV' frame + // but only with different contents + //
+ // Owner identifier $00 + // The private data + + $frame_offset = 0; + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_owner_id = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_owner_id) === 0) { + $frame_owner_id = ''; + } + $frame_offset = $frame_terminator_pos + strlen("\x00"); + + $parsed_frame['ownerid'] = $frame_owner_id; + $parsed_frame['data'] = (string)substr($parsed_frame['data'], $frame_offset); + return true; + } + + + if (($id3v2_major_version >= 4) && ($parsed_frame['frame_name'] == 'SIGN')) { // 4.28 SIGN Signature frame (ID3v2.4+ only) + + // There may be more than one 'signature frame' in a tag, + // but no two may be identical + //
+ // Group symbol $xx + // Signature + + $frame_offset = 0; + $parsed_frame['groupsymbol'] = ord($parsed_frame['data']{$frame_offset++}); + $parsed_frame['data'] = (string)substr($parsed_frame['data'], $frame_offset); + return true; + } + + + if (($id3v2_major_version >= 4) && ($parsed_frame['frame_name'] == 'SEEK')) { // 4.29 SEEK Seek frame (ID3v2.4+ only) + + // There may only be one 'seek frame' in a tag + //
+ // Minimum offset to next tag $xx xx xx xx + + $frame_offset = 0; + $parsed_frame['data'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, 4)); + return true; + } + + + if (($id3v2_major_version >= 4) && ($parsed_frame['frame_name'] == 'ASPI')) { // 4.30 ASPI Audio seek point index (ID3v2.4+ only) + + // There may only be one 'audio seek point index' frame in a tag + //
+ // Indexed data start (S) $xx xx xx xx + // Indexed data length (L) $xx xx xx xx + // Number of index points (N) $xx xx + // Bits per index point (b) $xx + // Then for every index point the following data is included: + // Fraction at index (Fi) $xx (xx) + + $frame_offset = 0; + $parsed_frame['datastart'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, 4)); + $frame_offset += 4; + $parsed_frame['indexeddatalength'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, 4)); + $frame_offset += 4; + $parsed_frame['indexpoints'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, 2)); + $frame_offset += 2; + $parsed_frame['bitsperpoint'] = ord($parsed_frame['data']{$frame_offset++}); + $frame_bytesperpoint = ceil($parsed_frame['bitsperpoint'] / 8); + for ($i = 0; $i < $frame_indexpoints; $i++) { + $parsed_frame['indexes'][$i] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, $frame_bytesperpoint)); + $frame_offset += $frame_bytesperpoint; + } + unset($parsed_frame['data']); + return true; + } + + + if (($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'RGAD')) { // Replay Gain Adjustment + + // http://privatewww.essex.ac.uk/~djmrob/replaygain/file_format_id3v2.html + // There may only be one 'RGAD' frame in a tag + //
+ // Peak Amplitude $xx $xx $xx $xx + // Radio Replay Gain Adjustment %aaabbbcd %dddddddd + // Audiophile Replay Gain Adjustment %aaabbbcd %dddddddd + // a - name code + // b - originator code + // c - sign bit + // d - replay gain adjustment + + $frame_offset = 0; + + $parsed_frame['peakamplitude'] = (float)getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, 4)); + $frame_offset += 4; + + $rg_track_adjustment = decbin(substr($parsed_frame['data'], $frame_offset, 2)); + $frame_offset += 2; + + $rg_album_adjustment = decbin(substr($parsed_frame['data'], $frame_offset, 2)); + $frame_offset += 2; + + $parsed_frame['raw']['track']['name'] = bindec(substr($rg_track_adjustment, 0, 3)); + $parsed_frame['raw']['track']['originator'] = bindec(substr($rg_track_adjustment, 3, 3)); + $parsed_frame['raw']['track']['signbit'] = bindec($rg_track_adjustment[6]); + $parsed_frame['raw']['track']['adjustment'] = bindec(substr($rg_track_adjustment, 7, 9)); + $parsed_frame['raw']['album']['name'] = bindec(substr($rg_album_adjustment, 0, 3)); + $parsed_frame['raw']['album']['originator'] = bindec(substr($rg_album_adjustment, 3, 3)); + $parsed_frame['raw']['album']['signbit'] = bindec($rg_album_adjustment[6]); + $parsed_frame['raw']['album']['adjustment'] = bindec(substr($rg_album_adjustment, 7, 9)); + $parsed_frame['track']['name'] = getid3_lib_replaygain::NameLookup($parsed_frame['raw']['track']['name']); + $parsed_frame['track']['originator'] = getid3_lib_replaygain::OriginatorLookup($parsed_frame['raw']['track']['originator']); + $parsed_frame['track']['adjustment'] = getid3_lib_replaygain::AdjustmentLookup($parsed_frame['raw']['track']['adjustment'], $parsed_frame['raw']['track']['signbit']); + $parsed_frame['album']['name'] = getid3_lib_replaygain::NameLookup($parsed_frame['raw']['album']['name']); + $parsed_frame['album']['originator'] = getid3_lib_replaygain::OriginatorLookup($parsed_frame['raw']['album']['originator']); + $parsed_frame['album']['adjustment'] = getid3_lib_replaygain::AdjustmentLookup($parsed_frame['raw']['album']['adjustment'], $parsed_frame['raw']['album']['signbit']); + + $getid3->info['replay_gain']['track']['peak'] = $parsed_frame['peakamplitude']; + $getid3->info['replay_gain']['track']['originator'] = $parsed_frame['track']['originator']; + $getid3->info['replay_gain']['track']['adjustment'] = $parsed_frame['track']['adjustment']; + $getid3->info['replay_gain']['album']['originator'] = $parsed_frame['album']['originator']; + $getid3->info['replay_gain']['album']['adjustment'] = $parsed_frame['album']['adjustment']; + + unset($parsed_frame['data']); + return true; + } + + return true; + } + + + + private function TextEncodingNameLookup($encoding) { + + // Override specification - BRAINDEAD taggers + if (!$encoding) { + return $this->getid3->encoding_id3v2; + } + + // http://www.id3.org/id3v2.4.0-structure.txt + static $lookup = array ( + 0 => 'ISO-8859-1', + 1 => 'UTF-16', + 2 => 'UTF-16BE', + 3 => 'UTF-8', + 255 => 'UTF-16BE' + ); + + return (isset($lookup[$encoding]) ? $lookup[$encoding] : 'ISO-8859-1'); + } + + + + public static function ParseID3v2GenreString($genre_string) { + + // Parse genres into arrays of genreName and genreID + // ID3v2.2.x, ID3v2.3.x: '(21)' or '(4)Eurodisco' or '(51)(39)' or '(55)((I think...)' + // ID3v2.4.x: '21' $00 'Eurodisco' $00 + + $genre_string = trim($genre_string); + $return_array = array (); + if (strpos($genre_string, "\x00") !== false) { + $unprocessed = trim($genre_string); // trailing nulls will cause an infinite loop. + $genre_string = ''; + while (strpos($unprocessed, "\x00") !== false) { + // convert null-seperated v2.4-format into v2.3 ()-seperated format + $end_pos = strpos($unprocessed, "\x00"); + $genre_string .= '('.substr($unprocessed, 0, $end_pos).')'; + $unprocessed = substr($unprocessed, $end_pos + 1); + } + unset($unprocessed); + } + if (getid3_id3v1::LookupGenreID($genre_string)) { + + $return_array['genre'][] = $genre_string; + + } else { + + while (strpos($genre_string, '(') !== false) { + + $start_pos = strpos($genre_string, '('); + $end_pos = strpos($genre_string, ')'); + if (substr($genre_string, $start_pos + 1, 1) == '(') { + $genre_string = substr($genre_string, 0, $start_pos).substr($genre_string, $start_pos + 1); + $end_pos--; + } + $element = substr($genre_string, $start_pos + 1, $end_pos - ($start_pos + 1)); + $genre_string = substr($genre_string, 0, $start_pos).substr($genre_string, $end_pos + 1); + + if (getid3_id3v1::LookupGenreName($element)) { // $element is a valid genre id/abbreviation + + if (empty($return_array['genre']) || !in_array(getid3_id3v1::LookupGenreName($element), $return_array['genre'])) { // avoid duplicate entires + $return_array['genre'][] = getid3_id3v1::LookupGenreName($element); + } + } else { + + if (empty($return_array['genre']) || !in_array($element, $return_array['genre'])) { // avoid duplicate entires + $return_array['genre'][] = $element; + } + } + } + } + if ($genre_string) { + if (empty($return_array['genre']) || !in_array($genre_string, $return_array['genre'])) { // avoid duplicate entires + $return_array['genre'][] = $genre_string; + } + } + + return $return_array; + } + + + + public static function LookupCurrencyUnits($currency_id) { + + static $lookup = array ( + 'AED' => 'Dirhams', + 'AFA' => 'Afghanis', + 'ALL' => 'Leke', + 'AMD' => 'Drams', + 'ANG' => 'Guilders', + 'AOA' => 'Kwanza', + 'ARS' => 'Pesos', + 'ATS' => 'Schillings', + 'AUD' => 'Dollars', + 'AWG' => 'Guilders', + 'AZM' => 'Manats', + 'BAM' => 'Convertible Marka', + 'BBD' => 'Dollars', + 'BDT' => 'Taka', + 'BEF' => 'Francs', + 'BGL' => 'Leva', + 'BHD' => 'Dinars', + 'BIF' => 'Francs', + 'BMD' => 'Dollars', + 'BND' => 'Dollars', + 'BOB' => 'Bolivianos', + 'BRL' => 'Brazil Real', + 'BSD' => 'Dollars', + 'BTN' => 'Ngultrum', + 'BWP' => 'Pulas', + 'BYR' => 'Rubles', + 'BZD' => 'Dollars', + 'CAD' => 'Dollars', + 'CDF' => 'Congolese Francs', + 'CHF' => 'Francs', + 'CLP' => 'Pesos', + 'CNY' => 'Yuan Renminbi', + 'COP' => 'Pesos', + 'CRC' => 'Colones', + 'CUP' => 'Pesos', + 'CVE' => 'Escudos', + 'CYP' => 'Pounds', + 'CZK' => 'Koruny', + 'DEM' => 'Deutsche Marks', + 'DJF' => 'Francs', + 'DKK' => 'Kroner', + 'DOP' => 'Pesos', + 'DZD' => 'Algeria Dinars', + 'EEK' => 'Krooni', + 'EGP' => 'Pounds', + 'ERN' => 'Nakfa', + 'ESP' => 'Pesetas', + 'ETB' => 'Birr', + 'EUR' => 'Euro', + 'FIM' => 'Markkaa', + 'FJD' => 'Dollars', + 'FKP' => 'Pounds', + 'FRF' => 'Francs', + 'GBP' => 'Pounds', + 'GEL' => 'Lari', + 'GGP' => 'Pounds', + 'GHC' => 'Cedis', + 'GIP' => 'Pounds', + 'GMD' => 'Dalasi', + 'GNF' => 'Francs', + 'GRD' => 'Drachmae', + 'GTQ' => 'Quetzales', + 'GYD' => 'Dollars', + 'HKD' => 'Dollars', + 'HNL' => 'Lempiras', + 'HRK' => 'Kuna', + 'HTG' => 'Gourdes', + 'HUF' => 'Forints', + 'IDR' => 'Rupiahs', + 'IEP' => 'Pounds', + 'ILS' => 'New Shekels', + 'IMP' => 'Pounds', + 'INR' => 'Rupees', + 'IQD' => 'Dinars', + 'IRR' => 'Rials', + 'ISK' => 'Kronur', + 'ITL' => 'Lire', + 'JEP' => 'Pounds', + 'JMD' => 'Dollars', + 'JOD' => 'Dinars', + 'JPY' => 'Yen', + 'KES' => 'Shillings', + 'KGS' => 'Soms', + 'KHR' => 'Riels', + 'KMF' => 'Francs', + 'KPW' => 'Won', + 'KWD' => 'Dinars', + 'KYD' => 'Dollars', + 'KZT' => 'Tenge', + 'LAK' => 'Kips', + 'LBP' => 'Pounds', + 'LKR' => 'Rupees', + 'LRD' => 'Dollars', + 'LSL' => 'Maloti', + 'LTL' => 'Litai', + 'LUF' => 'Francs', + 'LVL' => 'Lati', + 'LYD' => 'Dinars', + 'MAD' => 'Dirhams', + 'MDL' => 'Lei', + 'MGF' => 'Malagasy Francs', + 'MKD' => 'Denars', + 'MMK' => 'Kyats', + 'MNT' => 'Tugriks', + 'MOP' => 'Patacas', + 'MRO' => 'Ouguiyas', + 'MTL' => 'Liri', + 'MUR' => 'Rupees', + 'MVR' => 'Rufiyaa', + 'MWK' => 'Kwachas', + 'MXN' => 'Pesos', + 'MYR' => 'Ringgits', + 'MZM' => 'Meticais', + 'NAD' => 'Dollars', + 'NGN' => 'Nairas', + 'NIO' => 'Gold Cordobas', + 'NLG' => 'Guilders', + 'NOK' => 'Krone', + 'NPR' => 'Nepal Rupees', + 'NZD' => 'Dollars', + 'OMR' => 'Rials', + 'PAB' => 'Balboa', + 'PEN' => 'Nuevos Soles', + 'PGK' => 'Kina', + 'PHP' => 'Pesos', + 'PKR' => 'Rupees', + 'PLN' => 'Zlotych', + 'PTE' => 'Escudos', + 'PYG' => 'Guarani', + 'QAR' => 'Rials', + 'ROL' => 'Lei', + 'RUR' => 'Rubles', + 'RWF' => 'Rwanda Francs', + 'SAR' => 'Riyals', + 'SBD' => 'Dollars', + 'SCR' => 'Rupees', + 'SDD' => 'Dinars', + 'SEK' => 'Kronor', + 'SGD' => 'Dollars', + 'SHP' => 'Pounds', + 'SIT' => 'Tolars', + 'SKK' => 'Koruny', + 'SLL' => 'Leones', + 'SOS' => 'Shillings', + 'SPL' => 'Luigini', + 'SRG' => 'Guilders', + 'STD' => 'Dobras', + 'SVC' => 'Colones', + 'SYP' => 'Pounds', + 'SZL' => 'Emalangeni', + 'THB' => 'Baht', + 'TJR' => 'Rubles', + 'TMM' => 'Manats', + 'TND' => 'Dinars', + 'TOP' => 'Pa\'anga', + 'TRL' => 'Liras', + 'TTD' => 'Dollars', + 'TVD' => 'Tuvalu Dollars', + 'TWD' => 'New Dollars', + 'TZS' => 'Shillings', + 'UAH' => 'Hryvnia', + 'UGX' => 'Shillings', + 'USD' => 'Dollars', + 'UYU' => 'Pesos', + 'UZS' => 'Sums', + 'VAL' => 'Lire', + 'VEB' => 'Bolivares', + 'VND' => 'Dong', + 'VUV' => 'Vatu', + 'WST' => 'Tala', + 'XAF' => 'Francs', + 'XAG' => 'Ounces', + 'XAU' => 'Ounces', + 'XCD' => 'Dollars', + 'XDR' => 'Special Drawing Rights', + 'XPD' => 'Ounces', + 'XPF' => 'Francs', + 'XPT' => 'Ounces', + 'YER' => 'Rials', + 'YUM' => 'New Dinars', + 'ZAR' => 'Rand', + 'ZMK' => 'Kwacha', + 'ZWD' => 'Zimbabwe Dollars' + ); + + return @$lookup[$currency_id]; + } + + + + public static function LookupCurrencyCountry($currency_id) { + + static $lookup = array ( + 'AED' => 'United Arab Emirates', + 'AFA' => 'Afghanistan', + 'ALL' => 'Albania', + 'AMD' => 'Armenia', + 'ANG' => 'Netherlands Antilles', + 'AOA' => 'Angola', + 'ARS' => 'Argentina', + 'ATS' => 'Austria', + 'AUD' => 'Australia', + 'AWG' => 'Aruba', + 'AZM' => 'Azerbaijan', + 'BAM' => 'Bosnia and Herzegovina', + 'BBD' => 'Barbados', + 'BDT' => 'Bangladesh', + 'BEF' => 'Belgium', + 'BGL' => 'Bulgaria', + 'BHD' => 'Bahrain', + 'BIF' => 'Burundi', + 'BMD' => 'Bermuda', + 'BND' => 'Brunei Darussalam', + 'BOB' => 'Bolivia', + 'BRL' => 'Brazil', + 'BSD' => 'Bahamas', + 'BTN' => 'Bhutan', + 'BWP' => 'Botswana', + 'BYR' => 'Belarus', + 'BZD' => 'Belize', + 'CAD' => 'Canada', + 'CDF' => 'Congo/Kinshasa', + 'CHF' => 'Switzerland', + 'CLP' => 'Chile', + 'CNY' => 'China', + 'COP' => 'Colombia', + 'CRC' => 'Costa Rica', + 'CUP' => 'Cuba', + 'CVE' => 'Cape Verde', + 'CYP' => 'Cyprus', + 'CZK' => 'Czech Republic', + 'DEM' => 'Germany', + 'DJF' => 'Djibouti', + 'DKK' => 'Denmark', + 'DOP' => 'Dominican Republic', + 'DZD' => 'Algeria', + 'EEK' => 'Estonia', + 'EGP' => 'Egypt', + 'ERN' => 'Eritrea', + 'ESP' => 'Spain', + 'ETB' => 'Ethiopia', + 'EUR' => 'Euro Member Countries', + 'FIM' => 'Finland', + 'FJD' => 'Fiji', + 'FKP' => 'Falkland Islands (Malvinas)', + 'FRF' => 'France', + 'GBP' => 'United Kingdom', + 'GEL' => 'Georgia', + 'GGP' => 'Guernsey', + 'GHC' => 'Ghana', + 'GIP' => 'Gibraltar', + 'GMD' => 'Gambia', + 'GNF' => 'Guinea', + 'GRD' => 'Greece', + 'GTQ' => 'Guatemala', + 'GYD' => 'Guyana', + 'HKD' => 'Hong Kong', + 'HNL' => 'Honduras', + 'HRK' => 'Croatia', + 'HTG' => 'Haiti', + 'HUF' => 'Hungary', + 'IDR' => 'Indonesia', + 'IEP' => 'Ireland (Eire)', + 'ILS' => 'Israel', + 'IMP' => 'Isle of Man', + 'INR' => 'India', + 'IQD' => 'Iraq', + 'IRR' => 'Iran', + 'ISK' => 'Iceland', + 'ITL' => 'Italy', + 'JEP' => 'Jersey', + 'JMD' => 'Jamaica', + 'JOD' => 'Jordan', + 'JPY' => 'Japan', + 'KES' => 'Kenya', + 'KGS' => 'Kyrgyzstan', + 'KHR' => 'Cambodia', + 'KMF' => 'Comoros', + 'KPW' => 'Korea', + 'KWD' => 'Kuwait', + 'KYD' => 'Cayman Islands', + 'KZT' => 'Kazakstan', + 'LAK' => 'Laos', + 'LBP' => 'Lebanon', + 'LKR' => 'Sri Lanka', + 'LRD' => 'Liberia', + 'LSL' => 'Lesotho', + 'LTL' => 'Lithuania', + 'LUF' => 'Luxembourg', + 'LVL' => 'Latvia', + 'LYD' => 'Libya', + 'MAD' => 'Morocco', + 'MDL' => 'Moldova', + 'MGF' => 'Madagascar', + 'MKD' => 'Macedonia', + 'MMK' => 'Myanmar (Burma)', + 'MNT' => 'Mongolia', + 'MOP' => 'Macau', + 'MRO' => 'Mauritania', + 'MTL' => 'Malta', + 'MUR' => 'Mauritius', + 'MVR' => 'Maldives (Maldive Islands)', + 'MWK' => 'Malawi', + 'MXN' => 'Mexico', + 'MYR' => 'Malaysia', + 'MZM' => 'Mozambique', + 'NAD' => 'Namibia', + 'NGN' => 'Nigeria', + 'NIO' => 'Nicaragua', + 'NLG' => 'Netherlands (Holland)', + 'NOK' => 'Norway', + 'NPR' => 'Nepal', + 'NZD' => 'New Zealand', + 'OMR' => 'Oman', + 'PAB' => 'Panama', + 'PEN' => 'Peru', + 'PGK' => 'Papua New Guinea', + 'PHP' => 'Philippines', + 'PKR' => 'Pakistan', + 'PLN' => 'Poland', + 'PTE' => 'Portugal', + 'PYG' => 'Paraguay', + 'QAR' => 'Qatar', + 'ROL' => 'Romania', + 'RUR' => 'Russia', + 'RWF' => 'Rwanda', + 'SAR' => 'Saudi Arabia', + 'SBD' => 'Solomon Islands', + 'SCR' => 'Seychelles', + 'SDD' => 'Sudan', + 'SEK' => 'Sweden', + 'SGD' => 'Singapore', + 'SHP' => 'Saint Helena', + 'SIT' => 'Slovenia', + 'SKK' => 'Slovakia', + 'SLL' => 'Sierra Leone', + 'SOS' => 'Somalia', + 'SPL' => 'Seborga', + 'SRG' => 'Suriname', + 'STD' => 'São Tome and Principe', + 'SVC' => 'El Salvador', + 'SYP' => 'Syria', + 'SZL' => 'Swaziland', + 'THB' => 'Thailand', + 'TJR' => 'Tajikistan', + 'TMM' => 'Turkmenistan', + 'TND' => 'Tunisia', + 'TOP' => 'Tonga', + 'TRL' => 'Turkey', + 'TTD' => 'Trinidad and Tobago', + 'TVD' => 'Tuvalu', + 'TWD' => 'Taiwan', + 'TZS' => 'Tanzania', + 'UAH' => 'Ukraine', + 'UGX' => 'Uganda', + 'USD' => 'United States of America', + 'UYU' => 'Uruguay', + 'UZS' => 'Uzbekistan', + 'VAL' => 'Vatican City', + 'VEB' => 'Venezuela', + 'VND' => 'Viet Nam', + 'VUV' => 'Vanuatu', + 'WST' => 'Samoa', + 'XAF' => 'Communauté Financière Africaine', + 'XAG' => 'Silver', + 'XAU' => 'Gold', + 'XCD' => 'East Caribbean', + 'XDR' => 'International Monetary Fund', + 'XPD' => 'Palladium', + 'XPF' => 'Comptoirs Français du Pacifique', + 'XPT' => 'Platinum', + 'YER' => 'Yemen', + 'YUM' => 'Yugoslavia', + 'ZAR' => 'South Africa', + 'ZMK' => 'Zambia', + 'ZWD' => 'Zimbabwe' + ); + + return @$lookup[$currency_id]; + } + + + + public static function LanguageLookup($language_code, $case_sensitive=false) { + + if (!$case_sensitive) { + $language_code = strtolower($language_code); + } + + // http://www.id3.org/id3v2.4.0-structure.txt + // [4. ID3v2 frame overview] + // The three byte language field, present in several frames, is used to + // describe the language of the frame's content, according to ISO-639-2 + // [ISO-639-2]. The language should be represented in lower case. If the + // language is not known the string "XXX" should be used. + + + // ISO 639-2 - http://www.id3.org/iso639-2.html + + static $lookup = array ( + 'XXX' => 'unknown', + 'xxx' => 'unknown', + 'aar' => 'Afar', + 'abk' => 'Abkhazian', + 'ace' => 'Achinese', + 'ach' => 'Acoli', + 'ada' => 'Adangme', + 'afa' => 'Afro-Asiatic (Other)', + 'afh' => 'Afrihili', + 'afr' => 'Afrikaans', + 'aka' => 'Akan', + 'akk' => 'Akkadian', + 'alb' => 'Albanian', + 'ale' => 'Aleut', + 'alg' => 'Algonquian Languages', + 'amh' => 'Amharic', + 'ang' => 'English, Old (ca. 450-1100)', + 'apa' => 'Apache Languages', + 'ara' => 'Arabic', + 'arc' => 'Aramaic', + 'arm' => 'Armenian', + 'arn' => 'Araucanian', + 'arp' => 'Arapaho', + 'art' => 'Artificial (Other)', + 'arw' => 'Arawak', + 'asm' => 'Assamese', + 'ath' => 'Athapascan Languages', + 'ava' => 'Avaric', + 'ave' => 'Avestan', + 'awa' => 'Awadhi', + 'aym' => 'Aymara', + 'aze' => 'Azerbaijani', + 'bad' => 'Banda', + 'bai' => 'Bamileke Languages', + 'bak' => 'Bashkir', + 'bal' => 'Baluchi', + 'bam' => 'Bambara', + 'ban' => 'Balinese', + 'baq' => 'Basque', + 'bas' => 'Basa', + 'bat' => 'Baltic (Other)', + 'bej' => 'Beja', + 'bel' => 'Byelorussian', + 'bem' => 'Bemba', + 'ben' => 'Bengali', + 'ber' => 'Berber (Other)', + 'bho' => 'Bhojpuri', + 'bih' => 'Bihari', + 'bik' => 'Bikol', + 'bin' => 'Bini', + 'bis' => 'Bislama', + 'bla' => 'Siksika', + 'bnt' => 'Bantu (Other)', + 'bod' => 'Tibetan', + 'bra' => 'Braj', + 'bre' => 'Breton', + 'bua' => 'Buriat', + 'bug' => 'Buginese', + 'bul' => 'Bulgarian', + 'bur' => 'Burmese', + 'cad' => 'Caddo', + 'cai' => 'Central American Indian (Other)', + 'car' => 'Carib', + 'cat' => 'Catalan', + 'cau' => 'Caucasian (Other)', + 'ceb' => 'Cebuano', + 'cel' => 'Celtic (Other)', + 'ces' => 'Czech', + 'cha' => 'Chamorro', + 'chb' => 'Chibcha', + 'che' => 'Chechen', + 'chg' => 'Chagatai', + 'chi' => 'Chinese', + 'chm' => 'Mari', + 'chn' => 'Chinook jargon', + 'cho' => 'Choctaw', + 'chr' => 'Cherokee', + 'chu' => 'Church Slavic', + 'chv' => 'Chuvash', + 'chy' => 'Cheyenne', + 'cop' => 'Coptic', + 'cor' => 'Cornish', + 'cos' => 'Corsican', + 'cpe' => 'Creoles and Pidgins, English-based (Other)', + 'cpf' => 'Creoles and Pidgins, French-based (Other)', + 'cpp' => 'Creoles and Pidgins, Portuguese-based (Other)', + 'cre' => 'Cree', + 'crp' => 'Creoles and Pidgins (Other)', + 'cus' => 'Cushitic (Other)', + 'cym' => 'Welsh', + 'cze' => 'Czech', + 'dak' => 'Dakota', + 'dan' => 'Danish', + 'del' => 'Delaware', + 'deu' => 'German', + 'din' => 'Dinka', + 'div' => 'Divehi', + 'doi' => 'Dogri', + 'dra' => 'Dravidian (Other)', + 'dua' => 'Duala', + 'dum' => 'Dutch, Middle (ca. 1050-1350)', + 'dut' => 'Dutch', + 'dyu' => 'Dyula', + 'dzo' => 'Dzongkha', + 'efi' => 'Efik', + 'egy' => 'Egyptian (Ancient)', + 'eka' => 'Ekajuk', + 'ell' => 'Greek, Modern (1453-)', + 'elx' => 'Elamite', + 'eng' => 'English', + 'enm' => 'English, Middle (ca. 1100-1500)', + 'epo' => 'Esperanto', + 'esk' => 'Eskimo (Other)', + 'esl' => 'Spanish', + 'est' => 'Estonian', + 'eus' => 'Basque', + 'ewe' => 'Ewe', + 'ewo' => 'Ewondo', + 'fan' => 'Fang', + 'fao' => 'Faroese', + 'fas' => 'Persian', + 'fat' => 'Fanti', + 'fij' => 'Fijian', + 'fin' => 'Finnish', + 'fiu' => 'Finno-Ugrian (Other)', + 'fon' => 'Fon', + 'fra' => 'French', + 'fre' => 'French', + 'frm' => 'French, Middle (ca. 1400-1600)', + 'fro' => 'French, Old (842- ca. 1400)', + 'fry' => 'Frisian', + 'ful' => 'Fulah', + 'gaa' => 'Ga', + 'gae' => 'Gaelic (Scots)', + 'gai' => 'Irish', + 'gay' => 'Gayo', + 'gdh' => 'Gaelic (Scots)', + 'gem' => 'Germanic (Other)', + 'geo' => 'Georgian', + 'ger' => 'German', + 'gez' => 'Geez', + 'gil' => 'Gilbertese', + 'glg' => 'Gallegan', + 'gmh' => 'German, Middle High (ca. 1050-1500)', + 'goh' => 'German, Old High (ca. 750-1050)', + 'gon' => 'Gondi', + 'got' => 'Gothic', + 'grb' => 'Grebo', + 'grc' => 'Greek, Ancient (to 1453)', + 'gre' => 'Greek, Modern (1453-)', + 'grn' => 'Guarani', + 'guj' => 'Gujarati', + 'hai' => 'Haida', + 'hau' => 'Hausa', + 'haw' => 'Hawaiian', + 'heb' => 'Hebrew', + 'her' => 'Herero', + 'hil' => 'Hiligaynon', + 'him' => 'Himachali', + 'hin' => 'Hindi', + 'hmo' => 'Hiri Motu', + 'hun' => 'Hungarian', + 'hup' => 'Hupa', + 'hye' => 'Armenian', + 'iba' => 'Iban', + 'ibo' => 'Igbo', + 'ice' => 'Icelandic', + 'ijo' => 'Ijo', + 'iku' => 'Inuktitut', + 'ilo' => 'Iloko', + 'ina' => 'Interlingua (International Auxiliary language Association)', + 'inc' => 'Indic (Other)', + 'ind' => 'Indonesian', + 'ine' => 'Indo-European (Other)', + 'ine' => 'Interlingue', + 'ipk' => 'Inupiak', + 'ira' => 'Iranian (Other)', + 'iri' => 'Irish', + 'iro' => 'Iroquoian uages', + 'isl' => 'Icelandic', + 'ita' => 'Italian', + 'jav' => 'Javanese', + 'jaw' => 'Javanese', + 'jpn' => 'Japanese', + 'jpr' => 'Judeo-Persian', + 'jrb' => 'Judeo-Arabic', + 'kaa' => 'Kara-Kalpak', + 'kab' => 'Kabyle', + 'kac' => 'Kachin', + 'kal' => 'Greenlandic', + 'kam' => 'Kamba', + 'kan' => 'Kannada', + 'kar' => 'Karen', + 'kas' => 'Kashmiri', + 'kat' => 'Georgian', + 'kau' => 'Kanuri', + 'kaw' => 'Kawi', + 'kaz' => 'Kazakh', + 'kha' => 'Khasi', + 'khi' => 'Khoisan (Other)', + 'khm' => 'Khmer', + 'kho' => 'Khotanese', + 'kik' => 'Kikuyu', + 'kin' => 'Kinyarwanda', + 'kir' => 'Kirghiz', + 'kok' => 'Konkani', + 'kom' => 'Komi', + 'kon' => 'Kongo', + 'kor' => 'Korean', + 'kpe' => 'Kpelle', + 'kro' => 'Kru', + 'kru' => 'Kurukh', + 'kua' => 'Kuanyama', + 'kum' => 'Kumyk', + 'kur' => 'Kurdish', + 'kus' => 'Kusaie', + 'kut' => 'Kutenai', + 'lad' => 'Ladino', + 'lah' => 'Lahnda', + 'lam' => 'Lamba', + 'lao' => 'Lao', + 'lat' => 'Latin', + 'lav' => 'Latvian', + 'lez' => 'Lezghian', + 'lin' => 'Lingala', + 'lit' => 'Lithuanian', + 'lol' => 'Mongo', + 'loz' => 'Lozi', + 'ltz' => 'Letzeburgesch', + 'lub' => 'Luba-Katanga', + 'lug' => 'Ganda', + 'lui' => 'Luiseno', + 'lun' => 'Lunda', + 'luo' => 'Luo (Kenya and Tanzania)', + 'mac' => 'Macedonian', + 'mad' => 'Madurese', + 'mag' => 'Magahi', + 'mah' => 'Marshall', + 'mai' => 'Maithili', + 'mak' => 'Macedonian', + 'mak' => 'Makasar', + 'mal' => 'Malayalam', + 'man' => 'Mandingo', + 'mao' => 'Maori', + 'map' => 'Austronesian (Other)', + 'mar' => 'Marathi', + 'mas' => 'Masai', + 'max' => 'Manx', + 'may' => 'Malay', + 'men' => 'Mende', + 'mga' => 'Irish, Middle (900 - 1200)', + 'mic' => 'Micmac', + 'min' => 'Minangkabau', + 'mis' => 'Miscellaneous (Other)', + 'mkh' => 'Mon-Kmer (Other)', + 'mlg' => 'Malagasy', + 'mlt' => 'Maltese', + 'mni' => 'Manipuri', + 'mno' => 'Manobo Languages', + 'moh' => 'Mohawk', + 'mol' => 'Moldavian', + 'mon' => 'Mongolian', + 'mos' => 'Mossi', + 'mri' => 'Maori', + 'msa' => 'Malay', + 'mul' => 'Multiple Languages', + 'mun' => 'Munda Languages', + 'mus' => 'Creek', + 'mwr' => 'Marwari', + 'mya' => 'Burmese', + 'myn' => 'Mayan Languages', + 'nah' => 'Aztec', + 'nai' => 'North American Indian (Other)', + 'nau' => 'Nauru', + 'nav' => 'Navajo', + 'nbl' => 'Ndebele, South', + 'nde' => 'Ndebele, North', + 'ndo' => 'Ndongo', + 'nep' => 'Nepali', + 'new' => 'Newari', + 'nic' => 'Niger-Kordofanian (Other)', + 'niu' => 'Niuean', + 'nla' => 'Dutch', + 'nno' => 'Norwegian (Nynorsk)', + 'non' => 'Norse, Old', + 'nor' => 'Norwegian', + 'nso' => 'Sotho, Northern', + 'nub' => 'Nubian Languages', + 'nya' => 'Nyanja', + 'nym' => 'Nyamwezi', + 'nyn' => 'Nyankole', + 'nyo' => 'Nyoro', + 'nzi' => 'Nzima', + 'oci' => 'Langue d\'Oc (post 1500)', + 'oji' => 'Ojibwa', + 'ori' => 'Oriya', + 'orm' => 'Oromo', + 'osa' => 'Osage', + 'oss' => 'Ossetic', + 'ota' => 'Turkish, Ottoman (1500 - 1928)', + 'oto' => 'Otomian Languages', + 'paa' => 'Papuan-Australian (Other)', + 'pag' => 'Pangasinan', + 'pal' => 'Pahlavi', + 'pam' => 'Pampanga', + 'pan' => 'Panjabi', + 'pap' => 'Papiamento', + 'pau' => 'Palauan', + 'peo' => 'Persian, Old (ca 600 - 400 B.C.)', + 'per' => 'Persian', + 'phn' => 'Phoenician', + 'pli' => 'Pali', + 'pol' => 'Polish', + 'pon' => 'Ponape', + 'por' => 'Portuguese', + 'pra' => 'Prakrit uages', + 'pro' => 'Provencal, Old (to 1500)', + 'pus' => 'Pushto', + 'que' => 'Quechua', + 'raj' => 'Rajasthani', + 'rar' => 'Rarotongan', + 'roa' => 'Romance (Other)', + 'roh' => 'Rhaeto-Romance', + 'rom' => 'Romany', + 'ron' => 'Romanian', + 'rum' => 'Romanian', + 'run' => 'Rundi', + 'rus' => 'Russian', + 'sad' => 'Sandawe', + 'sag' => 'Sango', + 'sah' => 'Yakut', + 'sai' => 'South American Indian (Other)', + 'sal' => 'Salishan Languages', + 'sam' => 'Samaritan Aramaic', + 'san' => 'Sanskrit', + 'sco' => 'Scots', + 'scr' => 'Serbo-Croatian', + 'sel' => 'Selkup', + 'sem' => 'Semitic (Other)', + 'sga' => 'Irish, Old (to 900)', + 'shn' => 'Shan', + 'sid' => 'Sidamo', + 'sin' => 'Singhalese', + 'sio' => 'Siouan Languages', + 'sit' => 'Sino-Tibetan (Other)', + 'sla' => 'Slavic (Other)', + 'slk' => 'Slovak', + 'slo' => 'Slovak', + 'slv' => 'Slovenian', + 'smi' => 'Sami Languages', + 'smo' => 'Samoan', + 'sna' => 'Shona', + 'snd' => 'Sindhi', + 'sog' => 'Sogdian', + 'som' => 'Somali', + 'son' => 'Songhai', + 'sot' => 'Sotho, Southern', + 'spa' => 'Spanish', + 'sqi' => 'Albanian', + 'srd' => 'Sardinian', + 'srr' => 'Serer', + 'ssa' => 'Nilo-Saharan (Other)', + 'ssw' => 'Siswant', + 'ssw' => 'Swazi', + 'suk' => 'Sukuma', + 'sun' => 'Sudanese', + 'sus' => 'Susu', + 'sux' => 'Sumerian', + 'sve' => 'Swedish', + 'swa' => 'Swahili', + 'swe' => 'Swedish', + 'syr' => 'Syriac', + 'tah' => 'Tahitian', + 'tam' => 'Tamil', + 'tat' => 'Tatar', + 'tel' => 'Telugu', + 'tem' => 'Timne', + 'ter' => 'Tereno', + 'tgk' => 'Tajik', + 'tgl' => 'Tagalog', + 'tha' => 'Thai', + 'tib' => 'Tibetan', + 'tig' => 'Tigre', + 'tir' => 'Tigrinya', + 'tiv' => 'Tivi', + 'tli' => 'Tlingit', + 'tmh' => 'Tamashek', + 'tog' => 'Tonga (Nyasa)', + 'ton' => 'Tonga (Tonga Islands)', + 'tru' => 'Truk', + 'tsi' => 'Tsimshian', + 'tsn' => 'Tswana', + 'tso' => 'Tsonga', + 'tuk' => 'Turkmen', + 'tum' => 'Tumbuka', + 'tur' => 'Turkish', + 'tut' => 'Altaic (Other)', + 'twi' => 'Twi', + 'tyv' => 'Tuvinian', + 'uga' => 'Ugaritic', + 'uig' => 'Uighur', + 'ukr' => 'Ukrainian', + 'umb' => 'Umbundu', + 'und' => 'Undetermined', + 'urd' => 'Urdu', + 'uzb' => 'Uzbek', + 'vai' => 'Vai', + 'ven' => 'Venda', + 'vie' => 'Vietnamese', + 'vol' => 'Volapük', + 'vot' => 'Votic', + 'wak' => 'Wakashan Languages', + 'wal' => 'Walamo', + 'war' => 'Waray', + 'was' => 'Washo', + 'wel' => 'Welsh', + 'wen' => 'Sorbian Languages', + 'wol' => 'Wolof', + 'xho' => 'Xhosa', + 'yao' => 'Yao', + 'yap' => 'Yap', + 'yid' => 'Yiddish', + 'yor' => 'Yoruba', + 'zap' => 'Zapotec', + 'zen' => 'Zenaga', + 'zha' => 'Zhuang', + 'zho' => 'Chinese', + 'zul' => 'Zulu', + 'zun' => 'Zuni' + ); + + return @$lookup[$language_code]; + } + + + + public static function ETCOEventLookup($index) { + + if (($index >= 0x17) && ($index <= 0xDF)) { + return 'reserved for future use'; + } + if (($index >= 0xE0) && ($index <= 0xEF)) { + return 'not predefined synch 0-F'; + } + if (($index >= 0xF0) && ($index <= 0xFC)) { + return 'reserved for future use'; + } + + static $lookup = array ( + 0x00 => 'padding (has no meaning)', + 0x01 => 'end of initial silence', + 0x02 => 'intro start', + 0x03 => 'main part start', + 0x04 => 'outro start', + 0x05 => 'outro end', + 0x06 => 'verse start', + 0x07 => 'refrain start', + 0x08 => 'interlude start', + 0x09 => 'theme start', + 0x0A => 'variation start', + 0x0B => 'key change', + 0x0C => 'time change', + 0x0D => 'momentary unwanted noise (Snap, Crackle & Pop)', + 0x0E => 'sustained noise', + 0x0F => 'sustained noise end', + 0x10 => 'intro end', + 0x11 => 'main part end', + 0x12 => 'verse end', + 0x13 => 'refrain end', + 0x14 => 'theme end', + 0x15 => 'profanity', + 0x16 => 'profanity end', + 0xFD => 'audio end (start of silence)', + 0xFE => 'audio file ends', + 0xFF => 'one more byte of events follows' + ); + + return @$lookup[$index]; + } + + + + public static function SYTLContentTypeLookup($index) { + + static $lookup = array ( + 0x00 => 'other', + 0x01 => 'lyrics', + 0x02 => 'text transcription', + 0x03 => 'movement/part name', // (e.g. 'Adagio') + 0x04 => 'events', // (e.g. 'Don Quijote enters the stage') + 0x05 => 'chord', // (e.g. 'Bb F Fsus') + 0x06 => 'trivia/\'pop up\' information', + 0x07 => 'URLs to webpages', + 0x08 => 'URLs to images' + ); + + return @$lookup[$index]; + } + + + + public static function APICPictureTypeLookup($index, $return_array=false) { + + static $lookup = array ( + 0x00 => 'Other', + 0x01 => '32x32 pixels \'file icon\' (PNG only)', + 0x02 => 'Other file icon', + 0x03 => 'Cover (front)', + 0x04 => 'Cover (back)', + 0x05 => 'Leaflet page', + 0x06 => 'Media (e.g. label side of CD)', + 0x07 => 'Lead artist/lead performer/soloist', + 0x08 => 'Artist/performer', + 0x09 => 'Conductor', + 0x0A => 'Band/Orchestra', + 0x0B => 'Composer', + 0x0C => 'Lyricist/text writer', + 0x0D => 'Recording Location', + 0x0E => 'During recording', + 0x0F => 'During performance', + 0x10 => 'Movie/video screen capture', + 0x11 => 'A bright coloured fish', + 0x12 => 'Illustration', + 0x13 => 'Band/artist logotype', + 0x14 => 'Publisher/Studio logotype' + ); + + if ($return_array) { + return $lookup; + } + return @$lookup[$index]; + } + + + + public static function COMRReceivedAsLookup($index) { + + static $lookup = array ( + 0x00 => 'Other', + 0x01 => 'Standard CD album with other songs', + 0x02 => 'Compressed audio on CD', + 0x03 => 'File over the Internet', + 0x04 => 'Stream over the Internet', + 0x05 => 'As note sheets', + 0x06 => 'As note sheets in a book with other sheets', + 0x07 => 'Music on other media', + 0x08 => 'Non-musical merchandise' + ); + + return (isset($lookup[$index]) ? $lookup[$index] : ''); + } + + + + public static function RVA2ChannelTypeLookup($index) { + + static $lookup = array ( + 0x00 => 'Other', + 0x01 => 'Master volume', + 0x02 => 'Front right', + 0x03 => 'Front left', + 0x04 => 'Back right', + 0x05 => 'Back left', + 0x06 => 'Front centre', + 0x07 => 'Back centre', + 0x08 => 'Subwoofer' + ); + + return @$lookup[$index]; + } + + + + public static function FrameNameLongLookup($frame_name) { + + static $lookup = array ( + 'AENC' => 'Audio encryption', + 'APIC' => 'Attached picture', + 'ASPI' => 'Audio seek point index', + 'BUF' => 'Recommended buffer size', + 'CNT' => 'Play counter', + 'COM' => 'Comments', + 'COMM' => 'Comments', + 'COMR' => 'Commercial frame', + 'CRA' => 'Audio encryption', + 'CRM' => 'Encrypted meta frame', + 'ENCR' => 'Encryption method registration', + 'EQU' => 'Equalisation', + 'EQU2' => 'Equalisation (2)', + 'EQUA' => 'Equalisation', + 'ETC' => 'Event timing codes', + 'ETCO' => 'Event timing codes', + 'GEO' => 'General encapsulated object', + 'GEOB' => 'General encapsulated object', + 'GRID' => 'Group identification registration', + 'IPL' => 'Involved people list', + 'IPLS' => 'Involved people list', + 'LINK' => 'Linked information', + 'LNK' => 'Linked information', + 'MCDI' => 'Music CD identifier', + 'MCI' => 'Music CD Identifier', + 'MLL' => 'MPEG location lookup table', + 'MLLT' => 'MPEG location lookup table', + 'OWNE' => 'Ownership frame', + 'PCNT' => 'Play counter', + 'PIC' => 'Attached picture', + 'POP' => 'Popularimeter', + 'POPM' => 'Popularimeter', + 'POSS' => 'Position synchronisation frame', + 'PRIV' => 'Private frame', + 'RBUF' => 'Recommended buffer size', + 'REV' => 'Reverb', + 'RVA' => 'Relative volume adjustment', + 'RVA2' => 'Relative volume adjustment (2)', + 'RVAD' => 'Relative volume adjustment', + 'RVRB' => 'Reverb', + 'SEEK' => 'Seek frame', + 'SIGN' => 'Signature frame', + 'SLT' => 'Synchronised lyric/text', + 'STC' => 'Synced tempo codes', + 'SYLT' => 'Synchronised lyric/text', + 'SYTC' => 'Synchronised tempo codes', + 'TAL' => 'Album/Movie/Show title', + 'TALB' => 'Album/Movie/Show title', + 'TBP' => 'BPM (Beats Per Minute)', + 'TBPM' => 'BPM (beats per minute)', + 'TCM' => 'Composer', + 'TCO' => 'Content type', + 'TCOM' => 'Composer', + 'TCON' => 'Content type', + 'TCOP' => 'Copyright message', + 'TCR' => 'Copyright message', + 'TDA' => 'Date', + 'TDAT' => 'Date', + 'TDEN' => 'Encoding time', + 'TDLY' => 'Playlist delay', + 'TDOR' => 'Original release time', + 'TDRC' => 'Recording time', + 'TDRL' => 'Release time', + 'TDTG' => 'Tagging time', + 'TDY' => 'Playlist delay', + 'TEN' => 'Encoded by', + 'TENC' => 'Encoded by', + 'TEXT' => 'Lyricist/Text writer', + 'TFLT' => 'File type', + 'TFT' => 'File type', + 'TIM' => 'Time', + 'TIME' => 'Time', + 'TIPL' => 'Involved people list', + 'TIT1' => 'Content group description', + 'TIT2' => 'Title/songname/content description', + 'TIT3' => 'Subtitle/Description refinement', + 'TKE' => 'Initial key', + 'TKEY' => 'Initial key', + 'TLA' => 'Language(s)', + 'TLAN' => 'Language(s)', + 'TLE' => 'Length', + 'TLEN' => 'Length', + 'TMCL' => 'Musician credits list', + 'TMED' => 'Media type', + 'TMOO' => 'Mood', + 'TMT' => 'Media type', + 'TOA' => 'Original artist(s)/performer(s)', + 'TOAL' => 'Original album/movie/show title', + 'TOF' => 'Original filename', + 'TOFN' => 'Original filename', + 'TOL' => 'Original Lyricist(s)/text writer(s)', + 'TOLY' => 'Original lyricist(s)/text writer(s)', + 'TOPE' => 'Original artist(s)/performer(s)', + 'TOR' => 'Original release year', + 'TORY' => 'Original release year', + 'TOT' => 'Original album/Movie/Show title', + 'TOWN' => 'File owner/licensee', + 'TP1' => 'Lead artist(s)/Lead performer(s)/Soloist(s)/Performing group', + 'TP2' => 'Band/Orchestra/Accompaniment', + 'TP3' => 'Conductor/Performer refinement', + 'TP4' => 'Interpreted, remixed, or otherwise modified by', + 'TPA' => 'Part of a set', + 'TPB' => 'Publisher', + 'TPE1' => 'Lead performer(s)/Soloist(s)', + 'TPE2' => 'Band/orchestra/accompaniment', + 'TPE3' => 'Conductor/performer refinement', + 'TPE4' => 'Interpreted, remixed, or otherwise modified by', + 'TPOS' => 'Part of a set', + 'TPRO' => 'Produced notice', + 'TPUB' => 'Publisher', + 'TRC' => 'ISRC (International Standard Recording Code)', + 'TRCK' => 'Track number/Position in set', + 'TRD' => 'Recording dates', + 'TRDA' => 'Recording dates', + 'TRK' => 'Track number/Position in set', + 'TRSN' => 'Internet radio station name', + 'TRSO' => 'Internet radio station owner', + 'TSI' => 'Size', + 'TSIZ' => 'Size', + 'TSOA' => 'Album sort order', + 'TSOP' => 'Performer sort order', + 'TSOT' => 'Title sort order', + 'TSRC' => 'ISRC (international standard recording code)', + 'TSS' => 'Software/hardware and settings used for encoding', + 'TSSE' => 'Software/Hardware and settings used for encoding', + 'TSST' => 'Set subtitle', + 'TT1' => 'Content group description', + 'TT2' => 'Title/Songname/Content description', + 'TT3' => 'Subtitle/Description refinement', + 'TXT' => 'Lyricist/text writer', + 'TXX' => 'User defined text information frame', + 'TXXX' => 'User defined text information frame', + 'TYE' => 'Year', + 'TYER' => 'Year', + 'UFI' => 'Unique file identifier', + 'UFID' => 'Unique file identifier', + 'ULT' => 'Unsychronised lyric/text transcription', + 'USER' => 'Terms of use', + 'USLT' => 'Unsynchronised lyric/text transcription', + 'WAF' => 'Official audio file webpage', + 'WAR' => 'Official artist/performer webpage', + 'WAS' => 'Official audio source webpage', + 'WCM' => 'Commercial information', + 'WCOM' => 'Commercial information', + 'WCOP' => 'Copyright/Legal information', + 'WCP' => 'Copyright/Legal information', + 'WOAF' => 'Official audio file webpage', + 'WOAR' => 'Official artist/performer webpage', + 'WOAS' => 'Official audio source webpage', + 'WORS' => 'Official Internet radio station homepage', + 'WPAY' => 'Payment', + 'WPB' => 'Publishers official webpage', + 'WPUB' => 'Publishers official webpage', + 'WXX' => 'User defined URL link frame', + 'WXXX' => 'User defined URL link frame', + 'TFEA' => 'Featured Artist', + 'TSTU' => 'Recording Studio', + 'rgad' => 'Replay Gain Adjustment' + ); + + return @$lookup[$frame_name]; + + // Last three: + // from Helium2 [www.helium2.com] + // from http://privatewww.essex.ac.uk/~djmrob/replaygain/file_format_id3v2.html + } + + + public static function FrameNameShortLookup($frame_name) { + + static $lookup = array ( + 'COM' => 'comment', + 'COMM' => 'comment', + 'TAL' => 'album', + 'TALB' => 'album', + 'TBP' => 'bpm', + 'TBPM' => 'bpm', + 'TCM' => 'composer', + 'TCO' => 'genre', + 'TCOM' => 'composer', + 'TCON' => 'genre', + 'TCOP' => 'copyright', + 'TCR' => 'copyright', + 'TEN' => 'encoded_by', + 'TENC' => 'encoded_by', + 'TEXT' => 'lyricist', + 'TIT1' => 'description', + 'TIT2' => 'title', + 'TIT3' => 'subtitle', + 'TLA' => 'language', + 'TLAN' => 'language', + 'TLE' => 'length', + 'TLEN' => 'length', + 'TMOO' => 'mood', + 'TOA' => 'original_artist', + 'TOAL' => 'original_album', + 'TOF' => 'original_filename', + 'TOFN' => 'original_filename', + 'TOL' => 'original_lyricist', + 'TOLY' => 'original_lyricist', + 'TOPE' => 'original_artist', + 'TOT' => 'original_album', + 'TP1' => 'artist', + 'TP2' => 'band', + 'TP3' => 'conductor', + 'TP4' => 'remixer', + 'TPB' => 'publisher', + 'TPE1' => 'artist', + 'TPE2' => 'band', + 'TPE3' => 'conductor', + 'TPE4' => 'remixer', + 'TPUB' => 'publisher', + 'TRC' => 'isrc', + 'TRCK' => 'track', + 'TRK' => 'track', + 'TSI' => 'size', + 'TSIZ' => 'size', + 'TSRC' => 'isrc', + 'TSS' => 'encoder_settings', + 'TSSE' => 'encoder_settings', + 'TSST' => 'subtitle', + 'TT1' => 'description', + 'TT2' => 'title', + 'TT3' => 'subtitle', + 'TXT' => 'lyricist', + 'TXX' => 'text', + 'TXXX' => 'text', + 'TYE' => 'year', + 'TYER' => 'year', + 'UFI' => 'unique_file_identifier', + 'UFID' => 'unique_file_identifier', + 'ULT' => 'unsychronised_lyric', + 'USER' => 'terms_of_use', + 'USLT' => 'unsynchronised lyric', + 'WAF' => 'url_file', + 'WAR' => 'url_artist', + 'WAS' => 'url_source', + 'WCOP' => 'copyright', + 'WCP' => 'copyright', + 'WOAF' => 'url_file', + 'WOAR' => 'url_artist', + 'WOAS' => 'url_source', + 'WORS' => 'url_station', + 'WPB' => 'url_publisher', + 'WPUB' => 'url_publisher', + 'WXX' => 'url_user', + 'WXXX' => 'url_user', + 'TFEA' => 'featured_artist', + 'TSTU' => 'studio' + ); + + return @$lookup[$frame_name]; + } + + + + public static function TextEncodingTerminatorLookup($encoding) { + + // http://www.id3.org/id3v2.4.0-structure.txt + // Frames that allow different types of text encoding contains a text encoding description byte. Possible encodings: + // $00 ISO-8859-1. Terminated with $00. + // $01 UTF-16 encoded Unicode with BOM. All strings in the same frame SHALL have the same byteorder. Terminated with $00 00. + // $02 UTF-16BE encoded Unicode without BOM. Terminated with $00 00. + // $03 UTF-8 encoded Unicode. Terminated with $00. + + static $lookup = array ( + 0 => "\x00", + 1 => "\x00\x00", + 2 => "\x00\x00", + 3 => "\x00", + 255 => "\x00\x00" + ); + + return @$lookup[$encoding]; + } + + + + public static function IsValidID3v2FrameName($frame_name, $id3v2_major_version) { + + switch ($id3v2_major_version) { + case 2: + return preg_match('/[A-Z][A-Z0-9]{2}/', $frame_name); + + case 3: + case 4: + return preg_match('/[A-Z][A-Z0-9]{3}/', $frame_name); + } + return false; + } + + + + public static function IsValidDateStampString($date_stamp) { + + if (strlen($date_stamp) != 8) { + return false; + } + if ((int)$date_stamp) { + return false; + } + + $year = substr($date_stamp, 0, 4); + $month = substr($date_stamp, 4, 2); + $day = substr($date_stamp, 6, 2); + if (!$year || !$month || !$day || $month > 12 || $day > 31 ) { + return false; + } + if (($day > 30) && (($month == 4) || ($month == 6) || ($month == 9) || ($month == 11))) { + return false; + } + if (($day > 29) && ($month == 2)) { + return false; + } + return true; + } + + + + public static function array_merge_noclobber($array1, $array2) { + if (!is_array($array1) || !is_array($array2)) { + return false; + } + $newarray = $array1; + foreach ($array2 as $key => $val) { + if (is_array($val) && isset($newarray[$key]) && is_array($newarray[$key])) { + $newarray[$key] = getid3_id3v2::array_merge_noclobber($newarray[$key], $val); + } elseif (!isset($newarray[$key])) { + $newarray[$key] = $val; + } + } + return $newarray; + } + + +} + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Assets/getid3/module.tag.lyrics3.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Assets/getid3/module.tag.lyrics3.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,270 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.tag.lyrics3.php | +// | module for analyzing Lyrics3 tags | +// | dependencies: module.tag.apetag.php (optional) | +// +----------------------------------------------------------------------+ +// +// $Id: module.tag.lyrics3.php,v 1.5 2006/11/16 22:04:23 ah Exp $ + + +class getid3_lyrics3 extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + fseek($getid3->fp, (0 - 128 - 9 - 6), SEEK_END); // end - ID3v1 - LYRICSEND - [Lyrics3size] + $lyrics3_id3v1 = fread($getid3->fp, 128 + 9 + 6); + $lyrics3_lsz = substr($lyrics3_id3v1, 0, 6); // Lyrics3size + $lyrics3_end = substr($lyrics3_id3v1, 6, 9); // LYRICSEND or LYRICS200 + $id3v1_tag = substr($lyrics3_id3v1, 15, 128); // ID3v1 + + // Lyrics3v1, ID3v1, no APE + if ($lyrics3_end == 'LYRICSEND') { + + $lyrics3_size = 5100; + $lyrics3_offset = filesize($getid3->filename) - 128 - $lyrics3_size; + $lyrics3_version = 1; + } + + // Lyrics3v2, ID3v1, no APE + elseif ($lyrics3_end == 'LYRICS200') { + + // LSZ = lyrics + 'LYRICSBEGIN'; add 6-byte size field; add 'LYRICS200' + $lyrics3_size = $lyrics3_lsz + 6 + strlen('LYRICS200'); + $lyrics3_offset = filesize($getid3->filename) - 128 - $lyrics3_size; + $lyrics3_version = 2; + } + + // Lyrics3v1, no ID3v1, no APE + elseif (substr(strrev($lyrics3_id3v1), 0, 9) == 'DNESCIRYL') { // strrev('LYRICSEND') = 'DNESCIRYL' + + $lyrics3_size = 5100; + $lyrics3_offset = filesize($getid3->filename) - $lyrics3_size; + $lyrics3_version = 1; + $lyrics3_offset = filesize($getid3->filename) - $lyrics3_size; + } + + // Lyrics3v2, no ID3v1, no APE + elseif (substr(strrev($lyrics3_id3v1), 0, 9) == '002SCIRYL') { // strrev('LYRICS200') = '002SCIRYL' + + $lyrics3_size = strrev(substr(strrev($lyrics3_id3v1), 9, 6)) + 15; // LSZ = lyrics + 'LYRICSBEGIN'; add 6-byte size field; add 'LYRICS200' // 15 = 6 + strlen('LYRICS200') + $lyrics3_offset = filesize($getid3->filename) - $lyrics3_size; + $lyrics3_version = 2; + } + + elseif (isset($getid3->info['ape']['tag_offset_start']) && ($getid3->info['ape']['tag_offset_start'] > 15)) { + + fseek($getid3->fp, $getid3->info['ape']['tag_offset_start'] - 15, SEEK_SET); + $lyrics3_lsz = fread($getid3->fp, 6); + $lyrics3_end = fread($getid3->fp, 9); + + + // Lyrics3v1, APE, maybe ID3v1 + if ($lyrics3_end == 'LYRICSEND') { + + $lyrics3_size = 5100; + $lyrics3_offset = $getid3->info['ape']['tag_offset_start'] - $lyrics3_size; + $getid3->info['avdataend'] = $lyrics3_offset; + $lyrics3_version = 1; + $getid3->warning('APE tag located after Lyrics3, will probably break Lyrics3 compatability'); + } + + + // Lyrics3v2, APE, maybe ID3v1 + elseif ($lyrics3_end == 'LYRICS200') { + + $lyrics3_size = $lyrics3_lsz + 15; // LSZ = lyrics + 'LYRICSBEGIN'; add 6-byte size field; add 'LYRICS200' + $lyrics3_offset = $getid3->info['ape']['tag_offset_start'] - $lyrics3_size; + $lyrics3_version = 2; + $getid3->warning('APE tag located after Lyrics3, will probably break Lyrics3 compatability'); + + } + } + + + //// GetLyrics3Data() + + + if (isset($lyrics3_offset)) { + + $getid3->info['avdataend'] = $lyrics3_offset; + + if ($lyrics3_size <= 0) { + return false; + } + + fseek($getid3->fp, $lyrics3_offset, SEEK_SET); + $raw_data = fread($getid3->fp, $lyrics3_size); + + if (substr($raw_data, 0, 11) != 'LYRICSBEGIN') { + if (strpos($raw_data, 'LYRICSBEGIN') !== false) { + + $getid3->warning('"LYRICSBEGIN" expected at '.$lyrics3_offset.' but actually found at '.($lyrics3_offset + strpos($raw_data, 'LYRICSBEGIN')).' - this is invalid for Lyrics3 v'.$lyrics3_version); + $getid3->info['avdataend'] = $lyrics3_offset + strpos($raw_data, 'LYRICSBEGIN'); + $parsed_lyrics3['tag_offset_start'] = $getid3->info['avdataend']; + $raw_data = substr($raw_data, strpos($raw_data, 'LYRICSBEGIN')); + $lyrics3_size = strlen($raw_data); + } + else { + throw new getid3_exception('"LYRICSBEGIN" expected at '.$lyrics3_offset.' but found "'.substr($raw_data, 0, 11).'" instead.'); + } + + } + + $parsed_lyrics3['raw']['lyrics3version'] = $lyrics3_version; + $parsed_lyrics3['raw']['lyrics3tagsize'] = $lyrics3_size; + $parsed_lyrics3['tag_offset_start'] = $lyrics3_offset; + $parsed_lyrics3['tag_offset_end'] = $lyrics3_offset + $lyrics3_size; + + switch ($lyrics3_version) { + + case 1: + if (substr($raw_data, strlen($raw_data) - 9, 9) == 'LYRICSEND') { + $parsed_lyrics3['raw']['LYR'] = trim(substr($raw_data, 11, strlen($raw_data) - 11 - 9)); + getid3_lyrics3::Lyrics3LyricsTimestampParse($parsed_lyrics3); + } + else { + throw new getid3_exception('"LYRICSEND" expected at '.(ftell($getid3->fp) - 11 + $lyrics3_size - 9).' but found "'.substr($raw_data, strlen($raw_data) - 9, 9).'" instead.'); + } + break; + + case 2: + if (substr($raw_data, strlen($raw_data) - 9, 9) == 'LYRICS200') { + $parsed_lyrics3['raw']['unparsed'] = substr($raw_data, 11, strlen($raw_data) - 11 - 9 - 6); // LYRICSBEGIN + LYRICS200 + LSZ + $raw_data = $parsed_lyrics3['raw']['unparsed']; + while (strlen($raw_data) > 0) { + $fieldname = substr($raw_data, 0, 3); + $fieldsize = (int)substr($raw_data, 3, 5); + $parsed_lyrics3['raw'][$fieldname] = substr($raw_data, 8, $fieldsize); + $raw_data = substr($raw_data, 3 + 5 + $fieldsize); + } + + if (isset($parsed_lyrics3['raw']['IND'])) { + $i = 0; + foreach (array ('lyrics', 'timestamps', 'inhibitrandom') as $flagname) { + if (strlen($parsed_lyrics3['raw']['IND']) > ++$i) { + $parsed_lyrics3['flags'][$flagname] = getid3_lyrics3::IntString2Bool(substr($parsed_lyrics3['raw']['IND'], $i, 1)); + } + } + } + + foreach (array ('ETT'=>'title', 'EAR'=>'artist', 'EAL'=>'album', 'INF'=>'comment', 'AUT'=>'author') as $key => $value) { + if (isset($parsed_lyrics3['raw'][$key])) { + $parsed_lyrics3['comments'][$value][] = trim($parsed_lyrics3['raw'][$key]); + } + } + + if (isset($parsed_lyrics3['raw']['IMG'])) { + foreach (explode("\r\n", $parsed_lyrics3['raw']['IMG']) as $key => $image_string) { + if (strpos($image_string, '||') !== false) { + $imagearray = explode('||', $image_string); + $parsed_lyrics3['images'][$key]['filename'] = @$imagearray[0]; + $parsed_lyrics3['images'][$key]['description'] = @$imagearray[1]; + $parsed_lyrics3['images'][$key]['timestamp'] = getid3_lyrics3::Lyrics3Timestamp2Seconds(@$imagearray[2]); + } + } + } + + if (isset($parsed_lyrics3['raw']['LYR'])) { + getid3_lyrics3::Lyrics3LyricsTimestampParse($parsed_lyrics3); + } + } + else { + throw new getid3_exception('"LYRICS200" expected at '.(ftell($getid3->fp) - 11 + $lyrics3_size - 9).' but found "'.substr($raw_data, strlen($raw_data) - 9, 9).'" instead.'); + } + break; + + default: + throw new getid3_exception('Cannot process Lyrics3 version '.$lyrics3_version.' (only v1 and v2)'); + } + + if (isset($getid3->info['id3v1']['tag_offset_start']) && ($getid3->info['id3v1']['tag_offset_start'] < $parsed_lyrics3['tag_offset_end'])) { + $getid3->warning('ID3v1 tag information ignored since it appears to be a false synch in Lyrics3 tag data'); + unset($getid3->info['id3v1']); + } + + $getid3->info['lyrics3'] = $parsed_lyrics3; + + + // Check for APE tag after lyrics3 + if (!@$getid3->info['ape'] && $getid3->option_tag_apetag && class_exists('getid3_apetag')) { + $apetag = new getid3_apetag($getid3); + $apetag->option_override_end_offset = $getid3->info['lyrics3']['tag_offset_start']; + $apetag->Analyze(); + } + } + + return true; + } + + + + + public static function Lyrics3Timestamp2Seconds($rawtimestamp) { + if (ereg('^\\[([0-9]{2}):([0-9]{2})\\]$', $rawtimestamp, $regs)) { + return (int)(($regs[1] * 60) + $regs[2]); + } + return false; + } + + + + public static function Lyrics3LyricsTimestampParse(&$lyrics3_data) { + + $lyrics_array = explode("\r\n", $lyrics3_data['raw']['LYR']); + foreach ($lyrics_array as $key => $lyric_line) { + + while (ereg('^(\\[[0-9]{2}:[0-9]{2}\\])', $lyric_line, $regs)) { + $this_line_timestamps[] = getid3_lyrics3::Lyrics3Timestamp2Seconds($regs[0]); + $lyric_line = str_replace($regs[0], '', $lyric_line); + } + $no_timestamp_lyrics_array[$key] = $lyric_line; + if (@is_array($this_line_timestamps)) { + sort($this_line_timestamps); + foreach ($this_line_timestamps as $timestampkey => $timestamp) { + if (isset($lyrics3_data['synchedlyrics'][$timestamp])) { + // timestamps only have a 1-second resolution, it's possible that multiple lines + // could have the same timestamp, if so, append + $lyrics3_data['synchedlyrics'][$timestamp] .= "\r\n".$lyric_line; + } else { + $lyrics3_data['synchedlyrics'][$timestamp] = $lyric_line; + } + } + } + unset($this_line_timestamps); + $regs = array (); + } + $lyrics3_data['unsynchedlyrics'] = implode("\r\n", $no_timestamp_lyrics_array); + if (isset($lyrics3_data['synchedlyrics']) && is_array($lyrics3_data['synchedlyrics'])) { + ksort($lyrics3_data['synchedlyrics']); + } + return true; + } + + + + public static function IntString2Bool($char) { + + return $char == '1' ? true : ($char == '0' ? false : null); + } +} + + +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/FileManager.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/FileManager.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,391 @@ +options = array_merge(array( + 'directory' => '../../Gallery', + 'assetBasePath' => '../Assets', + 'dateFormat' => 'j M Y - H:i', + 'maxUploadSize' => 1024*1024*3, + 'upload' => false, + 'destroy' => false, + 'safe' => true, + 'filter' => null, + ), $options); + + $this->basedir = realpath($this->options['directory']); + $this->basename = pathinfo($this->basedir, PATHINFO_BASENAME).'/'; + $this->path = realpath($this->options['directory'].'/../'); + $this->length = strlen($this->path); + + header('Expires: Fri, 01 Jan 1990 00:00:00 GMT'); + header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate'); + + $this->get = $_GET; + $this->post = $_POST; + } + + public function fireEvent($event){ + $event = $event ? 'on'.ucfirst($event) : null; + if(!$event || !method_exists($this, $event)) $event = 'onView'; + + $this->{$event}(); + } + + protected function onView(){ + $dir = $this->getDir(!empty($this->post['directory']) ? $this->post['directory'] : null); + $files = ($files = glob($dir.'/*')) ? $files : array(); + + if($dir!=$this->basedir) array_unshift($files, $dir.'/..'); + natcasesort($files); + foreach($files as $file){ + $mime = $this->getMimeType($file); + if($this->options['filter'] && $mime!='text/directory' && !FileManagerUtility::startsWith($mime, $this->options['filter'])) + continue; + + $out[is_dir($file) ? 0 : 1][] = array( + 'name' => pathinfo($file, PATHINFO_BASENAME), + 'date' => date($this->options['dateFormat'], filemtime($file)), + 'mime' => $this->getMimeType($file), + 'icon' => $this->getIcon($this->normalize($file)), + 'size' => filesize($file), + ); + } + + echo json_encode(array( + 'path' => $this->getPath($dir), + 'dir' => array( + 'name' => pathinfo($dir, PATHINFO_BASENAME), + 'date' => date($this->options['dateFormat'], filemtime($dir)), + 'mime' => 'text/directory', + 'icon' => 'dir', + ), + 'files' => array_merge(!empty($out[0]) ? $out[0] : array(), !empty($out[1]) ? $out[1] : array()), + )); + } + + protected function onDetail(){ + if(empty($this->post['directory']) || empty($this->post['file'])) return; + + $file = realpath($this->path.'/'.$this->post['directory'].'/'.$this->post['file']); + if(!$this->checkFile($file)) return; + + require_once(FileManagerUtility::getPath().'/Assets/getid3/getid3.php'); + + $url = $this->normalize(substr($file, strlen($this->path)+1)); + $mime = $this->getMimeType($file); + $content = null; + if(FileManagerUtility::startsWith($mime, 'image/')){ + $size = getimagesize($file); + $content = ' +

${more}

+
+
${width}
'.$size[0].'px
+
${height}
'.$size[1].'px
+
'; + }elseif(FileManagerUtility::startsWith($mime, 'text/') || $mime=='application/x-javascript'){ + $filecontent = file_get_contents($file, null, null, 0, 300); + if(!FileManagerUtility::isBinary($filecontent)) $content = '
'.nl2br(str_replace(array('$', "\t"), array('$', '  '), htmlentities($filecontent))).'
'; + }elseif($mime=='application/zip'){ + $out = array(array(), array()); + $getid3 = new getID3(); + $getid3->Analyze($file); + foreach($getid3->info['zip']['files'] as $name => $size){ + $icon = is_array($size) ? 'dir' : $this->getIcon($name); + $out[$icon=='dir' ? 0 : 1][$name] = '
  • '.$name.'
  • '; + } + natcasesort($out[0]); + natcasesort($out[1]); + $content = '
      '.implode(array_merge($out[0], $out[1])).'
    '; + }elseif(FileManagerUtility::startsWith($mime, 'audio/')){ + $getid3 = new getID3(); + $getid3->Analyze($file); + + $content = '
    + + + +
    +

    ${more}

    +
    +
    ${title}
    '.$getid3->info['comments']['title'][0].'
    +
    ${artist}
    '.$getid3->info['comments']['artist'][0].'
    +
    ${album}
    '.$getid3->info['comments']['album'][0].'
    +
    ${length}
    '.$getid3->info['playtime_string'].'
    +
    ${bitrate}
    '.round($getid3->info['bitrate']/1000).'kbps
    +
    '; + } + + echo json_encode(array( + 'content' => $content ? $content : '
    + ${nopreview}
    +
    ', + )); + } + + protected function onDestroy(){ + if(!$this->options['destroy'] || empty($this->post['directory']) || empty($this->post['file'])) return; + + $file = realpath($this->path.'/'.$this->post['directory'].'/'.$this->post['file']); + if(!$this->checkFile($file)) return; + + $this->unlink($file); + + echo json_encode(array( + 'content' => 'destroyed', + )); + } + + protected function onCreate(){ + if(empty($this->post['directory']) || empty($this->post['file'])) return; + + $file = $this->getName($this->post['file'], $this->getDir($this->post['directory'])); + if(!$file) return; + + mkdir($file); + + $this->onView(); + } + + protected function onUpload(){ + try{ + if(!$this->options['upload']) + throw new FileManagerException('disabled'); + if(empty($this->get['directory']) || (function_exists('UploadIsAuthenticated') && !UploadIsAuthenticated($this->get))) + throw new FileManagerException('authenticated'); + + $dir = $this->getDir($this->get['directory']); + $name = pathinfo((Upload::exists('Filedata')) ? $this->getName($_FILES['Filedata']['name'], $dir) : null, PATHINFO_FILENAME); + $file = Upload::move('Filedata', $dir.'/', array( + 'name' => $name, + 'extension' => $this->options['safe'] && $name && in_array(strtolower(pathinfo($_FILES['Filedata']['name'], PATHINFO_EXTENSION)), array('exe', 'dll', 'php', 'php3', 'php4', 'php5', 'phps')) ? 'txt' : null, + 'size' => $this->options['maxUploadSize'], + 'mimes' => $this->getAllowedMimeTypes(), + )); + + if(FileManagerUtility::startsWith(Upload::mime($file), 'image/') && !empty($this->get['resize'])){ + $img = new Image($file); + $size = $img->getSize(); + if($size['width']>800) $img->resize(800)->save(); + elseif($size['height']>600) $img->resize(null, 600)->save(); + } + + echo json_encode(array( + 'status' => 1, + 'name' => pathinfo($file, PATHINFO_BASENAME), + )); + }catch(UploadException $e){ + echo json_encode(array( + 'status' => 0, + 'error' => class_exists('ValidatorException') ? $e->getMessage() : '${upload.'.$e->getMessage().'}', // This is for Styx :) + )); + }catch(FileManagerException $e){ + echo json_encode(array( + 'status' => 0, + 'error' => '${upload.'.$e->getMessage().'}', + )); + } + } + + /* This method is used by both move and rename */ + protected function onMove(){ + if(empty($this->post['directory']) || empty($this->post['file'])) return; + + $rename = empty($this->post['newDirectory']) && !empty($this->post['name']); + $dir = $this->getDir($this->post['directory']); + $file = realpath($dir.'/'.$this->post['file']); + + $is_dir = is_dir($file); + if(!$this->checkFile($file) || (!$rename && $is_dir)) + return; + + if($rename || $is_dir){ + if(empty($this->post['name'])) return; + $newname = $this->getName($this->post['name'], $dir); + $fn = 'rename'; + }else{ + $newname = $this->getName(pathinfo($file, PATHINFO_FILENAME), $this->getDir($this->post['newDirectory'])); + $fn = !empty($this->post['copy']) ? 'copy' : 'rename'; + } + + if(!$newname) return; + + $ext = pathinfo($file, PATHINFO_EXTENSION); + if($ext) $newname .= '.'.$ext; + $fn($file, $newname); + + echo json_encode(array( + 'name' => pathinfo($this->normalize($newname), PATHINFO_BASENAME), + )); + } + + protected function unlink($file){ + $file = realpath($file); + if($this->basedir==$file || strlen($this->basedir)>=strlen($file)) + return; + + if(is_dir($file)){ + $files = glob($file.'/*'); + if(is_array($files)) + foreach($files as $f) + $this->unlink($f); + + rmdir($file); + }else{ + try{ if($this->checkFile($file)) unlink($file); }catch(Exception $e){} + } + } + + protected function getName($file, $dir){ + $files = array(); + foreach((array)glob($dir.'/*') as $f) + $files[] = pathinfo($f, PATHINFO_FILENAME); + + $pathinfo = pathinfo($file); + $file = $dir.'/'.FileManagerUtility::pagetitle($pathinfo['filename'], $files).(!empty($pathinfo['extension']) ? '.'.$pathinfo['extension'] : null); + + return !$file || !FileManagerUtility::startsWith($file, $this->basedir) || file_exists($file) ? null : $file; + } + + protected function getIcon($file){ + if(FileManagerUtility::endsWith($file, '/..')) return 'dir_up'; + else if(is_dir($file)) return 'dir'; + + $ext = pathinfo($file, PATHINFO_EXTENSION); + return ($ext && file_exists(realpath($this->options['assetBasePath'].'/Icons/'.$ext.'.png'))) ? $ext : 'default'; + } + + protected function getMimeType($file){ + return is_dir($file) ? 'text/directory' : Upload::mime($file); + } + + protected function getDir($dir){ + $dir = realpath($this->path.'/'.(FileManagerUtility::startsWith($dir, $this->basename) ? $dir : $this->basename)); + return $this->checkFile($dir) ? $dir : $this->basedir; + } + + protected function getPath($file){ + $file = $this->normalize(substr($file, $this->length)); + return substr($file, FileManagerUtility::startsWith($file, '/') ? 1 : 0); + } + + protected function checkFile($file){ + $mimes = $this->getAllowedMimeTypes(); + $hasFilter = $this->options['filter'] && count($mimes); + if($hasFilter) array_push($mimes, 'text/directory'); + return !(!$file || !FileManagerUtility::startsWith($file, $this->basedir) || !file_exists($file) || ($hasFilter && !in_array($this->getMimeType($file), $mimes))); + } + + protected function normalize($file){ + return preg_replace('/\\\|\/{2,}/', '/', $file); + } + + protected function getAllowedMimeTypes(){ + $filter = $this->options['filter']; + + if(!$filter) return null; + if(!FileManagerUtility::endsWith($filter, '/')) return array($filter); + + static $mimes; + if(!$mimes) $mimes = parse_ini_file(FileManagerUtility::getPath().'/MimeTypes.ini'); + + foreach($mimes as $mime) + if(FileManagerUtility::startsWith($mime, $filter)) + $mimeTypes[] = strtolower($mime); + + return $mimeTypes; + } + +} + +class FileManagerException extends Exception {} + +/* Stripped-down version of some Styx PHP Framework-Functionality bundled with this FileBrowser. Styx is located at: http://styx.og5.net */ +class FileManagerUtility { + + public static function endsWith($string, $look){ + return strrpos($string, $look)===strlen($string)-strlen($look); + } + + public static function startsWith($string, $look){ + return strpos($string, $look)===0; + } + + public static function pagetitle($data, $options = array()){ + static $regex; + if(!$regex){ + $regex = array( + explode(' ', 'Æ æ Å’ Å“ ß Ãœ ü Ö ö Ä ä À à Â Ã Ä Ã… Ą Ă Ã‡ Ć Č Ď Đ Ã Ãˆ É Ê Ë Ę Ě Ğ ÃŒ à Î Ã İ Ł Ľ Ĺ Ã‘ Ń Ň Ã’ Ó Ô Õ Ö Ø Ő Ŕ Ř Å  Ś Ş Ť Ţ Ã™ Ú Û Ãœ Ů Ű Ã Å½ Ź Ż à á â ã ä Ã¥ ą ă ç ć č ď đ è é ê ë ę ě ğ ì í î ï ı ł ľ ĺ ñ ń ň ð ò ó ô õ ö ø ő ŕ ř ś Å¡ ş ť ţ ù ú û ü ů ű ý ÿ ž ź ż'), + explode(' ', 'Ae ae Oe oe ss Ue ue Oe oe Ae ae A A A A A A A A C C C D D D E E E E E E G I I I I I L L L N N N O O O O O O O R R S S S T T U U U U U U Y Z Z Z a a a a a a a a c c c d d e e e e e e g i i i i i l l l n n n o o o o o o o o r r s s s t t u u u u u u y y z z z'), + ); + + $regex[0][] = '"'; + $regex[0][] = "'"; + } + + $data = trim(substr(preg_replace('/(?:[^A-z0-9]|_|\^)+/i', '_', str_replace($regex[0], $regex[1], $data)), 0, 64), '_'); + return !empty($options) ? self::checkTitle($data, $options) : $data; + } + + protected static function checkTitle($data, $options = array(), $i = 0){ + if(!is_array($options)) return $data; + + foreach($options as $content) + if($content && strtolower($content)==strtolower($data.($i ? '_'.$i : ''))) + return self::checkTitle($data, $options, ++$i); + + return $data.($i ? '_'.$i : ''); + } + + public static function isBinary($str){ + $array = array(0, 255); + for($i = 0; $i < strlen($str); $i++) + if(in_array(ord($str[$i]), $array)) return true; + + return false; + } + + public static function getPath(){ + static $path; + return $path ? $path : $path = pathinfo(__FILE__, PATHINFO_DIRNAME); + } + +} \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Image.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Image.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,290 @@ + + * + * @link http://www.bin-co.com/php/scripts/classes/gd_image/ Based on work by "Binny V A" + */ + +class Image { + /** + * The path to the image file + * + * @var string + */ + private $file; + /** + * The image resource + * + * @var resource + */ + private $image; + /** + * Metadata regarding the image + * + * @var array + */ + private $meta; + + /** + * @param string $file The path to the image file + */ + public function __construct($file){ + $file = realpath($file); + if(!file_exists($file)) + return; + + $this->file = $file; + $img = getimagesize($file); + + $this->meta = array( + 'width' => $img[0], + 'height' => $img[1], + 'mime' => $img['mime'], + 'ext' => end(explode('/', $img['mime'])), + ); + if($this->meta['ext']=='jpg') + $this->meta['ext'] = 'jpeg'; + + if(!in_array($this->meta['ext'], array('gif', 'png', 'jpeg'))) + return; + + if(in_array($this->meta['ext'], array('gif', 'png'))){ + $this->image = $this->create(); + + $fn = 'imagecreatefrom'.$this->meta['ext']; + $original = $fn($file); + imagecopyresampled($this->image, $original, 0, 0, 0, 0, $this->meta['width'], $this->meta['height'], $this->meta['width'], $this->meta['height']); + }else{ + $this->image = imagecreatefromjpeg($file); + } + } + + public function __destruct(){ + if(!empty($this->image)) imagedestroy($this->image); + } + + /** + * Returns the size of the image + * + * @return array + */ + public function getSize(){ + return array( + 'width' => $this->meta['width'], + 'height' => $this->meta['height'], + ); + } + + /** + * Creates a new, empty image with the desired size + * + * @param int $x + * @param int $y + * @param string $ext + * @return resource + */ + private function create($x = null, $y = null, $ext = null){ + if(!$x) $x = $this->meta['width']; + if(!$y) $y = $this->meta['height']; + + $image = imagecreatetruecolor($x, $y); + if(!$ext) $ext = $this->meta['ext']; + if($ext=='png'){ + imagealphablending($image, false); + imagefilledrectangle($image, 0, 0, $x, $y, imagecolorallocatealpha($image, 0, 0, 0, 127)); + } + + return $image; + } + + /** + * Replaces the image resource with the given parameter + * + * @param resource $new + */ + private function set($new){ + imagedestroy($this->image); + $this->image = $new; + + $this->meta['width'] = imagesx($this->image); + $this->meta['height'] = imagesy($this->image); + } + + /** + * Returns the path to the image file + * + * @return string + */ + public function getPathname(){ + return $this->file; + } + + /** + * Rotates the image by the given angle + * + * @param int $angle + * @param array $bgcolor An indexed array with red/green/blue/alpha values + * @return Image + */ + public function rotate($angle, $bgcolor = null){ + if(empty($this->image) || !$angle || $angle>=360) return $this; + + $this->set(imagerotate($this->image, $angle, is_array($bgcolor) ? imagecolorallocatealpha($this->image, $bgcolor[0], $bgcolor[1], $bgcolor[2], !empty($bgcolor[3]) ? $bgcolor[3] : null) : $bgcolor)); + + return $this; + } + + /** + * Resizes the image to the given size, automatically calculates + * the new ratio if parameter {@link $ratio} is set to true + * + * @param int $x + * @param int $y + * @param bool $ratio + * @return Image + */ + public function resize($x = null, $y = null, $ratio = true){ + if(empty($this->image) || (!$x && !$y)) return $this; + + if(!$y) $y = $ratio ? $this->meta['height']*$x/$this->meta['width'] : $this->meta['height']; + if(!$x) $x = $ratio ? $this->meta['width']*$y/$this->meta['height'] : $this->meta['width']; + + $new = $this->create($x, $y); + imagecopyresampled($new, $this->image, 0, 0, 0, 0, $x, $y, $this->meta['width'], $this->meta['height']); + $this->set($new); + + return $this; + } + + /** + * Crops the image. The values are given like margin/padding values in css + * + * Example + *
      + *
    • crop(10) - Crops by 10px on all sides
    • + *
    • crop(10, 5) - Crops by 10px on top and bottom and by 5px on left and right sides
    • + *
    • crop(10, 5, 5) - Crops by 10px on top and by 5px on left, right and bottom sides
    • + *
    • crop(10, 5, 3, 2) - Crops by 10px on top, 5px by right, 3px by bottom and 2px by left sides
    • + *
    + * + * @param int $top + * @param int $right + * @param int $bottom + * @param int $left + * @return Image + */ + public function crop($top, $right = null, $bottom = null, $left = null){ + if(empty($this->image)) return $this; + + if(!is_numeric($right) && !is_numeric($bottom) && !is_numeric($left)) + $right = $bottom = $left = $top; + + if(!is_numeric($bottom) && !is_numeric($left)){ + $bottom = $top; + $left = $right; + } + + if(!is_numeric($left)) + $left = $right; + + $x = $this->meta['width']-$left-$right; + $y = $this->meta['height']-$top-$bottom; + + if($x<0 || $y<0) return $this; + + $new = $this->create($x, $y); + imagecopy($new, $this->image, 0, 0, $left, $top, $x, $y); + $this->set($new); + + return $this; + } + + /** + * Flips the image horizontally or vertically. To Flip both just use ->rotate(180) + * + * @see Image::rotate() + * @param string $type Either horizontal or vertical + * @return Image + */ + public function flip($type){ + if(empty($this->image) || !in_array($type, array('horizontal', 'vertical'))) return $this; + + $new = $this->create(); + + if($type=='horizontal') + for($x=0;$x<$this->meta['width'];$x++) + imagecopy($new, $this->image, $this->meta['width']-$x-1, 0, $x, 0, 1, $this->meta['height']); + elseif($type=='vertical') + for($y=0;$y<$this->meta['height'];$y++) + imagecopy($new, $this->image, 0, $this->meta['height']-$y-1, 0, $y, $this->meta['width'], 1); + + $this->set($new); + + return $this; + } + + /** + * Stores the image in the desired directory or outputs it + * + * @param string $ext + * @param string $file + */ + private function process($ext = null, $file = null){ + if(!$ext) $ext = $this->meta['ext']; + + if($ext=='png') imagesavealpha($this->image, true); + $fn = 'image'.$ext; + $fn($this->image, $file); + + // If there is a new filename change the internal name too + if($file) $this->file = $file; + } + + /** + * Saves the image to the given path + * + * @param string $file Leave empty to replace the original file + * @return Image + */ + public function save($file = null){ + if(empty($this->image)) return $this; + + if(!$file) $file = $this->file; + + $ext = strtolower(pathinfo($file, PATHINFO_EXTENSION)); + if(!$ext){ + $file .= '.'.$this->meta['ext']; + $ext = $this->meta['ext']; + } + + if($ext=='jpg') $ext = 'jpeg'; + + if(!in_array($ext, array('png', 'jpeg', 'gif'))) + return $this; + + $this->process($ext, $file); + + return $this; + } + + /** + * Outputs the manipulated image + * + * @return Image + */ + public function show(){ + if(empty($this->image)) return $this; + + header('Content-type: '.$this->meta['mime']); + $this->process(); + + return $this; + } + +} \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/MimeTypes.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/MimeTypes.ini Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,202 @@ +; Mimetypes configuration file +; The types are sorted by the filetype + +[application] +ai = application/postscript +bcpio = application/x-bcpio +bin = application/octet-stream +ccad = application/clariscad +cdf = application/x-netcdf +class = application/octet-stream +cpio = application/x-cpio +cpt = application/mac-compactpro +csh = application/x-csh +dcr = application/x-director +dir = application/x-director +dms = application/octet-stream +doc = application/msword +drw = application/drafting +dvi = application/x-dvi +dwg = application/acad +dxf = application/dxf +dxr = application/x-director +eps = application/postscript +exe = application/octet-stream +ez = application/andrew-inset +gtar = application/x-gtar +gz = application/x-gzip +hdf = application/x-hdf +hqx = application/mac-binhex40 +ips = application/x-ipscript +ipx = application/x-ipix +iso = application/x-isoview; +js = application/x-javascript +latex = application/x-latex +lha = application/octet-stream +lnk = application/x-ms-shortcut +lsp = application/x-lisp +lzh = application/octet-stream +man = application/x-troff-man +me = application/x-troff-me +mif = application/vnd.mif +ms = application/x-troff-ms +nc = application/x-netcdf +oda = application/oda +odt = application/vnd.oasis.opendocument.text +ods = application/vnd.oasis.opendocument.spreadsheet +odp = application/vnd.oasis.opendocument.presentation +odg = application/vnd.oasis.opendocument.graphics +odc = application/vnd.oasis.opendocument.chart +odf = application/vnd.oasis.opendocument.formula +odb = application/vnd.oasis.opendocument.database +odi = application/vnd.oasis.opendocument.image +odm = application/vnd.oasis.opendocument.text-master +ott = application/vnd.oasis.opendocument.text-template +ots = application/vnd.oasis.opendocument.spreadsheet-template +otp = application/vnd.oasis.opendocument.presentation-template +otg = application/vnd.oasis.opendocument.graphics-template +pdf = application/pdf +pgn = application/x-chess-pgn +pot = application/mspowerpoint +pps = application/mspowerpoint +ppt = application/mspowerpoint +ppz = application/mspowerpoint +pre = application/x-freelance +prt = application/pro_eng +ps = application/postscript +rar = application/x-rar +roff = application/x-troff +scm = application/x-lotusscreencam +set = application/set +sh = application/x-sh +shar = application/x-shar +sit = application/x-stuffit +skd = application/x-koan +skm = application/x-koan +skp = application/x-koan +skt = application/x-koan +smi = application/smil +smil = application/smil +sol = application/solids +spl = application/x-futuresplash +src = application/x-wais-source +step = application/STEP +stl = application/SLA +stp = application/STEP +sv4cpio = application/x-sv4cpio +sv4crc = application/x-sv4crc +swf = application/x-shockwave-flash +t = application/x-troff +tar = application/x-tar +tcl = application/x-tcl +tex = application/x-tex +texi = application/x-texinfo +texinfo = application/x-texinfo +tr = application/x-troff +tsp = application/dsptype +unv = application/i-deas +ustar = application/x-ustar +vcd = application/x-cdlink +vda = application/vda +xlc = application/vnd.ms-excel +xll = application/vnd.ms-excel +xlm = application/vnd.ms-excel +xls = application/vnd.ms-excel +xlw = application/vnd.ms-excel +zip = application/zip + +[audio] +aif = audio/x-aiff +aifc = audio/x-aiff +aiff = audio/x-aiff +au = audio/basic +kar = audio/midi +mid = audio/midi +midi = audio/midi +mp2 = audio/mpeg +mp3 = audio/mpeg +mpga = audio/mpeg +ra = audio/x-realaudio +ram = audio/x-pn-realaudio +rm = audio/x-pn-realaudio +rpm = audio/x-pn-realaudio-plugin +snd = audio/basic +tsi = audio/TSP-audio +wav = audio/x-wav + +[text] +as = text/x-actionscript +asc = text/plain +c = text/plain +cc = text/plain +css = text/css +etx = text/x-setext +f = text/plain +f90 = text/plain +h = text/plain +hh = text/plain +htm = text/html +html = text/html +m = text/plain +rtf = text/rtf +rtx = text/richtext +sgm = text/sgml +sgml = text/sgml +tsv = text/tab-separated-values +tpl = text/template +txt = text/plain +xml = text/xml + +[video] +avi = video/x-msvideo +fli = video/x-fli +flv = video/x-flv +mov = video/quicktime +movie = video/x-sgi-movie +mpe = video/mpeg +mpeg = video/mpeg +mpg = video/mpeg +qt = video/quicktime +viv = video/vnd.vivo +vivo = video/vnd.vivo +wmv = video/x-ms-wmv + +[image] +bmp = image/bmp +gif = image/gif +ief = image/ief +jpe = image/jpeg +jpeg = image/jpeg +jpg = image/jpeg +pbm = image/x-portable-bitmap +pgm = image/x-portable-graymap +png = image/png +pnm = image/x-portable-anymap +ppm = image/x-portable-pixmap +psd = image/psd +ras = image/cmu-raster +rgb = image/x-rgb +tif = image/tiff +tiff = image/tiff +xbm = image/x-xbitmap +xpm = image/x-xpixmap +xwd = image/x-xwindowdump + +[x-conference] +ice = x-conference/x-cooltalk + +[model] +iges = model/iges +igs = model/iges +mesh = model/mesh +msh = model/mesh +silo = model/mesh +vrml = model/vrml +wrl = model/vrml + +[www] +mime = www/mime + +[chemical] +pdb = chemical/x-pdb +xyz = chemical/x-pdb \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Backend/Upload.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Backend/Upload.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,122 @@ + + */ + +class Upload { + + /** + * Moves the uploaded file to the specified location. It throws a UploadException + * if anything goes wrong except for if the upload does not exist. This can be checked with {@link Upload::exists()} + * + * @param string $file + * @param string $to + * @param array $options + * @return bool|string Path to moved file or false if the specified upload does not exist + */ + public static function move($file, $to, $options = null){ + if(!self::exists($file)) return false; + + $options = array_merge(array( + 'name' => null, + 'extension' => null, + 'size' => null, + 'chmod' => 0777, + 'overwrite' => false, + 'mimes' => array(), + ), $options); + + $file = $_FILES[$file]; + + if($options['size'] && $file['size']>$options['size']) + throw new UploadException('size'); + + $pathinfo = pathinfo($file['name']); + if($options['extension']) $pathinfo['extension'] = $options['extension']; + if(!$pathinfo['extension']) + throw new UploadException('extension'); + + if(count($options['mimes'])){ + $mime = self::mime($file['tmp_name'], array( + 'default' => $file['type'], + 'extension' => $pathinfo['extension'], + )); + + if(!$mime || !in_array($mime, $options['mimes'])) + throw new UploadException('extension'); + } + + $file['ext'] = strtolower($pathinfo['extension']); + $file['base'] = basename($pathinfo['basename'], '.'.$pathinfo['extension']); + + $real = realpath($to); + if(!$real) throw new UploadException('path'); + if(is_dir($real)) $to = $real.'/'.($options['name'] ? $options['name'] : $file['base']).'.'.$file['ext']; + + if(!$options['overwrite'] && file_exists($to)) + throw new UploadException('exists'); + + if(!move_uploaded_file($file['tmp_name'], $to)) + throw new UploadException(strtolower($_FILES[$file]['error']<=2 ? 'size' : ($_FILES[$file]['error']==3 ? 'partial' : 'nofile'))); + + chmod($to, $options['chmod']); + + return realpath($to); + } + + /** + * Returns whether the Upload exists or not + * + * @param string $file + * @return bool + */ + public function exists($file){ + return !(empty($_FILES[$file]['name']) || empty($_FILES[$file]['size'])); + } + + /** + * Returns (if possible) the mimetype of the given file + * + * @param string $file + * @param array $options + */ + public function mime($file, $options = array()){ + $file = realpath($file); + $options = array_merge(array( + 'default' => null, + 'extension' => strtolower(pathinfo($file, PATHINFO_EXTENSION)), + ), $options); + + $mime = null; + if(function_exists('finfo_open') && $f = finfo_open(FILEINFO_MIME, getenv('MAGIC'))){ + $mime = finfo_file($f, $file); + finfo_close($f); + } + + if(!$mime && in_array($options['extension'], array('gif', 'jpg', 'jpeg', 'png'))){ + $image = getimagesize($file); + if(!empty($image['mime'])) + $mime = $image['mime']; + } + + if(!$mime && $options['default']) $mime = $options['default']; + + if((!$mime || $mime=='application/octet-stream') && $options['extension']){ + static $mimes; + if(!$mimes) $mimes = parse_ini_file(pathinfo(__FILE__, PATHINFO_DIRNAME).'/MimeTypes.ini'); + + if(!empty($mimes[$options['extension']])) return $mimes[$options['extension']]; + } + + return $mime; + } + +} + +class UploadException extends Exception {} \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Compressed/filemanager-yui-all.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Compressed/filemanager-yui-all.js Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,1 @@ +var FileManager=new Class({Implements:[Options,Events],Request:null,Directory:null,Current:null,options:{directory:"",url:null,assetBasePath:null,selectable:false,hideOnClick:false,language:"en"},hooks:{show:{},cleanup:{}},initialize:function(a){this.setOptions(a);this.options.assetBasePath=this.options.assetBasePath.replace(/(\/|\\)*$/,"/");this.droppables=[];this.Directory=this.options.directory;this.language=FileManager.Language[this.options.language]||FileManager.Language.en;this.container=new Element("div",{"class":"filemanager-container filemanager-engine-"+Browser.Engine.name+(Browser.Engine.trident?Browser.Engine.version:"")});this.el=new Element("div",{"class":"filemanager"}).inject(this.container);this.menu=new Element("div",{"class":"filemanager-menu"}).inject(this.el);this.loader=new Element("div",{"class":"loader",opacity:0,tween:{duration:200}}).inject(this.menu);this.browser=new Element("ul",{"class":"filemanager-browser"}).addEvents({click:(function(g){if(g.target.match("ul")){return this.deselect()}if(!g.target||!g.target.getParent("li")){return}var f=g.target.getParent("li").getElement("span");if(!f){return}g.stop();var d=f.retrieve("file");if(f.retrieve("block")){f.eliminate("block");return}else{if(d.mime=="text/directory"){f.addClass("selected");this.load(this.Directory+"/"+d.name);return}}this.fillInfo(d);if(this.Current){this.Current.removeClass("selected")}this.Current=f.addClass("selected");this.switchButton()}).bind(this)}).inject(this.el);if(this.options.selectable){this.addMenuButton("open")}this.addMenuButton("create");this.info=new Element("div",{"class":"filemanager-infos",opacity:0}).inject(this.el);var b=new Element("div",{"class":"filemanager-head"}).adopt([new Element("img",{"class":"filemanager-icon"}),new Element("h1")]);this.info.adopt([b,new Element("h2",{text:this.language.information})]);var c=new Element("dl").adopt([new Element("dt",{text:this.language.modified}),new Element("dd",{"class":"filemanager-modified"}),new Element("dt",{text:this.language.type}),new Element("dd",{"class":"filemanager-type"}),new Element("dt",{text:this.language.size}),new Element("dd",{"class":"filemanager-size"}),new Element("dt",{text:this.language.dir}),new Element("dd",{"class":"filemanager-dir"})]).inject(this.info);this.preview=new Element("div",{"class":"filemanager-preview"});this.info.adopt([new Element("h2",{"class":"filemanager-headline",text:this.language.preview}),this.preview]);this.closeIcon=new Element("div",{"class":"filemanager-close",title:this.language.close,events:{click:this.hide.bind(this)}}).adopt(new Asset.image(this.options.assetBasePath+"destroy.png")).inject(this.el);new FileManager.Tips(this.closeIcon.appearOn(this.closeIcon,[1,0.8]).appearOn(this.el,0.8));this.imageadd=new Asset.image(this.options.assetBasePath+"add.png",{"class":"browser-add"}).set("opacity",0).inject(this.container);this.container.inject(document.body);this.overlay=new Overlay(this.options.hideOnClick?{events:{click:this.hide.bind(this)}}:null);this.bound={keydown:(function(d){if(d.control){this.imageadd.fade(1)}}).bind(this),keyup:(function(){this.imageadd.fade(0)}).bind(this),keyesc:(function(d){if(d.key=="esc"){this.hide()}}).bind(this),scroll:(function(){this.el.center(this.offsets);this.fireEvent("scroll")}).bind(this)}},show:function(a){if(a){a.stop()}this.load(this.Directory);this.overlay.show();this.info.set("opacity",0);(function(){this.container.setStyles({opacity:0,display:"block"});this.el.center(this.offsets);this.fireEvent("show");this.container.set("opacity",1);this.fireHooks("show");window.addEvents({scroll:this.bound.scroll,resize:this.bound.scroll,keyup:this.bound.keyesc})}).delay(500,this)},hide:function(a){if(a){a.stop()}this.overlay.hide();this.browser.empty();this.container.setStyle("display","none");this.fireHooks("cleanup").fireEvent("hide");window.removeEvent("scroll",this.bound.scroll).removeEvent("resize",this.bound.scroll).removeEvent("keyup",this.bound.keyesc)},open:function(a){a.stop();if(!this.Current){return false}this.fireEvent("complete",[this.normalize(this.Directory+"/"+this.Current.retrieve("file").name),this.Current.retrieve("file")]);this.hide()},create:function(b){b.stop();var a=this;new Dialog(this.language.createdir,{language:{confirm:this.language.create,decline:this.language.cancel},content:[new Element("input",{"class":"createDirectory"})],onOpen:this.onDialogOpen.bind(this),onClose:this.onDialogClose.bind(this),onShow:function(){var c=this;this.el.getElement("input").addEvent("keyup",function(d){if(d.key=="enter"){c.el.getElement("button-confirm").fireEvent("click")}}).focus()},onConfirm:function(){new FileManager.Request({url:a.options.url+"?event=create",onSuccess:a.fill.bind(a),data:{file:this.el.getElement("input").get("value"),directory:a.Directory}},a).post()}})},deselect:function(a){if(a&&this.Current!=a){return}if(a){this.fillInfo()}if(this.Current){this.Current.removeClass("selected")}this.Current=null;this.switchButton()},load:function(a,b){this.deselect();if(!b){this.info.fade(0)}if(this.Request){this.Request.cancel()}this.Request=new FileManager.Request({url:this.options.url,onSuccess:(function(c){this.fill(c,b)}).bind(this),data:{directory:a}},this).post()},destroy:function(c,b){c.stop();var a=this;new Dialog(this.language.destroyfile,{language:{confirm:this.language.destroy,decline:this.language.cancel},onOpen:this.onDialogOpen.bind(this),onClose:this.onDialogClose.bind(this),onConfirm:function(){new FileManager.Request({url:a.options.url+"?event=destroy",data:{file:b.name,directory:a.Directory},onSuccess:function(d){if(!d||d.content!="destroyed"){new Dialog(a.language.nodestroy,{language:{confirm:a.language.ok},buttons:["confirm"]});return}a.fireEvent("modify",[$unlink(b)]);b.element.getParent().fade(0).get("tween").chain(function(){a.deselect(b.element);this.element.destroy()})}},a).post()}})},rename:function(d,c){d.stop();var b=c.name;if(c.mime!="text/directory"){b=b.replace(/\..*$/,"")}var a=this;new Dialog(this.language.renamefile,{language:{confirm:this.language.rename,decline:this.language.cancel},content:[new Element("input",{"class":"rename",value:b})],onOpen:this.onDialogOpen.bind(this),onClose:this.onDialogClose.bind(this),onShow:function(){var e=this;this.el.getElement("input").addEvent("keyup",function(f){if(f.key=="enter"){e.el.getElement("button-confirm").fireEvent("click")}}).focus()},onConfirm:function(){new FileManager.Request({url:a.options.url+"?event=move",onSuccess:(function(e){if(!e||!e.name){return}a.fireEvent("modify",[$unlink(c)]);c.element.getElement("span").set("text",e.name);c.name=e.name;a.fillInfo(c)}).bind(this),data:{file:c.name,name:this.el.getElement("input").get("value"),directory:a.Directory}},a).post()}})},fill:function(c,e){this.Directory=c.path;this.CurrentDir=c.dir;if(!e){this.fillInfo(c.dir)}this.browser.empty();if(!c.files){return}var d=[[],[]];$each(c.files,function(g){g.dir=c.path;var h=g.element=new Element("span",{"class":"fi",href:"#"}).adopt(new Asset.image(this.options.assetBasePath+"Icons/"+g.icon+".png"),new Element("span",{text:g.name})).store("file",g);var f=[];if(g.mime!="text/directory"){f.push(new Asset.image(this.options.assetBasePath+"disk.png",{title:this.language.download}).addClass("browser-icon").addEvent("click",(function(i){i.stop();window.open(this.normalize(this.Directory+"/"+g.name))}).bind(this)).inject(h,"top"))}if(g.name!=".."){["rename","destroy"].each(function(i){f.push(new Asset.image(this.options.assetBasePath+i+".png",{title:this.language[i]}).addClass("browser-icon").addEvent("click",this[i].bindWithEvent(this,[g])).injectTop(h))},this)}d[g.mime=="text/directory"?1:0].push(h);if(g.name==".."){h.set("opacity",0.7)}h.inject(new Element("li").inject(this.browser));f=$$(f.map(function(i){return i.appearOn(i,[1,0.7])})).appearOn(h.getParent("li"),0.7)},this);var b=this;$$(d[0]).makeDraggable({droppables:$$(this.droppables,d[1]),onDrag:function(f,g){b.imageadd.setStyles(Hash.getValues(g.page).map(function(h){return h+15}).associate(["left","top"]))},onBeforeStart:function(f){f.setStyles({left:"0",top:"0"})},onStart:function(f){b.onDragStart(f,this);f.set("opacity",0.7);document.addEvents({keydown:b.bound.keydown,keyup:b.bound.keyup})},onEnter:function(f,g){g.addClass("droppable")},onLeave:function(f,g){g.removeClass("droppable")},onDrop:function(h,j,i){document.removeEvents("keydown",b.bound.keydown).removeEvents("keyup",b.bound.keydown);b.imageadd.fade(0);h.set("opacity",1).store("block",true);if(i.control||!j){h.setStyles({left:"0",top:"0"})}if(!j&&!i.control){return}var f;if(j){j.addClass("selected");(function(){j.removeClass("droppable").removeClass("selected")}).delay(300);if(b.onDragComplete(h,j)){return}f=j.retrieve("file")}var g=h.retrieve("file");new FileManager.Request({url:b.options.url+"?event=move",data:{file:g.name,directory:b.Directory,newDirectory:f?f.dir+"/"+f.name:b.Directory,copy:i.control?1:0},onSuccess:function(){if(!f){b.load(b.Directory)}}},b).post();b.fireEvent("modify",[$unlink(g)]);if(!i.control){h.fade(0).get("tween").chain(function(){b.deselect(h);h.getParent().destroy()})}}});$$(d).setStyles({left:"0",top:"0"});var a=new FileManager.Tips(this.browser.getElements("img.browser-icon"));a.tip.removeClass("tip-base")},fillInfo:function(b,d){if(!b){b=this.CurrentDir}if(!d){d=this.Directory}if(!b){return}var a=this.size(b.size);this.info.fade(1).getElement("img").set({src:this.options.assetBasePath+"Icons/"+b.icon+".png",alt:b.mime});this.fireHooks("cleanup");this.preview.empty();this.info.getElement("h1").set("text",b.name);this.info.getElement("dd.filemanager-modified").set("text",b.date);this.info.getElement("dd.filemanager-type").set("text",b.mime);this.info.getElement("dd.filemanager-size").set("text",!a[0]&&a[1]=="Bytes"?"-":(a.join(" ")+(a[1]!="Bytes"?" ("+b.size+" Bytes)":"")));this.info.getElement("h2.filemanager-headline").setStyle("display",b.mime=="text/directory"?"none":"block");var e=[],c=[];d.split("/").each(function(f){if(!f){return}c.push(f);e.push(new Element("a",{"class":"icon",href:"#",text:f}).addEvent("click",(function(h,g){h.stop();this.load(g)}).bindWithEvent(this,[c.join("/")])));e.push(new Element("span",{text:" / "}))},this);e.pop();e[e.length-1].addClass("selected").removeEvents("click").addEvent("click",function(f){f.stop()});this.info.getElement("dd.filemanager-dir").empty().adopt(new Element("span",{text:"/ "}),e);if(b.mime=="text/directory"){return}if(this.Request){this.Request.cancel()}this.Request=new FileManager.Request({url:this.options.url+"?event=detail",onSuccess:(function(f){var h=this.preview.removeClass("filemanager-loading").set("html",f&&f.content?f.content.substitute(this.language,/\\?\$\{([^{}]+)\}/g):"").getElement("img.prev");if(h){h.addEvent("load",function(){this.setStyle("background","none")})}var g=this.preview.getElements("button");if(g){g.addEvent("click",function(i){i.stop();window.open(this.get("value"))})}}).bind(this),data:{directory:this.Directory,file:b.name}},this).post()},size:function(b){var c=["Bytes","KB","MB","GB","TB"];for(var a=0;b>1024;a++){b=b/1024}return[Math.round(b),c[a]]},normalize:function(a){return a.replace(/\/+/g,"/")},switchButton:function(){var a=!!this.Current;var b=this.menu.getElement("button.filemanager-open");if(b){b.set("disabled",!a)[(a?"remove":"add")+"Class"]("disabled")}},addMenuButton:function(a){var b=new Element("button",{"class":"filemanager-"+a,text:this.language[a]}).inject(this.menu);if(this[a]){b.addEvent("click",this[a].bind(this))}return b},fireHooks:function(c){var a=Array.slice(arguments,1);for(var b in this.hooks[c]){this.hooks[c][b].apply(this,a)}return this},onRequest:function(){this.loader.set("opacity",1)},onComplete:function(){this.loader.fade(0)},onDialogOpen:$empty,onDialogClose:$empty,onDragStart:$empty,onDragComplete:$lambda(false)});FileManager.Language={};if(!window.FileManager){var FileManager={}}FileManager.Tips=new Class({Extends:Tips,options:{offsets:{x:15,y:0},text:null,onShow:function(b,a){if(b.get("opacity")==0.8&&b.getStyle("visibility")=="visible"){return}b.get("tween").pause();b.set({opacity:0,tween:{duration:200,link:"cancel"}}).fade(0.8)},onHide:function(b,a){b.get("tween").pause().start("opacity",0).chain(function(){b.setStyle("left",0)})}},initialize:function(b,a){this.parent(b,a);this.tip.addClass("tip-filebrowser")}});FileManager.Request=new Class({Extends:Request.JSON,initialize:function(a,b){this.parent(a);if(b){this.addEvents({request:b.onRequest.bind(b),complete:b.onComplete.bind(b)})}}});Element.implement({appearOn:function(c,b,a){b=$type(b)=="array"?[b[0]||1,b[1]||0]:[b||1,0];this.set({opacity:b[1],tween:a||{duration:200}});$(c).addEvents({mouseenter:this.fade.bind(this,b[0]),mouseleave:this.fade.bind(this,b[1])});return this},center:function(e){var a=document.getScroll(),g=document.getSize(),c=this.getSize(),b={x:"left",y:"top"};if(!e){e={}}for(var f in b){var d=a[f]+(g[f]-c[f])/2+(e[f]||0);this.setStyle(b[f],d<10?10:d)}return this}});var Dialog=new Class({Implements:[Options,Events],options:{request:null,buttons:["confirm","decline"],language:{}},initialize:function(b,a){this.setOptions(a);this.el=new Element("div",{"class":"dialog dialog-engine-"+Browser.Engine.name+(Browser.Engine.trident?Browser.Engine.version:""),opacity:0,tween:{duration:250}}).adopt([$type(b)=="string"?new Element("div",{text:b}):b]);if(this.options.content){this.el.getElement("div").adopt(this.options.content)}Array.each(this.options.buttons,function(c){new Element("button",{"class":"dialog-"+c,text:this.options.language[c]}).addEvent("click",(function(d){if(d){d.stop()}this.fireEvent(c).fireEvent("close");this.overlay.hide();this.destroy()}).bind(this)).inject(this.el)},this);this.overlay=new Overlay({"class":"overlay overlay-dialog",events:{click:this.fireEvent.bind(this,["close"])},tween:{duration:250}});this.bound={scroll:(function(){if(!this.el){this.destroy()}else{this.el.center()}}).bind(this),keyesc:(function(c){if(c.key=="esc"){this.fireEvent("close").destroy()}}).bind(this)};this.show()},show:function(){this.overlay.show();var a=this.fireEvent("open");this.el.setStyle("display","block").inject(document.body).center().fade(1).get("tween").chain(function(){a.fireEvent("show")});window.addEvents({scroll:this.bound.scroll,resize:this.bound.scroll,keyup:this.bound.keyesc})},destroy:function(){if(this.el){this.el.fade(0).get("tween").chain((function(){this.overlay.destroy();this.el.destroy()}).bind(this))}window.removeEvent("scroll",this.bound.scroll).removeEvent("resize",this.bound.scroll).removeEvent("keyup",this.bound.keyesc)}}),Overlay=new Class({initialize:function(a){this.el=new Element("div",$extend({"class":"overlay"},a)).inject(document.body)},show:function(){this.objects=$$("object, select, embed").filter(function(a){return a.id=="SwiffFileManagerUpload"||a.style.visibility=="hidden"?false:!!(a.style.visibility="hidden")});this.resize=(function(){if(!this.el){this.destroy()}else{this.el.setStyles({width:document.getScrollWidth(),height:document.getScrollHeight()})}}).bind(this);this.resize();this.el.setStyles({opacity:0,display:"block"}).get("tween").pause().start("opacity",0.5);window.addEvent("resize",this.resize);return this},hide:function(){this.el.fade(0).get("tween").chain((function(){this.revertObjects();this.el.setStyle("display","none")}).bind(this));window.removeEvent("resize",this.resize);return this},destroy:function(){this.revertObjects().el.destroy()},revertObjects:function(){if(this.objects&&this.objects.length){this.objects.each(function(a){a.style.visibility="visible"})}return this}});FileManager.TinyMCE=function(a){return function(f,b,d,e){var c=new FileManager($extend({onComplete:function(g){if(!e.document){return}e.document.getElementById(f).value=g;if(e.ImageDialog){e.ImageDialog.showPreviewImage(g,1)}this.container.destroy()}},a(d)));c.el.setStyle("zIndex",400001);c.overlay.el.setStyle("zIndex",400000);c.show()}};FileManager.implement("SwiffZIndex",400002);var Dialog=new Class({Extends:Dialog,initialize:function(b,a){this.parent(b,a);this.el.setStyle("zIndex",400010);this.overlay.el.setStyle("zIndex",400009)}});Fx.ProgressBar=new Class({Extends:Fx,options:{text:null,url:null,transition:Fx.Transitions.Circ.easeOut,fit:true,link:"cancel"},initialize:function(c,b){this.element=$(c);this.parent(b);var a=this.options.url;if(a){this.element.setStyles({"background-image":"url("+a+")","background-repeat":"no-repeat"})}if(this.options.fit){a=a||this.element.getStyle("background-image").replace(/^url\(["']?|["']?\)$/g,"");if(a){var d=new Image();d.onload=function(){this.fill=d.width;d=d.onload=null;this.set(this.now||0)}.bind(this);d.src=a;if(!this.fill&&d.width){d.onload()}}}else{this.set(0)}},start:function(b,a){return this.parent(this.now,(arguments.length==1)?b.limit(0,100):b/a*100)},set:function(c){this.now=c;var a=(this.fill)?(((this.fill/-2)+(c/100)*(this.element.width||1)||0).round()+"px"):((100-c)+"%");this.element.setStyle("backgroundPosition",a+" 0px").title=Math.round(c)+"%";var b=$(this.options.text);if(b){b.set("text",Math.round(c)+"%")}return this}});Swiff.Uploader=new Class({Extends:Swiff,Implements:Events,options:{path:"Swiff.Uploader.swf",target:null,zIndex:9999,height:30,width:100,callBacks:null,params:{wMode:"opaque",menu:"false",allowScriptAccess:"always"},typeFilter:null,multiple:true,queued:true,verbose:false,url:null,method:null,data:null,mergeData:true,fieldName:null,fileSizeMin:1,fileSizeMax:null,allowDuplicates:false,buttonImage:null,fileListMax:0,fileListSizeMax:0,instantStart:false,appendCookieData:false,fileClass:null},initialize:function(b){this.addEvent("load",this.initializeSwiff,true).addEvent("select",this.processFiles,true).addEvent("complete",this.update,true).addEvent("fileRemove",function(d){this.fileList.erase(d)}.bind(this),true);this.setOptions(b);if(this.options.callBacks){Hash.each(this.options.callBacks,function(e,d){this.addEvent(d,e)},this)}this.options.callBacks={fireCallback:this.fireCallback.bind(this)};var c=this.options.path;if(!c.contains("?")){c+="?noCache="+$time()}this.options.container=this.box=new Element("span",{"class":"swiff-uploader-box"}).inject($(this.options.container)||document.body);this.target=$(this.options.target);if(this.target){var a=window.getScroll();this.box.setStyles({position:"absolute",visibility:"visible",zIndex:this.options.zIndex,overflow:"hidden",height:1,width:1,top:a.y,left:a.x});this.parent(c,{params:{wMode:"transparent"},height:"100%",width:"100%"});this.target.addEvent("mouseenter",this.reposition.bind(this,[]));this.addEvents({buttonEnter:this.targetRelay.bind(this,["mouseenter"]),buttonLeave:this.targetRelay.bind(this,["mouseleave"]),buttonDown:this.targetRelay.bind(this,["mousedown"]),buttonDisable:this.targetRelay.bind(this,["disable"])});this.reposition();window.addEvent("resize",this.reposition.bind(this,[]))}else{this.parent(c)}this.inject(this.box);this.fileList=[];this.size=this.uploading=this.bytesLoaded=this.percentLoaded=0;if(Browser.Plugins.Flash.version<9){this.fireEvent("fail",["flash"])}else{this.verifyLoad.delay(500,this)}},verifyLoad:function(){if(this.loaded){return}if(!this.object.parentNode){this.fireEvent("fail",["disabled"])}else{if(this.object.style.display=="none"){this.fireEvent("fail",["hidden"])}else{if(!this.object.offsetWidth){this.fireEvent("fail",["empty"])}}}},fireCallback:function(b,a){if(b.substr(0,4)=="file"){if(a.length>1){this.update(a[1])}var e=a[0];var c=this.findFile(e.id);this.fireEvent(b,c||e,5);if(c){var d=b.replace(/^file([A-Z])/,function(g,f){return f.toLowerCase()});c.update(e).fireEvent(d,[e],10)}}else{this.fireEvent(b,a,5)}},update:function(a){$extend(this,a);this.fireEvent("queue",[this],10);return this},findFile:function(b){for(var a=0;a=0;e--){j=Math.floor(a/f[e].min);if(j){g.push(j+" "+f[e].unit);a-=j*f[e].min;if(!a){break}}}return(b===false)?g:g.join(b||", ")}for(e=d-1;e>=0;e--){j=f[e].min;if(a>=j){break}}return(a/j).toFixed(1)+" "+f[e].unit+c}});Swiff.Uploader.qualifyPath=(function(){var a;return function(b){(a||(a=new Element("a"))).href=b;return a.href}})();Swiff.Uploader.File=new Class({Implements:Events,initialize:function(b,a){this.base=b;this.update(a)},update:function(a){return $extend(this,a)},validate:function(){var a=this.base.options;if(a.fileListMax&&this.base.fileList.length>=a.fileListMax){this.validationError="fileListMax";return false}if(a.fileListSizeMax&&(this.base.size+this.size)>a.fileListSizeMax){this.validationError="fileListSizeMax";return false}return true},invalidate:function(){this.invalid=true;this.base.fireEvent("fileInvalid",this,10);return this.fireEvent("invalid",this,10)},render:function(){return this},setOptions:function(a){if(a){if(a.url){a.url=Swiff.Uploader.qualifyPath(a.url)}this.base.remote("fileSetOptions",this.id,a);this.options=$merge(this.options,a)}return this},start:function(){this.base.fileStart(this);return this},stop:function(){this.base.fileStop(this);return this},remove:function(){this.base.fileRemove(this);return this},requeue:function(){this.base.fileRequeue(this)}});FileManager.implement({options:{resizeImages:true,upload:true,uploadAuthData:{}},hooks:{show:{upload:function(){this.startUpload()}},cleanup:{upload:function(){if(!this.options.upload||!this.upload){return}if(this.upload.uploader){this.upload.uploader.set("opacity",0).dispose()}}}},onDialogOpen:function(){if(this.swf&&this.swf.box){this.swf.box.setStyle("visibility","hidden")}},onDialogClose:function(){if(this.swf&&this.swf.box){this.swf.box.setStyle("visibility","visible")}},startUpload:function(){if(!this.options.upload||this.swf){return}var c=this;this.upload={button:this.addMenuButton("upload").addEvents({click:function(){return false},mouseenter:function(){this.addClass("hover")},mouseleave:function(){this.removeClass("hover");this.blur()},mousedown:function(){this.focus()}}),list:new Element("ul",{"class":"filemanager-uploader-list"}),uploader:new Element("div",{opacity:0}).adopt(new Element("h2",{text:this.language.upload}),new Element("div",{"class":"filemanager-uploader"}))};this.upload.uploader.getElement("div").adopt(this.upload.list);this.closeIcon.appearOn(this.upload.button,0.8);if(this.options.resizeImages){var d=new Element("div",{"class":"checkbox"}),b=(function(){this.toggleClass("checkboxChecked")}).bind(d);b();this.upload.label=new Element("label").adopt(d,new Element("span",{text:this.language.resizeImages})).addEvent("click",b).inject(this.menu)}var a=new Class({Extends:Swiff.Uploader.File,initialize:function(f,e){this.parent(f,e);this.setOptions({url:c.options.url+"?"+Hash.toQueryString($merge({},c.options.uploadAuthData,{event:"upload",directory:c.normalize(c.Directory),resize:c.options.resizeImages&&d.hasClass("checkboxChecked")?1:0}))})},render:function(){if(this.invalid){var i=c.language.uploader.unknown,h={name:this.name,size:Swiff.Uploader.formatUnit(this.size,"b")};if(c.language.uploader[this.validationError]){i=c.language.uploader[this.validationError]}if(this.validationError=="sizeLimitMin"){h.size_min=Swiff.Uploader.formatUnit(this.base.options.fileSizeMin,"b")}else{if(this.validationError=="sizeLimitMax"){h.size_max=Swiff.Uploader.formatUnit(this.base.options.fileSizeMax,"b")}}new Dialog(new Element("div",{html:i.substitute(h,/\\?\$\{([^{}]+)\}/g)}),{language:{confirm:c.language.ok},buttons:["confirm"]});return this}this.addEvents({open:this.onOpen,remove:this.onRemove,requeue:this.onRequeue,progress:this.onProgress,stop:this.onStop,complete:this.onComplete});this.ui={};this.ui.icon=new Asset.image(c.options.assetBasePath+"Icons/"+this.extension+".png",{onerror:function(){new Asset.image(c.options.assetBasePath+"Icons/default.png").replaces(this)}});this.ui.element=new Element("li",{"class":"file",id:"file-"+this.id});this.ui.title=new Element("span",{"class":"file-title",text:this.name});this.ui.size=new Element("span",{"class":"file-size",text:Swiff.Uploader.formatUnit(this.size,"b")});var e,g=this;this.ui.cancel=new Asset.image(c.options.assetBasePath+"cancel.png",{"class":"file-cancel",title:c.language.cancel}).addEvent("click",function(){g.remove();e.hide();e.detach(this)});e=new FileManager.Tips(this.ui.cancel);var f=new Element("img",{"class":"file-progress",src:c.options.assetBasePath+"bar.gif"});this.ui.element.adopt(this.ui.cancel,f,this.ui.icon,this.ui.title,this.ui.size).inject(c.upload.list).highlight();this.ui.progress=new Fx.ProgressBar(f).set(0);this.base.reposition();return this.parent()},onOpen:function(){this.ui.element.addClass("file-running")},onRemove:function(){this.ui=this.ui.element.destroy()},onProgress:function(){this.ui.progress.start(this.progress.percentLoaded)},onStop:function(){this.remove()},onComplete:function(){this.ui.progress=this.ui.progress.cancel().element.destroy();this.ui.cancel=this.ui.cancel.destroy();var e=JSON.decode(this.response.text);if(!e.status){new Dialog((""+e.error).substitute(c.language,/\\?\$\{([^{}]+)\}/g),{language:{confirm:c.language.ok},buttons:["confirm"]})}this.ui.element.set("tween",{duration:2000}).highlight(e.status?"#e6efc2":"#f0c2c2");(function(){this.ui.element.setStyle("overflow","hidden").morph({opacity:0,height:0}).get("morph").chain(function(){this.element.destroy();if(!c.upload.list.getElements("li").length){c.upload.uploader.fade(0).get("tween").chain(function(){c.fillInfo()})}})}).delay(5000,this)}});this.swf=new Swiff.Uploader({id:"SwiffFileManagerUpload",path:this.options.assetBasePath+"Swiff.Uploader.swf",queued:false,target:this.upload.button,allowDuplicates:true,instantStart:true,fileClass:a,fileSizeMax:25*1024*1024,onBrowse:function(){},onCancel:function(){},zIndex:this.SwiffZIndex||9999,onSelectSuccess:function(){c.fillInfo();c.info.getElement("h2.filemanager-headline").setStyle("display","none");c.preview.adopt(c.upload.uploader);c.upload.uploader.fade(1)},onComplete:function(){c.load(c.Directory,true)},onFail:function(e){$$(c.upload.button,c.upload.label).dispose();new Dialog(new Element("div",{html:c.language.flash[e]||c.language.flash.flash}),{language:{confirm:c.language.ok},buttons:["confirm"]})}})}});FileManager.Language.en={more:"Details",width:"Width:",height:"Height:",ok:"Ok",open:"Select file",upload:"Upload",create:"Create folder",createdir:"Please specify a folder name:",cancel:"Cancel",information:"Information",type:"Type:",size:"Size:",dir:"Path:",modified:"Last modified:",preview:"Preview",close:"Close",destroy:"Delete",destroyfile:"Are you sure to delete this file?",rename:"Rename",renamefile:"Please enter a new file name:",download:"Download",nopreview:"No preview available",title:"Title:",artist:"Artist:",album:"Album:",length:"Length:",bitrate:"Bitrate:",deselect:"Deselect",nodestroy:"Deleting files has been disabled on this Server.","upload.disabled":"Uploading has been disabled on this Server.","upload.authenticated":"You are not authenticated to upload files.","upload.path":"The specified Upload-Folder does not exist. Please contact the administrator of this Website.","upload.exists":"The specified Upload-Location does already exist. Please contact the administrator of this Website.","upload.mime":"The specified file-type is not allowed.","upload.extension":"The uploaded file has an unknown or forbidden file extension.","upload.size":"The size of the file you uploaded is too big to be processed on this server. Please upload a smaller file.","upload.partial":"The file you uploaded was only partially uploaded, please upload the file again.","upload.nofile":"There was no file specified to be uploaded.","upload.default":"Something went wrong with the File-Upload.",uploader:{unknown:"Unknown Error",sizeLimitMin:'You can not attach "${name}" (${size}), the file size minimum is ${size_min}!',sizeLimitMax:'You can not attach "${name}" (${size}), the file size limit is ${size_max}!'},flash:{hidden:"To enable the embedded uploader, unblock it in your browser and refresh (see Adblock).",disabled:"To enable the embedded uploader, enable the blocked Flash movie and refresh (see Flashblock).",flash:'In order to upload files you need to install Adobe Flash.'},resizeImages:"Resize big images on upload"}; \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Compressed/filemanager-yui-basic.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Compressed/filemanager-yui-basic.js Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,1 @@ +var FileManager=new Class({Implements:[Options,Events],Request:null,Directory:null,Current:null,options:{directory:"",url:null,assetBasePath:null,selectable:false,hideOnClick:false,language:"en"},hooks:{show:{},cleanup:{}},initialize:function(a){this.setOptions(a);this.options.assetBasePath=this.options.assetBasePath.replace(/(\/|\\)*$/,"/");this.droppables=[];this.Directory=this.options.directory;this.language=FileManager.Language[this.options.language]||FileManager.Language.en;this.container=new Element("div",{"class":"filemanager-container filemanager-engine-"+Browser.Engine.name+(Browser.Engine.trident?Browser.Engine.version:"")});this.el=new Element("div",{"class":"filemanager"}).inject(this.container);this.menu=new Element("div",{"class":"filemanager-menu"}).inject(this.el);this.loader=new Element("div",{"class":"loader",opacity:0,tween:{duration:200}}).inject(this.menu);this.browser=new Element("ul",{"class":"filemanager-browser"}).addEvents({click:(function(g){if(g.target.match("ul")){return this.deselect()}if(!g.target||!g.target.getParent("li")){return}var f=g.target.getParent("li").getElement("span");if(!f){return}g.stop();var d=f.retrieve("file");if(f.retrieve("block")){f.eliminate("block");return}else{if(d.mime=="text/directory"){f.addClass("selected");this.load(this.Directory+"/"+d.name);return}}this.fillInfo(d);if(this.Current){this.Current.removeClass("selected")}this.Current=f.addClass("selected");this.switchButton()}).bind(this)}).inject(this.el);if(this.options.selectable){this.addMenuButton("open")}this.addMenuButton("create");this.info=new Element("div",{"class":"filemanager-infos",opacity:0}).inject(this.el);var b=new Element("div",{"class":"filemanager-head"}).adopt([new Element("img",{"class":"filemanager-icon"}),new Element("h1")]);this.info.adopt([b,new Element("h2",{text:this.language.information})]);var c=new Element("dl").adopt([new Element("dt",{text:this.language.modified}),new Element("dd",{"class":"filemanager-modified"}),new Element("dt",{text:this.language.type}),new Element("dd",{"class":"filemanager-type"}),new Element("dt",{text:this.language.size}),new Element("dd",{"class":"filemanager-size"}),new Element("dt",{text:this.language.dir}),new Element("dd",{"class":"filemanager-dir"})]).inject(this.info);this.preview=new Element("div",{"class":"filemanager-preview"});this.info.adopt([new Element("h2",{"class":"filemanager-headline",text:this.language.preview}),this.preview]);this.closeIcon=new Element("div",{"class":"filemanager-close",title:this.language.close,events:{click:this.hide.bind(this)}}).adopt(new Asset.image(this.options.assetBasePath+"destroy.png")).inject(this.el);new FileManager.Tips(this.closeIcon.appearOn(this.closeIcon,[1,0.8]).appearOn(this.el,0.8));this.imageadd=new Asset.image(this.options.assetBasePath+"add.png",{"class":"browser-add"}).set("opacity",0).inject(this.container);this.container.inject(document.body);this.overlay=new Overlay(this.options.hideOnClick?{events:{click:this.hide.bind(this)}}:null);this.bound={keydown:(function(d){if(d.control){this.imageadd.fade(1)}}).bind(this),keyup:(function(){this.imageadd.fade(0)}).bind(this),keyesc:(function(d){if(d.key=="esc"){this.hide()}}).bind(this),scroll:(function(){this.el.center(this.offsets);this.fireEvent("scroll")}).bind(this)}},show:function(a){if(a){a.stop()}this.load(this.Directory);this.overlay.show();this.info.set("opacity",0);(function(){this.container.setStyles({opacity:0,display:"block"});this.el.center(this.offsets);this.fireEvent("show");this.container.set("opacity",1);this.fireHooks("show");window.addEvents({scroll:this.bound.scroll,resize:this.bound.scroll,keyup:this.bound.keyesc})}).delay(500,this)},hide:function(a){if(a){a.stop()}this.overlay.hide();this.browser.empty();this.container.setStyle("display","none");this.fireHooks("cleanup").fireEvent("hide");window.removeEvent("scroll",this.bound.scroll).removeEvent("resize",this.bound.scroll).removeEvent("keyup",this.bound.keyesc)},open:function(a){a.stop();if(!this.Current){return false}this.fireEvent("complete",[this.normalize(this.Directory+"/"+this.Current.retrieve("file").name),this.Current.retrieve("file")]);this.hide()},create:function(b){b.stop();var a=this;new Dialog(this.language.createdir,{language:{confirm:this.language.create,decline:this.language.cancel},content:[new Element("input",{"class":"createDirectory"})],onOpen:this.onDialogOpen.bind(this),onClose:this.onDialogClose.bind(this),onShow:function(){var c=this;this.el.getElement("input").addEvent("keyup",function(d){if(d.key=="enter"){c.el.getElement("button-confirm").fireEvent("click")}}).focus()},onConfirm:function(){new FileManager.Request({url:a.options.url+"?event=create",onSuccess:a.fill.bind(a),data:{file:this.el.getElement("input").get("value"),directory:a.Directory}},a).post()}})},deselect:function(a){if(a&&this.Current!=a){return}if(a){this.fillInfo()}if(this.Current){this.Current.removeClass("selected")}this.Current=null;this.switchButton()},load:function(a,b){this.deselect();if(!b){this.info.fade(0)}if(this.Request){this.Request.cancel()}this.Request=new FileManager.Request({url:this.options.url,onSuccess:(function(c){this.fill(c,b)}).bind(this),data:{directory:a}},this).post()},destroy:function(c,b){c.stop();var a=this;new Dialog(this.language.destroyfile,{language:{confirm:this.language.destroy,decline:this.language.cancel},onOpen:this.onDialogOpen.bind(this),onClose:this.onDialogClose.bind(this),onConfirm:function(){new FileManager.Request({url:a.options.url+"?event=destroy",data:{file:b.name,directory:a.Directory},onSuccess:function(d){if(!d||d.content!="destroyed"){new Dialog(a.language.nodestroy,{language:{confirm:a.language.ok},buttons:["confirm"]});return}a.fireEvent("modify",[$unlink(b)]);b.element.getParent().fade(0).get("tween").chain(function(){a.deselect(b.element);this.element.destroy()})}},a).post()}})},rename:function(d,c){d.stop();var b=c.name;if(c.mime!="text/directory"){b=b.replace(/\..*$/,"")}var a=this;new Dialog(this.language.renamefile,{language:{confirm:this.language.rename,decline:this.language.cancel},content:[new Element("input",{"class":"rename",value:b})],onOpen:this.onDialogOpen.bind(this),onClose:this.onDialogClose.bind(this),onShow:function(){var e=this;this.el.getElement("input").addEvent("keyup",function(f){if(f.key=="enter"){e.el.getElement("button-confirm").fireEvent("click")}}).focus()},onConfirm:function(){new FileManager.Request({url:a.options.url+"?event=move",onSuccess:(function(e){if(!e||!e.name){return}a.fireEvent("modify",[$unlink(c)]);c.element.getElement("span").set("text",e.name);c.name=e.name;a.fillInfo(c)}).bind(this),data:{file:c.name,name:this.el.getElement("input").get("value"),directory:a.Directory}},a).post()}})},fill:function(c,e){this.Directory=c.path;this.CurrentDir=c.dir;if(!e){this.fillInfo(c.dir)}this.browser.empty();if(!c.files){return}var d=[[],[]];$each(c.files,function(g){g.dir=c.path;var h=g.element=new Element("span",{"class":"fi",href:"#"}).adopt(new Asset.image(this.options.assetBasePath+"Icons/"+g.icon+".png"),new Element("span",{text:g.name})).store("file",g);var f=[];if(g.mime!="text/directory"){f.push(new Asset.image(this.options.assetBasePath+"disk.png",{title:this.language.download}).addClass("browser-icon").addEvent("click",(function(i){i.stop();window.open(this.normalize(this.Directory+"/"+g.name))}).bind(this)).inject(h,"top"))}if(g.name!=".."){["rename","destroy"].each(function(i){f.push(new Asset.image(this.options.assetBasePath+i+".png",{title:this.language[i]}).addClass("browser-icon").addEvent("click",this[i].bindWithEvent(this,[g])).injectTop(h))},this)}d[g.mime=="text/directory"?1:0].push(h);if(g.name==".."){h.set("opacity",0.7)}h.inject(new Element("li").inject(this.browser));f=$$(f.map(function(i){return i.appearOn(i,[1,0.7])})).appearOn(h.getParent("li"),0.7)},this);var b=this;$$(d[0]).makeDraggable({droppables:$$(this.droppables,d[1]),onDrag:function(f,g){b.imageadd.setStyles(Hash.getValues(g.page).map(function(h){return h+15}).associate(["left","top"]))},onBeforeStart:function(f){f.setStyles({left:"0",top:"0"})},onStart:function(f){b.onDragStart(f,this);f.set("opacity",0.7);document.addEvents({keydown:b.bound.keydown,keyup:b.bound.keyup})},onEnter:function(f,g){g.addClass("droppable")},onLeave:function(f,g){g.removeClass("droppable")},onDrop:function(h,j,i){document.removeEvents("keydown",b.bound.keydown).removeEvents("keyup",b.bound.keydown);b.imageadd.fade(0);h.set("opacity",1).store("block",true);if(i.control||!j){h.setStyles({left:"0",top:"0"})}if(!j&&!i.control){return}var f;if(j){j.addClass("selected");(function(){j.removeClass("droppable").removeClass("selected")}).delay(300);if(b.onDragComplete(h,j)){return}f=j.retrieve("file")}var g=h.retrieve("file");new FileManager.Request({url:b.options.url+"?event=move",data:{file:g.name,directory:b.Directory,newDirectory:f?f.dir+"/"+f.name:b.Directory,copy:i.control?1:0},onSuccess:function(){if(!f){b.load(b.Directory)}}},b).post();b.fireEvent("modify",[$unlink(g)]);if(!i.control){h.fade(0).get("tween").chain(function(){b.deselect(h);h.getParent().destroy()})}}});$$(d).setStyles({left:"0",top:"0"});var a=new FileManager.Tips(this.browser.getElements("img.browser-icon"));a.tip.removeClass("tip-base")},fillInfo:function(b,d){if(!b){b=this.CurrentDir}if(!d){d=this.Directory}if(!b){return}var a=this.size(b.size);this.info.fade(1).getElement("img").set({src:this.options.assetBasePath+"Icons/"+b.icon+".png",alt:b.mime});this.fireHooks("cleanup");this.preview.empty();this.info.getElement("h1").set("text",b.name);this.info.getElement("dd.filemanager-modified").set("text",b.date);this.info.getElement("dd.filemanager-type").set("text",b.mime);this.info.getElement("dd.filemanager-size").set("text",!a[0]&&a[1]=="Bytes"?"-":(a.join(" ")+(a[1]!="Bytes"?" ("+b.size+" Bytes)":"")));this.info.getElement("h2.filemanager-headline").setStyle("display",b.mime=="text/directory"?"none":"block");var e=[],c=[];d.split("/").each(function(f){if(!f){return}c.push(f);e.push(new Element("a",{"class":"icon",href:"#",text:f}).addEvent("click",(function(h,g){h.stop();this.load(g)}).bindWithEvent(this,[c.join("/")])));e.push(new Element("span",{text:" / "}))},this);e.pop();e[e.length-1].addClass("selected").removeEvents("click").addEvent("click",function(f){f.stop()});this.info.getElement("dd.filemanager-dir").empty().adopt(new Element("span",{text:"/ "}),e);if(b.mime=="text/directory"){return}if(this.Request){this.Request.cancel()}this.Request=new FileManager.Request({url:this.options.url+"?event=detail",onSuccess:(function(f){var h=this.preview.removeClass("filemanager-loading").set("html",f&&f.content?f.content.substitute(this.language,/\\?\$\{([^{}]+)\}/g):"").getElement("img.prev");if(h){h.addEvent("load",function(){this.setStyle("background","none")})}var g=this.preview.getElements("button");if(g){g.addEvent("click",function(i){i.stop();window.open(this.get("value"))})}}).bind(this),data:{directory:this.Directory,file:b.name}},this).post()},size:function(b){var c=["Bytes","KB","MB","GB","TB"];for(var a=0;b>1024;a++){b=b/1024}return[Math.round(b),c[a]]},normalize:function(a){return a.replace(/\/+/g,"/")},switchButton:function(){var a=!!this.Current;var b=this.menu.getElement("button.filemanager-open");if(b){b.set("disabled",!a)[(a?"remove":"add")+"Class"]("disabled")}},addMenuButton:function(a){var b=new Element("button",{"class":"filemanager-"+a,text:this.language[a]}).inject(this.menu);if(this[a]){b.addEvent("click",this[a].bind(this))}return b},fireHooks:function(c){var a=Array.slice(arguments,1);for(var b in this.hooks[c]){this.hooks[c][b].apply(this,a)}return this},onRequest:function(){this.loader.set("opacity",1)},onComplete:function(){this.loader.fade(0)},onDialogOpen:$empty,onDialogClose:$empty,onDragStart:$empty,onDragComplete:$lambda(false)});FileManager.Language={};if(!window.FileManager){var FileManager={}}FileManager.Tips=new Class({Extends:Tips,options:{offsets:{x:15,y:0},text:null,onShow:function(b,a){if(b.get("opacity")==0.8&&b.getStyle("visibility")=="visible"){return}b.get("tween").pause();b.set({opacity:0,tween:{duration:200,link:"cancel"}}).fade(0.8)},onHide:function(b,a){b.get("tween").pause().start("opacity",0).chain(function(){b.setStyle("left",0)})}},initialize:function(b,a){this.parent(b,a);this.tip.addClass("tip-filebrowser")}});FileManager.Request=new Class({Extends:Request.JSON,initialize:function(a,b){this.parent(a);if(b){this.addEvents({request:b.onRequest.bind(b),complete:b.onComplete.bind(b)})}}});Element.implement({appearOn:function(c,b,a){b=$type(b)=="array"?[b[0]||1,b[1]||0]:[b||1,0];this.set({opacity:b[1],tween:a||{duration:200}});$(c).addEvents({mouseenter:this.fade.bind(this,b[0]),mouseleave:this.fade.bind(this,b[1])});return this},center:function(e){var a=document.getScroll(),g=document.getSize(),c=this.getSize(),b={x:"left",y:"top"};if(!e){e={}}for(var f in b){var d=a[f]+(g[f]-c[f])/2+(e[f]||0);this.setStyle(b[f],d<10?10:d)}return this}});var Dialog=new Class({Implements:[Options,Events],options:{request:null,buttons:["confirm","decline"],language:{}},initialize:function(b,a){this.setOptions(a);this.el=new Element("div",{"class":"dialog dialog-engine-"+Browser.Engine.name+(Browser.Engine.trident?Browser.Engine.version:""),opacity:0,tween:{duration:250}}).adopt([$type(b)=="string"?new Element("div",{text:b}):b]);if(this.options.content){this.el.getElement("div").adopt(this.options.content)}Array.each(this.options.buttons,function(c){new Element("button",{"class":"dialog-"+c,text:this.options.language[c]}).addEvent("click",(function(d){if(d){d.stop()}this.fireEvent(c).fireEvent("close");this.overlay.hide();this.destroy()}).bind(this)).inject(this.el)},this);this.overlay=new Overlay({"class":"overlay overlay-dialog",events:{click:this.fireEvent.bind(this,["close"])},tween:{duration:250}});this.bound={scroll:(function(){if(!this.el){this.destroy()}else{this.el.center()}}).bind(this),keyesc:(function(c){if(c.key=="esc"){this.fireEvent("close").destroy()}}).bind(this)};this.show()},show:function(){this.overlay.show();var a=this.fireEvent("open");this.el.setStyle("display","block").inject(document.body).center().fade(1).get("tween").chain(function(){a.fireEvent("show")});window.addEvents({scroll:this.bound.scroll,resize:this.bound.scroll,keyup:this.bound.keyesc})},destroy:function(){if(this.el){this.el.fade(0).get("tween").chain((function(){this.overlay.destroy();this.el.destroy()}).bind(this))}window.removeEvent("scroll",this.bound.scroll).removeEvent("resize",this.bound.scroll).removeEvent("keyup",this.bound.keyesc)}}),Overlay=new Class({initialize:function(a){this.el=new Element("div",$extend({"class":"overlay"},a)).inject(document.body)},show:function(){this.objects=$$("object, select, embed").filter(function(a){return a.id=="SwiffFileManagerUpload"||a.style.visibility=="hidden"?false:!!(a.style.visibility="hidden")});this.resize=(function(){if(!this.el){this.destroy()}else{this.el.setStyles({width:document.getScrollWidth(),height:document.getScrollHeight()})}}).bind(this);this.resize();this.el.setStyles({opacity:0,display:"block"}).get("tween").pause().start("opacity",0.5);window.addEvent("resize",this.resize);return this},hide:function(){this.el.fade(0).get("tween").chain((function(){this.revertObjects();this.el.setStyle("display","none")}).bind(this));window.removeEvent("resize",this.resize);return this},destroy:function(){this.revertObjects().el.destroy()},revertObjects:function(){if(this.objects&&this.objects.length){this.objects.each(function(a){a.style.visibility="visible"})}return this}});FileManager.TinyMCE=function(a){return function(f,b,d,e){var c=new FileManager($extend({onComplete:function(g){if(!e.document){return}e.document.getElementById(f).value=g;if(e.ImageDialog){e.ImageDialog.showPreviewImage(g,1)}this.container.destroy()}},a(d)));c.el.setStyle("zIndex",400001);c.overlay.el.setStyle("zIndex",400000);c.show()}};FileManager.implement("SwiffZIndex",400002);var Dialog=new Class({Extends:Dialog,initialize:function(b,a){this.parent(b,a);this.el.setStyle("zIndex",400010);this.overlay.el.setStyle("zIndex",400009)}});FileManager.Language.en={more:"Details",width:"Width:",height:"Height:",ok:"Ok",open:"Select file",upload:"Upload",create:"Create folder",createdir:"Please specify a folder name:",cancel:"Cancel",information:"Information",type:"Type:",size:"Size:",dir:"Path:",modified:"Last modified:",preview:"Preview",close:"Close",destroy:"Delete",destroyfile:"Are you sure to delete this file?",rename:"Rename",renamefile:"Please enter a new file name:",download:"Download",nopreview:"No preview available",title:"Title:",artist:"Artist:",album:"Album:",length:"Length:",bitrate:"Bitrate:",deselect:"Deselect",nodestroy:"Deleting files has been disabled on this Server.","upload.disabled":"Uploading has been disabled on this Server.","upload.authenticated":"You are not authenticated to upload files.","upload.path":"The specified Upload-Folder does not exist. Please contact the administrator of this Website.","upload.exists":"The specified Upload-Location does already exist. Please contact the administrator of this Website.","upload.mime":"The specified file-type is not allowed.","upload.extension":"The uploaded file has an unknown or forbidden file extension.","upload.size":"The size of the file you uploaded is too big to be processed on this server. Please upload a smaller file.","upload.partial":"The file you uploaded was only partially uploaded, please upload the file again.","upload.nofile":"There was no file specified to be uploaded.","upload.default":"Something went wrong with the File-Upload.",uploader:{unknown:"Unknown Error",sizeLimitMin:'You can not attach "${name}" (${size}), the file size minimum is ${size_min}!',sizeLimitMax:'You can not attach "${name}" (${size}), the file size limit is ${size_max}!'},flash:{hidden:"To enable the embedded uploader, unblock it in your browser and refresh (see Adblock).",disabled:"To enable the embedded uploader, enable the blocked Flash movie and refresh (see Flashblock).",flash:'In order to upload files you need to install Adobe Flash.'},resizeImages:"Resize big images on upload"}; \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Css/Additions.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Css/Additions.css Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,116 @@ +/* TIPS */ +.tip-filebrowser { + z-index: 1201; +} +.tip-filebrowser .tip { + background: #000; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; +} + +.tip-filebrowser .tip-title { + color: #fff; + font-size: 11px; + padding: 1px 4px; + line-height: 21px; + text-align: center; + font-weight: bold; +} + +.tip-filebrowser .tip-text { + display: none; +} + +/* Overlay */ +div.overlay { + position: absolute; + left: 0; + top: 0; + display: none; + + z-index: 999; + background: #000; +} + +/* Dialog */ +div.overlay-dialog { + z-index: 1999; + background: #fff; +} + +div.dialog-engine-trident4 { width: 249px; } + +div.dialog { + position: absolute; + display: none; + z-index: 2000; + + width: 229px; + height: 121px; + + color: #bebebe; + font-family: Tahoma, sans-serif; + font-size: 12px; + background: url(../Assets/dialog.png) no-repeat; +} +div.dialog a { + color: #aaa; +} +div.dialog a:hover { + text-decoration: none; +} + +div.dialog div { + margin: 10px; +} + +div.dialog input, div.dialog select { + width: 94%; + margin: 20px 2%; + padding: 2px 1%; + border: 1px solid #bebebe; + background: #fff; + + color: #333; + font-family: Tahoma, sans-serif; + font-size: 12px; +} + +div.dialog-engine-trident4 input, div.dialog-engine-trident5 input { + width: 80%; +} + +div.dialog button { + position: absolute; + bottom: 15px; + right: 15px; + + width: auto; + height: 22px; + padding: 2px; + border: 1px solid #bebebe; + + cursor: pointer; + color: #333; + text-shadow: #eee 1px 1px 1px; + + font-family: Tahoma, sans-serif; + letter-spacing: 0; + font-size: 12px; + font-weight: normal; + margin: 0; + background: url(../Assets/button.png) repeat-x; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; +} +div.dialog-engine-trident4 button, div.dialog-engine-trident5 button { + padding: 0 .25em; + overflow: visible; +} + +div.dialog button.dialog-decline { + right: auto; + left: 15px; +} \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Css/FileManager.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Css/FileManager.css Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,388 @@ +div.filemanager-container { display: none; } +div.filemanager * { outline: 0; } +div.filemanager a img { border: 0 } + +div.filemanager, div.filemanager button, div.filemanager label, div.filemanager h1 { + width: auto; + margin: 0; + + font-family: Tahoma, sans-serif; + font-size: 12px; + font-weight: normal; + text-transform: none; + letter-spacing: 0; +} + +div.filemanager { + border: 1px solid #bebebe; + background: #eee; + + position: absolute; + z-index: 1001; + width: 800px; + height: 450px; +} + +div.filemanager div.filemanager-menu { + position: absolute; + height: 30px; + left: 30%; + width: 70%; + bottom: 0; + line-height: 30px; + + border-top: 1px solid #bebebe; + background: url(../Assets/menu.png) repeat-x; +} + +div.filemanager button { + cursor: pointer; + height: 22px; + line-height: 20px; + margin: 4px 5px; + padding: 0 5px; + + color: #FFF; + + clear: none; + background: url(../Assets/button.png) repeat-x; + border: 1px solid #a1aeb9; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; +} +div.filemanager-engine-trident4 button, div.filemanager-engine-trident5 button { + padding: 0 .25em; + overflow: visible; +} + +div.filemanager-menu button { + float: right; +} + +div.filemanager button:hover, div.filemanager button.hover, div.filemanager button:focus { + border: 1px solid #5f676e; +} + +div.filemanager button.disabled, div.filemanager button.disabled:hover, div.filemanager button.disabled:focus { + cursor: default; + color: #666; + text-shadow: none; + background: url(../Assets/button_disabled.png) repeat-x; + border-color: #bababa; +} + +div.filemanager button.filemanager-open { + font-weight: bold; +} + +div.filemanager-menu label { + cursor: pointer; + float: right; + font-size: 11px; + width: auto; +} + +div.filemanager-menu div.loader { + float: left; + width: 16px; + height: 16px; + margin: 8px 0; + background: url(../Assets/loader.gif) no-repeat; +} + +div.filemanager ul { + margin: 0; + padding: 0; + position: relative; + line-height: 1.8em; + overflow: auto; + overflow-x: hidden; + zoom: 1; +} + +div.filemanager ul li { + background: none; + list-style-image: none; + list-style-type: none; + list-style: none; + line-height: 1.8em; + margin: 0; + padding: 0; + height: 21px; + white-space: nowrap; +} + +div.filemanager ul.filemanager-browser { + left: 0px; + top: 0px; + height: 100%; + width: 30%; + + border: 0; + border-right: 1px solid #bebebe; + background: url(../Assets/filelist.png) repeat-x #c1c7cf; +} + +div.filemanager ul li span.fi { + height: 21px; + padding-left: 5px; + color: #000; + text-decoration: none; + display: block; + white-space: nowrap; + cursor: pointer; +} + +div.filemanager ul li span.fi span { + white-space: nowrap; + display: block; + width: 90%; + overflow: hidden; +} + +div.filemanager-engine-trident4 ul li span.fi span, div.filemanager-engine-trident5 ul li span.fi span, div.filemanager-engine-presto ul li span.fi span, div.filemanager ul li:hover span.fi span { + width: 65%; + overflow: hidden; +} + +div.filemanager ul li span.dir { + background-color: transparent; +} + +div.filemanager ul li span.droppable { + background-color: #99b7e7; +} + +ul.filemanager-browser a, ul.filemanager-browser span { + position: relative; +} + +div.filemanager ul li a.selected, div.filemanager ul li span.selected { + background: url(../Assets/filelist_selected.png) repeat-x; + color: #eee; + outline: none; +} + +div.filemanager ul li img { + display: block; + float: left; + margin: 3px 3px 0 0; +} + +div.filemanager ul li img.browser-icon { + float: right; +} + +div.filemanager span.notice { + position: absolute; + bottom: 16px; + left: 16px; +} + +div.filemanager div.filemanager-close { + position: absolute; + right: -10px; + top: -10px; + height: 20px; + width: 20px; + + cursor: pointer; + background: url(../Assets/button.png) repeat-x; + border: 1px solid #a1aeb9; + -moz-border-radius: 10px; + -webkit-border-radius: 10px; + border-radius: 10px; +} +div.filemanager div.filemanager-close img { + padding: 2px; +} + +div.filemanager-infos { + position: absolute; + left: 30%; + top: 0; + width: 70%; + line-height: 1.6em; + overflow: auto; +} + +div.filemanager-head { + height: 32px; + overflow: hidden; +} + +img.filemanager-icon { + float: left; + margin: 10px 12px; +} + +div.filemanager h1 { + margin: 0; + padding: 0; + width: 80%; + height: 32px; + line-height: 32px; + + color: #333; + font-size: 20px; + letter-spacing: 1px; + overflow: hidden; + white-space: nowrap; + background-color: transparent; +} + +div.filemanager h2 { + margin: 0; + border-top: 1px solid #bebebe; + font-size: 14px; + font-weight: bold; + padding: 2px 0 0 5px; + clear: both; +} + +div.filemanager dl { + margin: 5px 0; + width: 100%; + clear: both; + overflow: auto; +} + +div.filemanager dt, div.filemanager dd { + float: left; + line-height: 20px; + font-size: 11px; +} + +div.filemanager dt { + clear: both; + width: 22%; + margin-left: 5%; + font-weight: bold; +} + +div.filemanager dd { + width: 60%; + white-space: nowrap; + overflow: auto; +} + +div.filemanager div.margin { + margin-left: 15px; +} + +div.filemanager dd.filemanager-dir a.icon { + border: 1px solid #bebebe; + padding: 2px 5px 2px 20px; + text-decoration: none; + background: #eee url(../Assets/Icons/dir.png) 2px 0 no-repeat; + color: #000; + + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} + +div.filemanager dd.filemanager-dir a.icon:hover { + text-decoration: none; + background-color: #fff; +} + +div.filemanager dd.filemanager-dir a.selected, div.filemanager dd.filemanager-dir a.selected:hover { + margin: 0 1px; + background-color: transparent; + border: none; + cursor: auto; +} + +div.filemanager-preview { + margin-top: 5px; +} + +div.filemanager-preview img.preview { + margin: 0 auto 1em; + display: block; + max-height: 100px; +} + +div.filemanager-engine-trident4 div.filemanager-preview img.preview { + height: 100px; +} + +div.filemanager-preview ul, div.filemanager-preview div.textpreview { + border: 1px solid #bebebe; + background: #fff; + + padding: 2px; + margin: 1em auto; + + width: 490px; + height: 220px; + overflow: auto; +} + +div.filemanager-preview div.textpreview { + font: 9px Verdana, Arial, Helvetica, sans-serif; +} + +div.filemanager-preview div.object { + width: 200px; + height: 20px; + border: 1px solid #bebebe; + margin: 0 0 1em 190px; + overflow: hidden; +} + +div.filemanager-container img.browser-add { + position: absolute; + width: 16px; + height: 16px; + z-index: 1010; +} + +/* UPLOAD */ +div.filemanager-container .file span { + padding: 0 5px 0 0; +} + +div.filemanager-container .file .file-size { + color: #666; +} + +div.filemanager-container .file .file-cancel { + cursor: pointer; + padding-left: 5px; + float: right; +} +div.filemanager-container .file .file-progress { + margin-top: 5px; + float: right; + width: 125px; + height: 12px; + background-image: url(../Assets/progress.gif); +} + +div.filemanager div.checkbox { + float: left; + height: 12px; + width: 16px; + margin: 10px 3px 0; + background: url(../Assets/checkbox.png) no-repeat; +} + +div.filemanager div.checkboxChecked { + background-position: 0 -12px; +} + +/* SELECTED FILE */ +div.selected-file img { + vertical-align: bottom; + padding: 0 3px 0 0; +} +div.selected-file span { + line-height: 16px; +} +div.selected-file .file-cancel { + cursor: pointer; + padding: 0 0 0 5px; +} \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Galleries/gallery1/DSC_0670.jpg Binary file e2gallerypro/e2upload/Galleries/gallery1/DSC_0670.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Galleries/gallery1/DSC_2051.jpg Binary file e2gallerypro/e2upload/Galleries/gallery1/DSC_2051.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Galleries/gallery1/DSC_2343.jpg Binary file e2gallerypro/e2upload/Galleries/gallery1/DSC_2343.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Galleries/gallery1/DSC_7850.jpg Binary file e2gallerypro/e2upload/Galleries/gallery1/DSC_7850.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Galleries/gallery1/E29_2000.jpg Binary file e2gallerypro/e2upload/Galleries/gallery1/E29_2000.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Galleries/gallery1/large/DSC_0670.jpg Binary file e2gallerypro/e2upload/Galleries/gallery1/large/DSC_0670.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Galleries/gallery1/large/DSC_2051.jpg Binary file e2gallerypro/e2upload/Galleries/gallery1/large/DSC_2051.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Galleries/gallery1/large/DSC_2343.jpg Binary file e2gallerypro/e2upload/Galleries/gallery1/large/DSC_2343.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Galleries/gallery1/large/DSC_7850.jpg Binary file e2gallerypro/e2upload/Galleries/gallery1/large/DSC_7850.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Galleries/gallery1/large/E29_2000.jpg Binary file e2gallerypro/e2upload/Galleries/gallery1/large/E29_2000.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Galleries/gallery1/mainthumb.jpg Binary file e2gallerypro/e2upload/Galleries/gallery1/mainthumb.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Galleries/gallery1/thumbs/DSC_0670.jpg Binary file e2gallerypro/e2upload/Galleries/gallery1/thumbs/DSC_0670.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Galleries/gallery1/thumbs/DSC_2051.jpg Binary file e2gallerypro/e2upload/Galleries/gallery1/thumbs/DSC_2051.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Galleries/gallery1/thumbs/DSC_2343.jpg Binary file e2gallerypro/e2upload/Galleries/gallery1/thumbs/DSC_2343.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Galleries/gallery1/thumbs/DSC_7850.jpg Binary file e2gallerypro/e2upload/Galleries/gallery1/thumbs/DSC_7850.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Galleries/gallery1/thumbs/E29_2000.jpg Binary file e2gallerypro/e2upload/Galleries/gallery1/thumbs/E29_2000.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Galleries/gallery2/mainthumb.jpg Binary file e2gallerypro/e2upload/Galleries/gallery2/mainthumb.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Galleries/prints/Judy_Yates_Buffalo_Verde.jpg Binary file e2gallerypro/e2upload/Galleries/prints/Judy_Yates_Buffalo_Verde.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Galleries/prints/Judy_Yates_Longhorn_Sunset.jpg Binary file e2gallerypro/e2upload/Galleries/prints/Judy_Yates_Longhorn_Sunset.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Galleries/prints/Judy_Yates_Turquoise_Sky.jpg Binary file e2gallerypro/e2upload/Galleries/prints/Judy_Yates_Turquoise_Sky.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Galleries/prints/Judy_Yates_Wood_Duck_Pair.jpg Binary file e2gallerypro/e2upload/Galleries/prints/Judy_Yates_Wood_Duck_Pair.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Galleries/prints/large/Judy_Yates_Buffalo_Verde.jpg Binary file e2gallerypro/e2upload/Galleries/prints/large/Judy_Yates_Buffalo_Verde.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Galleries/prints/large/Judy_Yates_Longhorn_Sunset.jpg Binary file e2gallerypro/e2upload/Galleries/prints/large/Judy_Yates_Longhorn_Sunset.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Galleries/prints/large/Judy_Yates_Turquoise_Sky.jpg Binary file e2gallerypro/e2upload/Galleries/prints/large/Judy_Yates_Turquoise_Sky.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Galleries/prints/large/Judy_Yates_Wood_Duck_Pair.jpg Binary file e2gallerypro/e2upload/Galleries/prints/large/Judy_Yates_Wood_Duck_Pair.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Galleries/prints/thumbs/Judy_Yates_Buffalo_Verde.jpg Binary file e2gallerypro/e2upload/Galleries/prints/thumbs/Judy_Yates_Buffalo_Verde.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Galleries/prints/thumbs/Judy_Yates_Longhorn_Sunset.jpg Binary file e2gallerypro/e2upload/Galleries/prints/thumbs/Judy_Yates_Longhorn_Sunset.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Galleries/prints/thumbs/Judy_Yates_Turquoise_Sky.jpg Binary file e2gallerypro/e2upload/Galleries/prints/thumbs/Judy_Yates_Turquoise_Sky.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Galleries/prints/thumbs/Judy_Yates_Wood_Duck_Pair.jpg Binary file e2gallerypro/e2upload/Galleries/prints/thumbs/Judy_Yates_Wood_Duck_Pair.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Source/Additions.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Source/Additions.js Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,247 @@ +/* +Script: Additions.js + MooTools Additions - Various Helpers, Overlay-Class, Dialog-Class + +License: + MIT-style license. + +Copyright: + Copyright (c) 2009 [Christoph Pojer](http://og5.net/christoph). + +Dependencies: + - MooTools Core 1.2.2 + - MooTools More 1.2.2.1 or newer: Tips.js + +Contains: + - FileManager.Tips: Augmented version of Tips for use within the FileManager + - FileManager.Request: Simple extension to request to always use the loader-icon specified by the FileManager instance + - Element.appearOn: Can be used to show an element when another is hovered: $(myElement).appearOn(myWrapper) + - Element.center: Centers an element + - Dialog, Overlay: Nice Classes used by the FileManager +*/ + +if(!window.FileManager) var FileManager = {}; + +FileManager.Tips = new Class({ + + Extends: Tips, + + options: { + offsets: {x: 15, y: 0}, + text: null, + onShow: function(tip, el){ + if(tip.get('opacity')==0.8 && tip.getStyle('visibility')=='visible') return; + + tip.get('tween').pause(); + tip.set({ + opacity: 0, + tween: { + duration: 200, + link: 'cancel' + } + }).fade(0.8); + }, + + onHide: function(tip, el){ + tip.get('tween').pause().start('opacity', 0).chain(function(){ + tip.setStyle('left', 0); + }); + } + }, + + initialize: function(el, options){ + this.parent(el, options); + this.tip.addClass('tip-filebrowser'); + } + +}); + +FileManager.Request = new Class({ + + Extends: Request.JSON, + + initialize: function(options, filebrowser){ + this.parent(options); + + if(filebrowser) this.addEvents({ + request: filebrowser.onRequest.bind(filebrowser), + complete: filebrowser.onComplete.bind(filebrowser) + }); + } + +}); + +Element.implement({ + + appearOn: function(el, opacity, options){ + opacity = $type(opacity) == 'array' ? [opacity[0] || 1, opacity[1] || 0] : [opacity || 1, 0]; + + this.set({ + opacity: opacity[1], + tween: options || {duration: 200} + }); + + $(el).addEvents({ + mouseenter: this.fade.bind(this, opacity[0]), + mouseleave: this.fade.bind(this, opacity[1]) + }); + + return this; + }, + + center: function(offsets){ + var scroll = document.getScroll(), + offset = document.getSize(), + size = this.getSize(), + values = {x: 'left', y: 'top'}; + + if(!offsets) offsets = {}; + + for(var z in values){ + var style = scroll[z]+(offset[z]-size[z])/2+(offsets[z] || 0); + this.setStyle(values[z], style < 10 ? 10 : style); + } + + return this; + } + +}); + +var Dialog = new Class({ + + Implements: [Options, Events], + + options: { + /*onShow: $empty, + onOpen: $empty, + onConfirm: $empty, + onDecline: $empty, + onClose: $empty,*/ + request: null, + buttons: ['confirm', 'decline'], + language: {} + }, + + initialize: function(text, options){ + this.setOptions(options); + + this.el = new Element('div', { + 'class': 'dialog dialog-engine-'+Browser.Engine.name+(Browser.Engine.trident ? Browser.Engine.version : ''), + opacity: 0, + tween: {duration: 250} + }).adopt([ + $type(text)=='string' ? new Element('div', {text: text}) : text + ]); + + if(this.options.content) this.el.getElement('div').adopt(this.options.content); + + Array.each(this.options.buttons, function(v){ + new Element('button', {'class': 'dialog-'+v, text: this.options.language[v]}).addEvent('click', (function(e){ + if(e) e.stop(); + this.fireEvent(v).fireEvent('close'); + this.overlay.hide(); + this.destroy(); + }).bind(this)).inject(this.el); + }, this); + + this.overlay = new Overlay({ + 'class': 'overlay overlay-dialog', + events: {click: this.fireEvent.bind(this, ['close'])}, + tween: {duration: 250} + }); + + this.bound = { + scroll: (function(){ + if(!this.el) this.destroy(); + else this.el.center(); + }).bind(this), + keyesc: (function(e){ + if(e.key=='esc') this.fireEvent('close').destroy(); + }).bind(this) + }; + + this.show(); + }, + + show: function(){ + this.overlay.show(); + var self = this.fireEvent('open'); + this.el.setStyle('display', 'block').inject(document.body).center().fade(1).get('tween').chain(function(){ + self.fireEvent('show'); + }); + + window.addEvents({ + scroll: this.bound.scroll, + resize: this.bound.scroll, + keyup: this.bound.keyesc + }); + }, + + destroy: function(){ + if(this.el) this.el.fade(0).get('tween').chain((function(){ + this.overlay.destroy(); + this.el.destroy(); + }).bind(this)); + + window.removeEvent('scroll', this.bound.scroll).removeEvent('resize', this.bound.scroll).removeEvent('keyup', this.bound.keyesc); + } + +}), +Overlay = new Class({ + + initialize: function(options){ + this.el = new Element('div', $extend({ + 'class': 'overlay' + }, options)).inject(document.body); + }, + + show: function(){ + this.objects = $$('object, select, embed').filter(function(el){ + return el.id=='SwiffFileManagerUpload' || el.style.visibility=='hidden' ? false : !!(el.style.visibility = 'hidden'); + }); + + this.resize = (function(){ + if(!this.el) this.destroy(); + else this.el.setStyles({ + width: document.getScrollWidth(), + height: document.getScrollHeight() + }); + }).bind(this); + + this.resize(); + + this.el.setStyles({ + opacity: 0, + display: 'block' + }).get('tween').pause().start('opacity', 0.5); + + window.addEvent('resize', this.resize); + + return this; + }, + + hide: function(){ + this.el.fade(0).get('tween').chain((function(){ + this.revertObjects(); + this.el.setStyle('display', 'none'); + }).bind(this)); + + window.removeEvent('resize', this.resize); + + return this; + }, + + destroy: function(){ + this.revertObjects().el.destroy(); + }, + + revertObjects: function(){ + if(this.objects && this.objects.length) + this.objects.each(function(el){ + el.style.visibility = 'visible'; + }); + + return this; + } + +}); \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Source/FileManager.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Source/FileManager.js Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,585 @@ +/* +Script: FileManager.js + MooTools FileManager + +License: + MIT-style license. + +Version: + 1.0rc1 + +Copyright: + Copyright (c) 2009 [Christoph Pojer](http://og5.net/christoph). + +Dependencies: + - MooTools Core 1.2.2 + - MooTools More 1.2.2.1 or newer: Drag.js, Drag.Move.js, Tips.js, Asset.js + - Additions.js + +Todo: + - Add Scroller.js (optional) for Drag&Drop in the Filelist + +Inspiration: + - Loosely based on a Script by [Yannick Croissant](http://dev.k1der.net/dev/brooser-un-browser-de-fichier-pour-mootools/) + +Options: + - url: (string) The base url to the Backend FileManager, without QueryString + - assetBasePath: (string) The path to all images and swf files + - selectable: (boolean, defaults to *false*) If true, provides a button to select a file + - language: (string, defaults to *en*) The language used for the FileManager + - hideOnClick: (boolean, defaults to *false*) When true, hides the FileManager when the area outside of it is clicked + - directory: (string) Can be used to load a subfolder instead of the base folder + +Events: + - onComplete(path, file): fired when a file gets selected via the "Select file" button + - onModify(file): fired when a file gets renamed/deleted or modified in another way + - onShow: fired when the FileManager opens + - onHide: event fired when FileManager closes +*/ + +var FileManager = new Class({ + + Implements: [Options, Events], + + Request: null, + Directory: null, + Current: null, + + options: { + /*onComplete: $empty, + onModify: $empty, + onShow: $empty, + onHide: $empty,*/ + directory: '', + url: null, + assetBasePath: null, + selectable: false, + hideOnClick: false, + language: 'en' + }, + + hooks: { + show: {}, + cleanup: {} + }, + + initialize: function(options){ + this.setOptions(options); + this.options.assetBasePath = this.options.assetBasePath.replace(/(\/|\\)*$/, '/'); + this.droppables = []; + this.Directory = this.options.directory; + + this.language = FileManager.Language[this.options.language] || FileManager.Language.en; + this.container = new Element('div', {'class': 'filemanager-container filemanager-engine-'+Browser.Engine.name+(Browser.Engine.trident ? Browser.Engine.version : '')}); + this.el = new Element('div', {'class': 'filemanager'}).inject(this.container); + this.menu = new Element('div', {'class': 'filemanager-menu'}).inject(this.el); + this.loader = new Element('div', {'class': 'loader', opacity: 0, tween: {duration: 200}}).inject(this.menu); + this.browser = new Element('ul', {'class': 'filemanager-browser'}).addEvents({ + click: (function(e){ + if(e.target.match('ul')) return this.deselect(); + + if(!e.target || !e.target.getParent('li')) return; + var el = e.target.getParent('li').getElement('span'); + if(!el) return; + + e.stop(); + var file = el.retrieve('file'); + if(el.retrieve('block')){ + el.eliminate('block'); + return; + }else if(file.mime=='text/directory'){ + el.addClass('selected'); + this.load(this.Directory+'/'+file.name); + return; + } + + this.fillInfo(file); + if(this.Current) this.Current.removeClass('selected'); + this.Current = el.addClass('selected'); + + this.switchButton(); + }).bind(this) + }).inject(this.el); + + + if(this.options.selectable) this.addMenuButton('open'); + this.addMenuButton('create'); + + this.info = new Element('div', {'class': 'filemanager-infos', opacity: 0}).inject(this.el); + + var head = new Element('div', {'class': 'filemanager-head'}).adopt([ + new Element('img', {'class': 'filemanager-icon'}), + new Element('h1') + ]); + + this.info.adopt([head, new Element('h2', {text: this.language.information})]); + + var list = new Element('dl').adopt([ + new Element('dt', {text: this.language.modified}), + new Element('dd', {'class': 'filemanager-modified'}), + new Element('dt', {text: this.language.type}), + new Element('dd', {'class': 'filemanager-type'}), + new Element('dt', {text: this.language.size}), + new Element('dd', {'class': 'filemanager-size'}), + new Element('dt', {text: this.language.dir}), + new Element('dd', {'class': 'filemanager-dir'}) + ]).inject(this.info); + + this.preview = new Element('div', {'class': 'filemanager-preview'}); + this.info.adopt([ + new Element('h2', {'class': 'filemanager-headline', text: this.language.preview}), + this.preview + ]); + + this.closeIcon = new Element('div', { + 'class': 'filemanager-close', + title: this.language.close, + events: {click: this.hide.bind(this)} + }).adopt(new Asset.image(this.options.assetBasePath+'destroy.png')).inject(this.el); + new FileManager.Tips(this.closeIcon.appearOn(this.closeIcon, [1, 0.8]).appearOn(this.el, 0.8)); + + this.imageadd = new Asset.image(this.options.assetBasePath+'add.png', { + 'class': 'browser-add' + }).set('opacity', 0).inject(this.container); + + this.container.inject(document.body); + this.overlay = new Overlay(this.options.hideOnClick ? { + events: {click: this.hide.bind(this)} + } : null); + this.bound = { + keydown: (function(e){ + if(e.control) this.imageadd.fade(1); + }).bind(this), + keyup: (function(){ + this.imageadd.fade(0); + }).bind(this), + keyesc: (function(e){ + if(e.key=='esc') this.hide(); + }).bind(this), + scroll: (function(){ + this.el.center(this.offsets); + this.fireEvent('scroll'); + }).bind(this) + }; + }, + + show: function(e){ + if(e) e.stop(); + + this.load(this.Directory); + this.overlay.show(); + + this.info.set('opacity', 0); + + (function(){ + this.container.setStyles({ + opacity: 0, + display: 'block' + }); + + this.el.center(this.offsets); + this.fireEvent('show'); + this.container.set('opacity', 1); + this.fireHooks('show'); + + window.addEvents({ + scroll: this.bound.scroll, + resize: this.bound.scroll, + keyup: this.bound.keyesc + }); + }).delay(500, this); + }, + + hide: function(e){ + if(e) e.stop(); + + this.overlay.hide(); + this.browser.empty(); + this.container.setStyle('display', 'none'); + + this.fireHooks('cleanup').fireEvent('hide'); + window.removeEvent('scroll', this.bound.scroll).removeEvent('resize', this.bound.scroll).removeEvent('keyup', this.bound.keyesc); + }, + + open: function(e){ + e.stop(); + + if(!this.Current) return false; + + this.fireEvent('complete', [ + this.normalize(this.Directory+'/'+this.Current.retrieve('file').name), + this.Current.retrieve('file') + ]); + this.hide(); + }, + + create: function(e){ + e.stop(); + + var self = this; + new Dialog(this.language.createdir, { + language: { + confirm: this.language.create, + decline: this.language.cancel + }, + content: [ + new Element('input', {'class': 'createDirectory'}) + ], + onOpen: this.onDialogOpen.bind(this), + onClose: this.onDialogClose.bind(this), + onShow: function(){ + var self = this; + this.el.getElement('input').addEvent('keyup', function(e){ + if(e.key=='enter') self.el.getElement('button-confirm').fireEvent('click'); + }).focus(); + }, + onConfirm: function(){ + new FileManager.Request({ + url: self.options.url+'?event=create', + onSuccess: self.fill.bind(self), + data: { + file: this.el.getElement('input').get('value'), + directory: self.Directory + } + }, self).post(); + } + }); + }, + + deselect: function(el){ + if(el && this.Current!=el) return; + + if(el) this.fillInfo(); + if(this.Current) this.Current.removeClass('selected'); + this.Current = null; + + this.switchButton(); + }, + + load: function(dir, nofade){ + this.deselect(); + if(!nofade) this.info.fade(0); + + if(this.Request) this.Request.cancel(); + + this.Request = new FileManager.Request({ + url: this.options.url, + onSuccess: (function(j){ + this.fill(j, nofade); + }).bind(this), + data: { + directory: dir + } + }, this).post(); + }, + + destroy: function(e, file){ + e.stop(); + + var self = this; + new Dialog(this.language.destroyfile, { + language: { + confirm: this.language.destroy, + decline: this.language.cancel + }, + onOpen: this.onDialogOpen.bind(this), + onClose: this.onDialogClose.bind(this), + onConfirm: function(){ + new FileManager.Request({ + url: self.options.url+'?event=destroy', + data: { + file: file.name, + directory: self.Directory + }, + onSuccess: function(j){ + if(!j || j.content!='destroyed'){ + new Dialog(self.language.nodestroy, {language: {confirm: self.language.ok}, buttons: ['confirm']}); + return; + } + + self.fireEvent('modify', [$unlink(file)]); + file.element.getParent().fade(0).get('tween').chain(function(){ + self.deselect(file.element); + this.element.destroy(); + }); + } + }, self).post(); + } + }); + + }, + + rename: function(e, file){ + e.stop(); + + var name = file.name; + if(file.mime!='text/directory') name = name.replace(/\..*$/, ''); + + var self = this; + new Dialog(this.language.renamefile, { + language: { + confirm: this.language.rename, + decline: this.language.cancel + }, + content: [ + new Element('input', {'class': 'rename', value: name}) + ], + onOpen: this.onDialogOpen.bind(this), + onClose: this.onDialogClose.bind(this), + onShow: function(){ + var self = this; + this.el.getElement('input').addEvent('keyup', function(e){ + if(e.key=='enter') self.el.getElement('button-confirm').fireEvent('click'); + }).focus(); + }, + onConfirm: function(){ + new FileManager.Request({ + url: self.options.url+'?event=move', + onSuccess: (function(j){ + if(!j || !j.name) return; + + self.fireEvent('modify', [$unlink(file)]); + + file.element.getElement('span').set('text', j.name); + file.name = j.name; + self.fillInfo(file); + }).bind(this), + data: { + file: file.name, + name: this.el.getElement('input').get('value'), + directory: self.Directory + } + }, self).post(); + } + }); + }, + + fill: function(j, nofade){ + this.Directory = j.path; + this.CurrentDir = j.dir; + if(!nofade) this.fillInfo(j.dir); + this.browser.empty(); + + if(!j.files) return; + + var els = [[], []]; + $each(j.files, function(file){ + file.dir = j.path; + var el = file.element = new Element('span', {'class': 'fi', href: '#'}).adopt( + new Asset.image(this.options.assetBasePath+'Icons/'+file.icon+'.png'), + new Element('span', {text: file.name}) + ).store('file', file); + + var icons = []; + if(file.mime!='text/directory') + icons.push(new Asset.image(this.options.assetBasePath+'disk.png', {title: this.language.download}).addClass('browser-icon').addEvent('click', (function(e){ + e.stop(); + window.open(this.normalize(this.Directory+'/'+file.name)); + }).bind(this)).inject(el, 'top')); + + if(file.name!='..') + ['rename', 'destroy'].each(function(v){ + icons.push(new Asset.image(this.options.assetBasePath+v+'.png', {title: this.language[v]}).addClass('browser-icon').addEvent('click', this[v].bindWithEvent(this, [file])).injectTop(el)); + }, this); + + els[file.mime=='text/directory' ? 1 : 0].push(el); + if(file.name=='..') el.set('opacity', 0.7); + el.inject(new Element('li').inject(this.browser)); + icons = $$(icons.map(function(icon){ return icon.appearOn(icon, [1, 0.7]); })).appearOn(el.getParent('li'), 0.7); + }, this); + + var self = this; + $$(els[0]).makeDraggable({ + droppables: $$(this.droppables, els[1]), + + onDrag: function(el, e){ + self.imageadd.setStyles(Hash.getValues(e.page).map(function(v){ return v+15; }).associate(['left', 'top'])); + }, + + onBeforeStart: function(el){ + el.setStyles({left: '0', top: '0'}); + }, + + onStart: function(el){ + self.onDragStart(el, this); + + el.set('opacity', 0.7); + document.addEvents({ + keydown: self.bound.keydown, + keyup: self.bound.keyup + }); + }, + + onEnter: function(el, droppable){ + droppable.addClass('droppable'); + }, + + onLeave: function(el, droppable){ + droppable.removeClass('droppable'); + }, + + onDrop: function(el, droppable, e){ + document.removeEvents('keydown', self.bound.keydown).removeEvents('keyup', self.bound.keydown); + + self.imageadd.fade(0); + el.set('opacity', 1).store('block', true); + if(e.control || !droppable) + el.setStyles({left: '0', top: '0'}); + + if(!droppable && !e.control) + return; + + var dir; + if(droppable){ + droppable.addClass('selected'); + (function(){ droppable.removeClass('droppable').removeClass('selected'); }).delay(300); + + if(self.onDragComplete(el, droppable)) + return; + + dir = droppable.retrieve('file'); + } + var file = el.retrieve('file'); + + new FileManager.Request({ + url: self.options.url+'?event=move', + data: { + file: file.name, + directory: self.Directory, + newDirectory: dir ? dir.dir+'/'+dir.name : self.Directory, + copy: e.control ? 1 : 0 + }, + onSuccess: function(){ + if(!dir) self.load(self.Directory); + } + }, self).post(); + + self.fireEvent('modify', [$unlink(file)]); + + if(!e.control) + el.fade(0).get('tween').chain(function(){ + self.deselect(el); + el.getParent().destroy(); + }); + } + }); + $$(els).setStyles({left: '0', top: '0'}); + var tips = new FileManager.Tips(this.browser.getElements('img.browser-icon')); + + tips.tip.removeClass('tip-base'); + }, + + fillInfo: function(file, path){ + if(!file) file = this.CurrentDir; + if(!path) path = this.Directory; + + if(!file) return; + var size = this.size(file.size); + + this.info.fade(1).getElement('img').set({ + src: this.options.assetBasePath+'Icons/'+file.icon+'.png', + alt: file.mime + }); + + this.fireHooks('cleanup'); + this.preview.empty(); + + this.info.getElement('h1').set('text', file.name); + this.info.getElement('dd.filemanager-modified').set('text', file.date); + this.info.getElement('dd.filemanager-type').set('text', file.mime); + this.info.getElement('dd.filemanager-size').set('text', !size[0] && size[1]=='Bytes' ? '-' : (size.join(' ')+(size[1]!='Bytes' ? ' ('+file.size+' Bytes)' : ''))); + this.info.getElement('h2.filemanager-headline').setStyle('display', file.mime=='text/directory' ? 'none' : 'block'); + + var text = [], pre = []; + + path.split('/').each(function(v){ + if(!v) return; + + pre.push(v); + text.push(new Element('a', { + 'class': 'icon', + href: '#', + text: v + }).addEvent('click', (function(e, dir){ + e.stop(); + + this.load(dir); + }).bindWithEvent(this, [pre.join('/')])) + ); + text.push(new Element('span', {text: ' / '})); + }, this); + + text.pop(); + text[text.length-1].addClass('selected').removeEvents('click').addEvent('click', function(e){ e.stop(); }); + + this.info.getElement('dd.filemanager-dir').empty().adopt(new Element('span', {text: '/ '}), text); + + if(file.mime=='text/directory') return; + + if(this.Request) this.Request.cancel(); + + this.Request = new FileManager.Request({ + url: this.options.url+'?event=detail', + onSuccess: (function(j){ + var prev = this.preview.removeClass('filemanager-loading').set('html', j && j.content ? j.content.substitute(this.language, /\\?\$\{([^{}]+)\}/g) : '').getElement('img.prev'); + if(prev) prev.addEvent('load', function(){ + this.setStyle('background', 'none'); + }); + + var els = this.preview.getElements('button'); + if(els) els.addEvent('click', function(e){ + e.stop(); + window.open(this.get('value')); + }); + }).bind(this), + data: { + directory: this.Directory, + file: file.name + } + }, this).post(); + }, + + size: function(size){ + var tab = ['Bytes', 'KB', 'MB', 'GB', 'TB']; + for(var i = 0; size > 1024; i++) + size = size/1024; + + return [Math.round(size), tab[i]]; + }, + + normalize: function(str){ + return str.replace(/\/+/g, '/'); + }, + + switchButton: function(){ + var chk = !!this.Current; + var el = this.menu.getElement('button.filemanager-open'); + if(el) el.set('disabled', !chk)[(chk ? 'remove' : 'add')+'Class']('disabled'); + }, + + addMenuButton: function(name){ + var el = new Element('button', { + 'class': 'filemanager-'+name, + text: this.language[name] + }).inject(this.menu); + if(this[name]) el.addEvent('click', this[name].bind(this)); + return el; + }, + + fireHooks: function(hook){ + var args = Array.slice(arguments, 1); + for(var key in this.hooks[hook]) this.hooks[hook][key].apply(this, args); + return this; + }, + + onRequest: function(){ this.loader.set('opacity', 1); }, + onComplete: function(){ this.loader.fade(0); }, + onDialogOpen: $empty, + onDialogClose: $empty, + + onDragStart: $empty, + onDragComplete: $lambda(false) + +}); + +FileManager.Language = {}; \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Source/Language/Language.cs.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Source/Language/Language.cs.js Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,73 @@ +/* +Script: Language.cs.js + MooTools FileManager - Language Strings in Czech + +Translation: + [MatÄ›j Grabovský](http://mgrabovsky.is-game.com) +*/ + +FileManager.Language.cs = { + more: 'Podrobnosti', + width: 'Šířka:', + height: 'Výška:', + + ok: 'Ok', + open: 'Vybrat soubor', + upload: 'Nahrát', + create: 'VytvoÅ™it složku', + createdir: 'Prosím zadejte název složky:', + cancel: 'Storno', + + information: 'Informace', + type: 'Typ:', + size: 'Velikost:', + dir: 'Cesta:', + modified: 'Naposledy zmÄ›nÄ›no:', + preview: 'Náhled', + close: 'Zavřít', + destroy: 'Smazat', + destroyfile: 'UrÄitÄ› chcete smazat tento soubor?', + + rename: 'PÅ™ejmenovat', + renamefile: 'Prosím zadejte název nového souboru:', + + download: 'Stáhnout', + nopreview: 'Náhled není dostupný', + + title: 'Název:', + artist: 'UmÄ›lec:', + album: 'Album:', + length: 'Délka:', + bitrate: 'PÅ™enosová rychlost:', + + deselect: 'Odstranit z výbÄ›ru', + + nodestroy: 'Mazání souborů je na tomto serveru zakázáno.', + + 'upload.disabled': 'Nahrávání souborů je na tomto serveru zakázáno.', + 'upload.authenticated': 'Nemáte právo nahrávat soubory.', + 'upload.path': 'Specifikovaná složka pro nahrávání neexistuje. Prosím kontaktujte správce tÄ›chto stránek.', + 'upload.exists': 'Specifikovaný soubor již existuje. Prosím kontaktujte správce tÄ›chto stránek.', + 'upload.mime': 'Specifikovaný typ souboru není povolen.', + 'upload.extension': 'Nahrávaný soubor má neznámou nebo zakázanou příponu.', + 'upload.size': 'Velikost nahrávaného souboru je přílíš velká. Prosím nahrajte menší soubor.', + 'upload.partial': 'Nahrávaný soubor byl nahrán jen zÄásti. Prosím nahrajte ho znovu.', + 'upload.nofile': 'Nebyl vybrán žádný soubor pro nahrání.', + 'upload.default': 'NÄ›co se nepovedlo pÅ™i nahrávání souboru.', + + /* FU */ + uploader: { + unknown: 'Neznámá chyba', + duplicate: 'Nelze pÅ™idat soubor „${name}“ (${size}), byl již pÅ™idán!', + sizeLimitMin: 'Nelze pÅ™idat soubor „${name}“ (${size}), minimální povolená velikost souboru je ${size_min}!', + sizeLimitMax: 'Nelze pÅ™idat soubor „${name}“ (${size}), maximální povolená velikost souboru je ${size_max}!' + }, + + flash: { + hidden: null, + disabled: null, + flash: 'Pokud chcete nahrávat soubory, musíte mít nainstalovaný Adobe Flash' + }, + + resizeImages: 'ZmÄ›nÅ¡it velké obrázky pÅ™i nahrávání' +}; \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Source/Language/Language.da.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Source/Language/Language.da.js Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,73 @@ +/* +Script: Language.da.js + MooTools FileManager - Language Strings in Danish + +Translation: + Jan Ebsen +*/ + +FileManager.Language.da = { + more: 'Detaljer', + width: 'Bredde:', + height: 'Højde:', + + ok: 'Ok', + open: 'Vælg fil', + upload: 'Upload', + create: 'Opret mappe', + createdir: 'Angiv venligst mappe navn:', + cancel: 'Anuller', + + information: 'Information', + type: 'Type:', + size: 'Størrelse:', + dir: 'Sti:', + modified: 'Sidst ændret:', + preview: 'Miniature', + close: 'Luk', + destroy: 'Slet', + destroyfile: 'Er du sikker pÃ¥ du vil slette denne fil?', + + rename: 'Omdøb', + renamefile: 'Skriv nyt filnavn:', + + download: 'Download', + nopreview: 'Ingen miniature tilgængelig', + + title: 'Titel:', + artist: 'Kunstner:', + album: 'Album:', + length: 'Længde:', + bitrate: 'Bitrate:', + + deselect: 'Fravælg', + + nodestroy: 'Det er ikke muligt at slette filer pÃ¥ serveren.', + + 'upload.disabled': 'Det er ikke muligt at uploade filer pÃ¥ serveren.', + 'upload.authenticated': 'Du har ikke rettigheder til at uploade filer.', + 'upload.path': 'Upload mappen findes ikke. Kontakt venligst sidens administrator.', + 'upload.exists': 'Upload mappen findes allerede. Kontakt venligst sidens administrator.', + 'upload.mime': 'Fil-typen er ikke tilladt.', + 'upload.extension': 'Filen er af en ukendt, eller ulovlig type.', + 'upload.size': 'Filen er for stor, upload venligst en mindre fil.', + 'upload.partial': 'Filen blev kun delvist uploaded, prøv venligst igen.', + 'upload.nofile': 'Der er ikke angivet nogen fil til upload.', + 'upload.default': 'Noget gik galt med fil-uploaderen.', + + /* FU */ + uploader: { + unknown: 'Ukendt fejl', + duplicate: 'Du kan ikke tilføje "${name}" (${size}), den er allerede tilføjet!', + sizeLimitMin: 'Du kan ikke tilføje "${name}" (${size}), mindst tilladte filstørrelse er ${size_min}!', + sizeLimitMax: 'Du kan ikke tilføje "${name}" (${size}), højst tilladte filstørrelse er ${size_max}!' + }, + + flash: { + hidden: null, + disabled: null, + flash: 'For at uploade filer skal du installere Adobe Flash.' + }, + + resizeImages: 'Scaler store billeder ved upload' +}; \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Source/Language/Language.de.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Source/Language/Language.de.js Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,72 @@ +/* +Script: Language.de.js + MooTools FileManager - Language Strings in German + +Translation: + [Christoph Pojer](http://og5.net/christoph) +*/ + +FileManager.Language.de = { + more: 'Details', + width: 'Breite:', + height: 'Höhe:', + + ok: 'Ok', + open: 'Datei wählen', + upload: 'Datei hochladen', + create: 'Ordner erstellen', + createdir: 'Bitte gib einen Ordnernamen ein:', + cancel: 'Abbrechen', + + information: 'Information', + type: 'Typ:', + size: 'Größe:', + dir: 'Verzeichnis:', + modified: 'Zuletzt bearbeitet:', + preview: 'Vorschau', + close: 'Schließen', + destroy: 'Löschen', + destroyfile: 'Bist du sicher, dass du diese Datei löschen möchtest?', + + rename: 'Umbenennen', + renamefile: 'Gib einen neuen Dateinamen ein:', + + download: 'Download', + nopreview: 'Keine Vorschau verfügbar', + + title: 'Titel:', + artist: 'Artist:', + album: 'Album:', + length: 'Länge:', + bitrate: 'Bitrate:', + + deselect: 'Entfernen', + + nodestroy: 'Dateien löschen wurde auf diesem Server deaktiviert.', + + 'upload.disabled': 'Der Datei-Upload wurde auf diesem Server deaktiviert.', + 'upload.authenticated': 'Upload fehlgeschlagen: Du bist nicht authentifiziert.', + 'upload.path': 'Der angegebene Upload-Ordner existiert nicht. Bitte kontaktiere den Administrator dieser Website.', + 'upload.exists': 'Der angegebene Upload-Speicherort existiert bereits. Bitte kontaktiere den Administrator dieser Website.', + 'upload.mime': 'Der angegebene Dateityp ist nicht erlaubt.', + 'upload.extension': 'Die Datei hat eine unbekannte oder unerlaubte Datei-Erweiterung.', + 'upload.size': 'Die Datei, die du hochgeladen hast, ist zu groß um sie auf diesem Server zu verarbeiten. Bitte lade eine kleinere Datei hoch.', + 'upload.partial': 'Die Datei wurde nur teilweise hochgeladen. Bitte lade sie erneut hoch.', + 'upload.nofile': 'Es wurde keine Datei hochgeladen.', + 'upload.default': 'Der Datei-Upload ist fehlgeschlagen.', + + /* FU */ + uploader: { + unknown: 'Unbekannter Fehler', + sizeLimitMin: 'Die Datei "${name}" (${size}), ist zu klein. Minimaldateigröße: ${size_min}!', + sizeLimitMax: 'Die Datei "${name}" (${size}), ist zu groß. Dateigrößen-Limit: ${size_max}!' + }, + + flash: { + hidden: 'Um den Uploader benutzen zu können, muss er im Browser freigegeben werden und die Seite muss neu geladen werden (Adblock).', + disabled: 'Um den Uploader benutzen zu können, muss die geblockte Flash Datei freigegeben werden und die Seite muss neu geladen werden (Flashblock).', + flash: 'Um Dateien hochzuladen muss Adobe Flash installiert werden.' + }, + + resizeImages: 'Große Bilder bei Upload verkleinern' +}; \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Source/Language/Language.en.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Source/Language/Language.en.js Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,72 @@ +/* +Script: Language.en.js + MooTools FileManager - Language Strings in English + +Translation: + [Christoph Pojer](http://og5.net/christoph) +*/ + +FileManager.Language.en = { + more: 'Details', + width: 'Width:', + height: 'Height:', + + ok: 'Ok', + open: 'Select file', + upload: 'Upload', + create: 'Create folder', + createdir: 'Please specify a folder name:', + cancel: 'Cancel', + + information: 'Information', + type: 'Type:', + size: 'Size:', + dir: 'Path:', + modified: 'Last modified:', + preview: 'Preview', + close: 'Close', + destroy: 'Delete', + destroyfile: 'Are you sure to delete this file?', + + rename: 'Rename', + renamefile: 'Please enter a new file name:', + + download: 'Download', + nopreview: 'No preview available', + + title: 'Title:', + artist: 'Artist:', + album: 'Album:', + length: 'Length:', + bitrate: 'Bitrate:', + + deselect: 'Deselect', + + nodestroy: 'Deleting files has been disabled on this Server.', + + 'upload.disabled': 'Uploading has been disabled on this Server.', + 'upload.authenticated': 'You are not authenticated to upload files.', + 'upload.path': 'The specified Upload-Folder does not exist. Please contact the administrator of this Website.', + 'upload.exists': 'The specified Upload-Location does already exist. Please contact the administrator of this Website.', + 'upload.mime': 'The specified file-type is not allowed.', + 'upload.extension': 'The uploaded file has an unknown or forbidden file extension.', + 'upload.size': 'The size of the file you uploaded is too big to be processed on this server. Please upload a smaller file.', + 'upload.partial': 'The file you uploaded was only partially uploaded, please upload the file again.', + 'upload.nofile': 'There was no file specified to be uploaded.', + 'upload.default': 'Something went wrong with the File-Upload.', + + /* FU */ + uploader: { + unknown: 'Unknown Error', + sizeLimitMin: 'You can not attach "${name}" (${size}), the file size minimum is ${size_min}!', + sizeLimitMax: 'You can not attach "${name}" (${size}), the file size limit is ${size_max}!' + }, + + flash: { + hidden: 'To enable the embedded uploader, unblock it in your browser and refresh (see Adblock).', + disabled: 'To enable the embedded uploader, enable the blocked Flash movie and refresh (see Flashblock).', + flash: 'In order to upload files you need to install Adobe Flash.' + }, + + resizeImages: 'Resize big images on upload' +}; \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Source/Language/Language.es.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Source/Language/Language.es.js Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,73 @@ +/* +Script: Language.es.js + MooTools FileManager - Language Strings in Spanish + +Translation: + [Sergio Rubio](http://rubiojr.netcorex.org) +*/ + +FileManager.Language.es = { + more: 'Detalles', + width: 'Anchura:', + height: 'Altura:', + + ok: 'Ok', + open: 'Seleccionar Fichero', + upload: 'Subir ficheros', + create: 'Crear carpeta', + createdir: 'Especifica el nombre de la carpeta:', + cancel: 'Cancelar', + + information: 'Información', + type: 'Tipo:', + size: 'Tamaño:', + dir: 'Ruta:', + modified: 'Última modificación:', + preview: 'Previsualización', + close: 'Cerrar', + destroy: 'Borrar', + destroyfile: '¿Seguro que deseas borrar el fichero?', + + rename: 'Renombrar', + renamefile: 'Especifica un nuevo nombre para el fichero:', + + download: 'Descargar', + nopreview: 'No hay previsualizacion disponible', + + title: 'Título:', + artist: 'Artista:', + album: 'Album:', + length: 'Duración:', + bitrate: 'Bitrate:', + + deselect: 'Desmarcar', + + nodestroy: 'El borrado de ficheros ha sido deshabilitado.', + + 'upload.disabled': 'La carga de archivos ha sido deshabilitada.', + 'upload.authenticated': 'Necesitas autorización para subir ficheros.', + 'upload.path': 'La carpeta destino especificada no existe. Contacta con el administrador del sitio web.', + 'upload.exists': 'El la ruta destino ya existe. Por favor, contacta con el administrador del sitio web.', + 'upload.mime': 'No se permite subir el tipo de fichero especificado.', + 'upload.extension': 'El fichero subido tienen una extensión no permitida o desconocida.', + 'upload.size': 'El tamaño del fichero que intentas subir es demasiado grande para ser procesado por el servidor. Por favor, sube un fichero mas pequeño.', + 'upload.partial': 'El fichero se ha subido parcialmente, por favor, sube el fichero de nuevo.', + 'upload.nofile': 'No se especificó el fichero a subir.', + 'upload.default': 'Algo falló durante la carga del fichero.', + + /* FU */ + uploader: { + unknown: 'Error desconocido', + duplicate: 'No se puede subir "${name}" (${size}), ya ha sido añadido!', + sizeLimitMin: 'No se puede subir "${name}" (${size}), el tamaño mínimo de fichero es ${size_min}!', + sizeLimitMax: 'No se puede subir "${name}" (${size}), el tamaño máximo de fichero es ${size_max}!' + }, + + flash: { + hidden: null, + disabled: null, + flash: 'Para poder subir ficheros necesitas instalar Adobe Flash.' + }, + + resizeImages: 'Redimensionar las imágenes grandes al subirlas' +}; diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Source/Language/Language.fi.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Source/Language/Language.fi.js Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,73 @@ +/* +Script: Language.fi.js + MooTools FileManager - Language Strings in Finnish + +Translation: + [Jabis Sevón](http://pumppumedia.com) +*/ + +FileManager.Language.fi = { + more: 'Lisätiedot', + width: 'Leveys:', + height: 'Korkeus:', + + ok: 'Ok', + open: 'Valitse tiedosto', + upload: 'Lähetä', + create: 'Luo kansio', + createdir: 'Kansion nimi:', + cancel: 'Peruuta', + + information: 'Tiedot', + type: 'Tyyppi:', + size: 'Koko:', + dir: 'Polku:', + modified: 'Viimeksi muokattu:', + preview: 'Esikatselu', + close: 'Sulje', + destroy: 'Poista', + destroyfile: 'Haluatko varmasti poistaa tiedoston?', + + rename: 'Nimeä uudelleen', + renamefile: 'Syötä tiedoston uusi nimi:', + + download: 'Lataa', + nopreview: 'Esikatselua ei voida näyttää', + + title: 'Kappaleen nimi:', + artist: 'Artisti:', + album: 'Albumi:', + length: 'Pituus:', + bitrate: 'Bitrate:', + + deselect: 'Poista valinta', + + nodestroy: 'Tiedostojen poisto otettu käytöstä.', + + 'upload.disabled': 'Tiedostojen lähetys otettu käytöstä.', + 'upload.authenticated': 'Sinulla ei ole oikeuksia tiedostojen lähettämiseen.', + 'upload.path': 'Määritettyä kansiota ei löydy. Ole hyvä ja ota yhteyttä sivuston ylläpitäjään.', + 'upload.exists': 'Tiedosto on jo olemassa - siirto peruttu. Ole hyvä ja ota yhteyttä sivuston ylläpitäjään.', + 'upload.mime': 'Tiedostotyyppi ei ole sallittujen listalla - siirto peruttu.', + 'upload.extension': 'Tiedostopääte tuntematon, tai ei sallittujen listalla - siirto peruttu.', + 'upload.size': 'Tiedostokoko liian suuri palvelimelle. Ole hyvä ja siirrä pienempiä tiedostoja.', + 'upload.partial': 'Tiedonsiirto onnistui vain osittain - siirto epäonnistui. Ole hyvä ja siirrä tiedosto uudestaan', + 'upload.nofile': 'Tiedostoa ei määritetty.', + 'upload.default': 'Tiedonsiirto epäonnistui tunnistamattomasta syystä.', + + /* FU */ + uploader: { + unknown: 'Tunnistamaton virhe', + duplicate: 'Et voi lisätä seuraavaa tiedostoa: "${name}" (${size}), koska se on jo siirtolistalla!', + sizeLimitMin: 'Et voi lisätä seuraavaa tiedostoa: "${name}" (${size}). Tiedostojen minimikoko on ${size_min}!', + sizeLimitMax: 'Et voi lisätä seuraavaa tiedostoa: "${name}" (${size}). Tiedostojen maksimikoko on ${size_max}!' + }, + + flash: { + hidden: null, + disabled: null, + flash: 'Käyttääksesi FileManageria, tarvitset Adobe Flash Playerin. Lataa tästä.' + }, + + resizeImages: 'Pienennä liian suuret kuvat automaattisesti siirron yhteydessä' +}; diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Source/Language/Language.fr.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Source/Language/Language.fr.js Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,73 @@ +/* +Script: Language.fr.js + MooTools FileManager - Language Strings in French + +Translation: + [Samuel Sanchez](http://www.kromack.com) +*/ + +FileManager.Language.fr = { + more: 'Détails', + width: 'Largeur :', + height: 'Hauteur :', + + ok: 'Ok', + open: 'Sélectionner un fichier', + upload: 'Téléverser', + create: 'Créer un dossier', + createdir: 'Merci de spécifier un nom de dossier :', + cancel: 'Annuler', + + information: 'Informations', + type: 'Type :', + size: 'Taille :', + dir: 'Chemin :', + modified: 'Modifié le :', + preview: 'Aperçu', + close: 'Fermer', + destroy: 'Supprimer', + destroyfile: 'Voulez-vous vraiment supprimer ce fichier ?', + + rename: 'Renommer', + renamefile: 'Merci de spécifier un nouveau nom de fichier :', + + download: 'Télécharger', + nopreview: 'Aucun aperçu disponible', + + title: 'Titre :', + artist: 'Artiste :', + album: 'Album :', + length: 'Durée :', + bitrate: 'Débit :', + + deselect: 'Désélectionner', + + nodestroy: 'La suppression de fichier a été désactivée sur ce serveur.', + + 'upload.disabled': 'Le téléversement de fichier a été désactivé sur ce serveur.', + 'upload.authenticated': 'Vous n\'êtes pas authentifié et ne pouvez pas téléverser de fichier.', + 'upload.path': 'Le répertoire de téléversement spécifié n\'existe pas. Merci de contacter l\'administrateur de ce site Internet.', + 'upload.exists': 'Le chemin de téléversement spécifié existe déjà. Merci de contacter l\'administrateur de ce site Internet.', + 'upload.mime': 'Le type de fichier spécifié n\'est pas autorisé.', + 'upload.extension': 'Le fichier téléversé a une extension inconnue ou interdite.', + 'upload.size': 'La taille de votre fichier est trop grande pour être téléversée sur ce serveur. Merci de sélectionner un fichier moins lourd.', + 'upload.partial': 'Le fichier a été partiellement téléversé, merci de recommencer l\'opération.', + 'upload.nofile': 'Aucun fichier n\'a été spécifié.', + 'upload.default': 'Une erreur s\'est produite.', + + /* FU */ + uploader: { + unknown: 'Erreur inconnue', + duplicate: 'Vous ne pouvez pas ajouter "${name}" (${size}), car l\'élément est déjà ajoutée !', + sizeLimitMin: 'Vous ne pouvez pas ajouter "${name}" (${size}), la taille minimale des fichiers est de ${size_min}!', + sizeLimitMax: 'Vous ne pouvez pas ajouter "${name}" (${size}), la taille maximale des fichiers est de ${size_max}!' + }, + + flash: { + hidden: null, + disabled: null, + flash: 'Dans le but de téléverser des fichiers, vous devez installer Adobe Flash.' + }, + + resizeImages: 'Redimensionner les images pendant le téléversement' +}; \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Source/Language/Language.se.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Source/Language/Language.se.js Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,73 @@ +/* +Script: Language.se.js + MooTools FileManager - Language Strings in Swedish + +Translation: + [Marcus *xintron* Carlsson](http://xintron.se) +*/ + +FileManager.Language.se = { + more: 'Detaljer', + width: 'Bredd:', + height: 'Höjd:', + + ok: 'Ok', + open: 'Välj fil', + upload: 'Ladda upp', + create: 'Skapa mapp', + createdir: 'Vänligen ange ett mapp-namn:', + cancel: 'Avbryt', + + information: 'Information', + type: 'Typ:', + size: 'Storlek:', + dir: 'Sökväg:', + modified: 'Senast ändad:', + preview: 'Förhandsgranska', + close: 'Stäng', + destroy: 'Ta bort', + destroyfile: 'Är du säker pÃ¥ att du vill ta bort filen?', + + rename: 'Döp om', + renamefile: 'Vänligen ange ett nytt filnamn:', + + download: 'Ladda ner', + nopreview: 'Ingen förhandsgranskning tillgänglig', + + title: 'Titel:', + artist: 'Artist:', + album: 'Album:', + length: 'Längd:', + bitrate: 'Bitrate:', + + deselect: 'Avmarkera', + + nodestroy: 'Funktionen ta bort filer är avstängd pÃ¥ denna server.', + + 'upload.disabled': 'Uppladdning är avstängt pÃ¥ denna server.', + 'upload.authenticated': 'Du har inte behörighet att ladda upp filer.', + 'upload.path': 'Den angivna uppladdnings-mappen existerar inte. Vänligen kontakta serveradministratören.', + 'upload.exists': 'Den angivna uppladdnings-mappen existerar redan. Vänligen kontakta serveradministratören.', + 'upload.mime': 'Denna filtyp accepteras inte pÃ¥ denna server.', + 'upload.extension': 'Den uppladdade filen har en okänd eller förbjuden filändelse.', + 'upload.size': 'Filen är för stor för denna server. Vänligen ladda upp en mindre fil.', + 'upload.partial': 'Ett fel uppstod och hela filen kunde inte laddas upp. Vänligen försök igen.', + 'upload.nofile': 'Du mÃ¥ste välja en fil att ladda upp.', + 'upload.default': 'Ett fel inträffade under uppladdningen.', + + /* FU */ + uploader: { + unknown: 'Okänt fel', + duplicate: 'Du kan inte ladda upp "${name}" (${size}), filen existerar redan!', + sizeLimitMin: 'Du kan inte ladda upp "${name}" (${size}), minsta storlek som accepteras är ${size_min}!', + sizeLimitMax: 'Du kan inte ladda upp "${name}" (${size}), filens storlek fÃ¥r inte överstiga ${size_max}!' + }, + + flash: { + hidden: null, + disabled: null, + flash: 'För att kunna ladda upp filer behöver du ha Adobe Flash installerat.' + }, + + resizeImages: 'Ändra storleken pÃ¥ bilden under uppladdningen' +}; diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Source/Uploader.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Source/Uploader.js Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,235 @@ +/* +Script: Uploader.js + MooTools FileManager - Implements Upload functionality into the FileManager based on [FancyUpload](http://digitarald.de) + +License: + MIT-style license. + +Copyright: + Copyright (c) 2009 [Christoph Pojer](http://og5.net/christoph). + +Dependencies: + - FileManager.js + +Options: + - upload: (boolean, defaults to *true*) + - uploadAuthData: (object) Data to be send with the GET-Request of an Upload as Flash ignores authenticated clients + - resizeImages: (boolean, defaults to *true*) Whether to show the option to resize big images or not +*/ + +FileManager.implement({ + + options: { + resizeImages: false, + upload: true, + uploadAuthData: {} + }, + + hooks: { + show: { + upload: function(){ + this.startUpload(); + } + }, + + cleanup: { + upload: function(){ + if(!this.options.upload || !this.upload) return; + + if(this.upload.uploader) this.upload.uploader.set('opacity', 0).dispose(); + } + } + }, + + onDialogOpen: function(){ + if(this.swf && this.swf.box) this.swf.box.setStyle('visibility', 'hidden'); + }, + + onDialogClose: function(){ + if(this.swf && this.swf.box) this.swf.box.setStyle('visibility', 'visible'); + }, + + startUpload: function(){ + if(!this.options.upload || this.swf) return; + + var self = this; + this.upload = { + button: this.addMenuButton('upload').addEvents({ + click: function(){ + return false; + }, + mouseenter: function(){ + this.addClass('hover'); + }, + mouseleave: function(){ + this.removeClass('hover'); + this.blur(); + }, + mousedown: function(){ + this.focus(); + } + }), + list: new Element('ul', {'class': 'filemanager-uploader-list'}), + uploader: new Element('div', {opacity: 0}).adopt( + new Element('h2', {text: this.language.upload}), + new Element('div', {'class': 'filemanager-uploader'}) + ) + }; + this.upload.uploader.getElement('div').adopt(this.upload.list); + this.closeIcon.appearOn(this.upload.button, 0.8); + + if(this.options.resizeImages){ + var resizer = new Element('div', {'class': 'checkbox'}), + check = (function(){ this.toggleClass('checkboxChecked'); }).bind(resizer); + check(); + this.upload.label = new Element('label').adopt( + resizer, new Element('span', {text: this.language.resizeImages}) + ).addEvent('click', check).inject(this.menu); + } + + var File = new Class({ + + Extends: Swiff.Uploader.File, + + initialize: function(base, data){ + this.parent(base, data); + this.setOptions({ + url: self.options.url+'?'+Hash.toQueryString($merge({}, self.options.uploadAuthData, { + event: 'upload', + directory: self.normalize(self.Directory), + resize: self.options.resizeImages && resizer.hasClass('checkboxChecked') ? 1 : 0 + })) + }); + }, + + render: function(){ + if(this.invalid){ + var message = self.language.uploader.unknown, sub = { + name: this.name, + size: Swiff.Uploader.formatUnit(this.size, 'b') + }; + + if(self.language.uploader[this.validationError]) + message = self.language.uploader[this.validationError]; + + if(this.validationError=='sizeLimitMin') + sub.size_min = Swiff.Uploader.formatUnit(this.base.options.fileSizeMin, 'b'); + else if(this.validationError=='sizeLimitMax') + sub.size_max = Swiff.Uploader.formatUnit(this.base.options.fileSizeMax, 'b'); + + new Dialog(new Element('div', {html: message.substitute(sub, /\\?\$\{([^{}]+)\}/g)}) , {language: {confirm: self.language.ok}, buttons: ['confirm']}); + return this; + } + + this.addEvents({ + open: this.onOpen, + remove: this.onRemove, + requeue: this.onRequeue, + progress: this.onProgress, + stop: this.onStop, + complete: this.onComplete + }); + + this.ui = {}; + this.ui.icon = new Asset.image(self.options.assetBasePath+'Icons/'+this.extension+'.png', { + onerror: function(){ new Asset.image(self.options.assetBasePath+'Icons/default.png').replaces(this); } + }); + this.ui.element = new Element('li', {'class': 'file', id: 'file-' + this.id}); + this.ui.title = new Element('span', {'class': 'file-title', text: this.name}); + this.ui.size = new Element('span', {'class': 'file-size', text: Swiff.Uploader.formatUnit(this.size, 'b')}); + + var tips, file = this; + this.ui.cancel = new Asset.image(self.options.assetBasePath+'cancel.png', {'class': 'file-cancel', title: self.language.cancel}).addEvent('click', function(){ + file.remove(); + tips.hide(); + tips.detach(this); + }); + tips = new FileManager.Tips(this.ui.cancel); + + var progress = new Element('img', {'class': 'file-progress', src: self.options.assetBasePath+'bar.gif'}); + + this.ui.element.adopt( + this.ui.cancel, + progress, + this.ui.icon, + this.ui.title, + this.ui.size + ).inject(self.upload.list).highlight(); + + this.ui.progress = new Fx.ProgressBar(progress).set(0); + + this.base.reposition(); + + return this.parent(); + }, + + onOpen: function(){ + this.ui.element.addClass('file-running'); + }, + + onRemove: function(){ + this.ui = this.ui.element.destroy(); + }, + + onProgress: function(){ + this.ui.progress.start(this.progress.percentLoaded); + }, + + onStop: function(){ + this.remove(); + }, + + onComplete: function(){ + this.ui.progress = this.ui.progress.cancel().element.destroy(); + this.ui.cancel = this.ui.cancel.destroy(); + + var response = JSON.decode(this.response.text); + if(!response.status) + new Dialog((''+response.error).substitute(self.language, /\\?\$\{([^{}]+)\}/g) , {language: {confirm: self.language.ok}, buttons: ['confirm']}); + + this.ui.element.set('tween', {duration: 2000}).highlight(response.status ? '#e6efc2' : '#f0c2c2'); + (function(){ + this.ui.element.setStyle('overflow', 'hidden').morph({ + opacity: 0, + height: 0 + }).get('morph').chain(function(){ + this.element.destroy(); + if(!self.upload.list.getElements('li').length) + self.upload.uploader.fade(0).get('tween').chain(function(){ + self.fillInfo(); + }); + }); + }).delay(5000, this); + } + + }); + + this.swf = new Swiff.Uploader({ + id: 'SwiffFileManagerUpload', + path: this.options.assetBasePath+'Swiff.Uploader.swf', + queued: false, + target: this.upload.button, + allowDuplicates: true, + instantStart: true, + fileClass: File, + fileSizeMax: 25 * 1024 * 1024, + onBrowse: function(){}, + onCancel: function(){}, + zIndex: this.SwiffZIndex || 9999, + onSelectSuccess: function(){ + self.fillInfo(); + self.info.getElement('h2.filemanager-headline').setStyle('display', 'none'); + self.preview.adopt(self.upload.uploader); + self.upload.uploader.fade(1); + }, + onComplete: function(){ + self.load(self.Directory, true); + }, + onFail: function(error){ + $$(self.upload.button, self.upload.label).dispose(); + new Dialog(new Element('div', {html: self.language.flash[error] || self.language.flash.flash}), {language: {confirm: self.language.ok}, buttons: ['confirm']}); + } + }); + } + +}); \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Source/Uploader/Fx.ProgressBar.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Source/Uploader/Fx.ProgressBar.js Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,71 @@ +/** + * Fx.ProgressBar + * + * @version 1.1 + * + * @license MIT License + * + * @author Harald Kirschner + * @copyright Authors + */ + +Fx.ProgressBar = new Class({ + + Extends: Fx, + + options: { + text: null, + url: null, + transition: Fx.Transitions.Circ.easeOut, + fit: true, + link: 'cancel' + }, + + initialize: function(element, options) { + this.element = $(element); + this.parent(options); + + var url = this.options.url; + if (url) { + this.element.setStyles({ + 'background-image': 'url(' + url + ')', + 'background-repeat': 'no-repeat' + }); + } + + if (this.options.fit) { + url = url || this.element.getStyle('background-image').replace(/^url\(["']?|["']?\)$/g, ''); + if (url) { + var fill = new Image(); + fill.onload = function() { + this.fill = fill.width; + fill = fill.onload = null; + this.set(this.now || 0); + }.bind(this); + fill.src = url; + if (!this.fill && fill.width) fill.onload(); + } + } else { + this.set(0); + } + }, + + start: function(to, total) { + return this.parent(this.now, (arguments.length == 1) ? to.limit(0, 100) : to / total * 100); + }, + + set: function(to) { + this.now = to; + var css = (this.fill) + ? (((this.fill / -2) + (to / 100) * (this.element.width || 1) || 0).round() + 'px') + : ((100 - to) + '%'); + + this.element.setStyle('backgroundPosition', css + ' 0px').title = Math.round(to) + '%'; + + var text = $(this.options.text); + if (text) text.set('text', Math.round(to) + '%'); + + return this; + } + +}); \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/Source/Uploader/Swiff.Uploader.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/Source/Uploader/Swiff.Uploader.js Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,476 @@ +/** + * Swiff.Uploader - Flash FileReference Control + * + * @version 3.0 rc1 + * + * @license MIT License + * + * @author Harald Kirschner + * @copyright Authors + */ + +Swiff.Uploader = new Class({ + + Extends: Swiff, + + Implements: Events, + + options: { + path: 'Swiff.Uploader.swf', + + target: null, + zIndex: 9999, + + height: 30, + width: 100, + callBacks: null, + params: { + wMode: 'opaque', + menu: 'false', + allowScriptAccess: 'always' + }, + + typeFilter: null, + multiple: true, + queued: true, + verbose: false, + + url: null, + method: null, + data: null, + mergeData: true, + fieldName: null, + + fileSizeMin: 1, + fileSizeMax: null, // Official limit is 100 MB for FileReference! + allowDuplicates: false, + + buttonImage: null, + + fileListMax: 0, + fileListSizeMax: 0, + + instantStart: false, + appendCookieData: false, + + fileClass: null + /* + onLoad: $empty, + onFail: $empty, + onStart: $empty, + onQueue: $empty, + onComplete: $empty, + onBrowse: $empty, + onDisabledBrowse: $empty, + onCancel: $empty, + onSelect: $empty, + onSelectSuccess: $empty, + onSelectFail: $empty, + + onButtonEnter: $empty, + onButtonLeave: $empty, + onButtonDown: $empty, + onButtonDisable: $empty, + + onFileStart: $empty, + onFileStop: $empty, + onFileRequeue: $empty, + onFileOpen: $empty, + onFileProgress: $empty, + onFileComplete: $empty, + onFileRemove: $empty + */ + }, + + initialize: function(options) { + // protected events to control the class, added + // before setting options (which adds own events) + this.addEvent('load', this.initializeSwiff, true) + .addEvent('select', this.processFiles, true) + .addEvent('complete', this.update, true) + .addEvent('fileRemove', function(file) { + this.fileList.erase(file); + }.bind(this), true); + + this.setOptions(options); + + // callbacks are no longer in the options, every callback + // is fired as event, this is just compat + if (this.options.callBacks) { + Hash.each(this.options.callBacks, function(fn, name) { + this.addEvent(name, fn); + }, this); + } + + this.options.callBacks = { + fireCallback: this.fireCallback.bind(this) + }; + + var path = this.options.path; + if (!path.contains('?')) path += '?noCache=' + $time(); // cache in IE + + // container options for Swiff class + this.options.container = this.box = new Element('span', {'class': 'swiff-uploader-box'}).inject($(this.options.container) || document.body); + + // target + this.target = $(this.options.target); + if (this.target) { + var scroll = window.getScroll(); + this.box.setStyles({ + position: 'absolute', + visibility: 'visible', + zIndex: this.options.zIndex, + overflow: 'hidden', + height: 1, width: 1, + top: scroll.y, left: scroll.x + }); + + // we force wMode to transparent for the overlay effect + this.parent(path, { + params: { + wMode: 'transparent' + }, + height: '100%', + width: '100%' + }); + + this.target.addEvent('mouseenter', this.reposition.bind(this, [])); + + // button interactions, relayed to to the target + this.addEvents({ + buttonEnter: this.targetRelay.bind(this, ['mouseenter']), + buttonLeave: this.targetRelay.bind(this, ['mouseleave']), + buttonDown: this.targetRelay.bind(this, ['mousedown']), + buttonDisable: this.targetRelay.bind(this, ['disable']) + }); + + this.reposition(); + window.addEvent('resize', this.reposition.bind(this, [])); + } else { + this.parent(path); + } + + this.inject(this.box); + + this.fileList = []; + + this.size = this.uploading = this.bytesLoaded = this.percentLoaded = 0; + + if (Browser.Plugins.Flash.version < 9) { + this.fireEvent('fail', ['flash']); + } else { + this.verifyLoad.delay(500, this); + } + }, + + verifyLoad: function() { + if (this.loaded) return; + if (!this.object.parentNode) { + this.fireEvent('fail', ['disabled']); + } else if (this.object.style.display == 'none') { + this.fireEvent('fail', ['hidden']); + } else if (!this.object.offsetWidth) { + this.fireEvent('fail', ['empty']); + } + }, + + fireCallback: function(name, args) { + // file* callbacks are relayed to the specific file + if (name.substr(0, 4) == 'file') { + // updated queue data is the second argument + if (args.length > 1) this.update(args[1]); + var data = args[0]; + + var file = this.findFile(data.id); + this.fireEvent(name, file || data, 5); + if (file) { + var fire = name.replace(/^file([A-Z])/, function($0, $1) { + return $1.toLowerCase(); + }); + file.update(data).fireEvent(fire, [data], 10); + } + } else { + this.fireEvent(name, args, 5); + } + }, + + update: function(data) { + // the data is saved right to the instance + $extend(this, data); + this.fireEvent('queue', [this], 10); + return this; + }, + + findFile: function(id) { + for (var i = 0; i < this.fileList.length; i++) { + if (this.fileList[i].id == id) return this.fileList[i]; + } + return null; + }, + + initializeSwiff: function() { + // extracted options for the swf + this.remote('initialize', { + width: this.options.width, + height: this.options.height, + typeFilter: this.options.typeFilter, + multiple: this.options.multiple, + queued: this.options.queued, + url: this.options.url, + method: this.options.method, + data: this.options.data, + mergeData: this.options.mergeData, + fieldName: this.options.fieldName, + verbose: this.options.verbose, + fileSizeMin: this.options.fileSizeMin, + fileSizeMax: this.options.fileSizeMax, + allowDuplicates: this.options.allowDuplicates, + buttonImage: this.options.buttonImage + }); + + this.loaded = true; + + this.appendCookieData(); + }, + + targetRelay: function(name) { + if (this.target) this.target.fireEvent(name); + }, + + reposition: function(coords) { + // update coordinates, manual or automatically + coords = coords || (this.target && this.target.offsetHeight) + ? this.target.getCoordinates(this.box.getOffsetParent()) + : {top: window.getScrollTop(), left: 0, width: 40, height: 40} + this.box.setStyles(coords); + this.fireEvent('reposition', [coords, this.box, this.target]); + }, + + setOptions: function(options) { + if (options) { + if (options.url) options.url = Swiff.Uploader.qualifyPath(options.url); + if (options.buttonImage) options.buttonImage = Swiff.Uploader.qualifyPath(options.buttonImage); + this.parent(options); + if (this.loaded) this.remote('setOptions', options); + } + return this; + }, + + setEnabled: function(status) { + this.remote('setEnabled', status); + }, + + start: function() { + this.remote('start'); + }, + + stop: function() { + this.remote('stop'); + }, + + remove: function() { + this.remote('remove'); + }, + + fileStart: function(file) { + this.remote('fileStart', file.id); + }, + + fileStop: function(file) { + this.remote('fileStop', file.id); + }, + + fileRemove: function(file) { + this.remote('fileRemove', file.id); + }, + + fileRequeue: function(file) { + this.remote('fileRequeue', file.id); + }, + + appendCookieData: function() { + var append = this.options.appendCookieData; + if (!append) return; + + var hash = {}; + document.cookie.split(/;\s*/).each(function(cookie) { + cookie = cookie.split('='); + if (cookie.length == 2) { + hash[decodeURIComponent(cookie[0])] = decodeURIComponent(cookie[1]); + } + }); + + var data = this.options.data || {}; + if ($type(append) == 'string') data[append] = hash; + else $extend(data, hash); + + this.setOptions({data: data}); + }, + + processFiles: function(successraw, failraw, queue) { + var cls = this.options.fileClass || Swiff.Uploader.File; + + var fail = [], success = []; + + if (successraw) { + successraw.each(function(data) { + var ret = new cls(this, data); + if (!ret.validate()) { + ret.remove.delay(10, ret); + fail.push(ret); + } else { + this.size += data.size; + this.fileList.push(ret); + success.push(ret); + ret.render(); + } + }, this); + + this.fireEvent('selectSuccess', [success], 10); + } + + if (failraw || fail.length) { + fail.extend((failraw) ? failraw.map(function(data) { + return new cls(this, data); + }, this) : []).each(function(file) { + file.invalidate().render(); + }); + + this.fireEvent('selectFail', [fail], 10); + } + + this.update(queue); + + if (this.options.instantStart && success.length) this.start(); + } + +}); + +$extend(Swiff.Uploader, { + + STATUS_QUEUED: 0, + STATUS_RUNNING: 1, + STATUS_ERROR: 2, + STATUS_COMPLETE: 3, + STATUS_STOPPED: 4, + + log: function() { + if (window.console && console.info) console.info.apply(console, arguments); + }, + + unitLabels: { + b: [{min: 1, unit: 'B'}, {min: 1024, unit: 'kB'}, {min: 1048576, unit: 'MB'}, {min: 1073741824, unit: 'GB'}], + s: [{min: 1, unit: 's'}, {min: 60, unit: 'm'}, {min: 3600, unit: 'h'}, {min: 86400, unit: 'd'}] + }, + + formatUnit: function(base, type, join) { + var labels = Swiff.Uploader.unitLabels[(type == 'bps') ? 'b' : type]; + var append = (type == 'bps') ? '/s' : ''; + var i, l = labels.length, value; + + if (base < 1) return '0 ' + labels[0].unit + append; + + if (type == 's') { + var units = []; + + for (i = l - 1; i >= 0; i--) { + value = Math.floor(base / labels[i].min); + if (value) { + units.push(value + ' ' + labels[i].unit); + base -= value * labels[i].min; + if (!base) break; + } + } + + return (join === false) ? units : units.join(join || ', '); + } + + for (i = l - 1; i >= 0; i--) { + value = labels[i].min; + if (base >= value) break; + } + + return (base / value).toFixed(1) + ' ' + labels[i].unit + append; + } + +}); + +Swiff.Uploader.qualifyPath = (function() { + + var anchor; + + return function(path) { + (anchor || (anchor = new Element('a'))).href = path; + return anchor.href; + }; + +})(); + +Swiff.Uploader.File = new Class({ + + Implements: Events, + + initialize: function(base, data) { + this.base = base; + this.update(data); + }, + + update: function(data) { + return $extend(this, data); + }, + + validate: function() { + var options = this.base.options; + + if (options.fileListMax && this.base.fileList.length >= options.fileListMax) { + this.validationError = 'fileListMax'; + return false; + } + + if (options.fileListSizeMax && (this.base.size + this.size) > options.fileListSizeMax) { + this.validationError = 'fileListSizeMax'; + return false; + } + + return true; + }, + + invalidate: function() { + this.invalid = true; + this.base.fireEvent('fileInvalid', this, 10); + return this.fireEvent('invalid', this, 10); + }, + + render: function() { + return this; + }, + + setOptions: function(options) { + if (options) { + if (options.url) options.url = Swiff.Uploader.qualifyPath(options.url); + this.base.remote('fileSetOptions', this.id, options); + this.options = $merge(this.options, options); + } + return this; + }, + + start: function() { + this.base.fileStart(this); + return this; + }, + + stop: function() { + this.base.fileStop(this); + return this; + }, + + remove: function() { + this.base.fileRemove(this); + return this; + }, + + requeue: function() { + this.base.fileRequeue(this); + } + +}); diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/images/adminheader.png Binary file e2gallerypro/e2upload/images/adminheader.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/images/bodybg.png Binary file e2gallerypro/e2upload/images/bodybg.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/images/loginheader.png Binary file e2gallerypro/e2upload/images/loginheader.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/images/tab_bg.png Binary file e2gallerypro/e2upload/images/tab_bg.png has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/index.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/index.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,195 @@ + + + + + (E)2 Gallery Pro File Manager + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    +

    Gallery Information

    + Parse(); + $i=1; + $k=0; + $l=0; + foreach($parser->document->gallery as $gallery){ + if($i!=1){ + echo'
    '; + } + foreach($gallery->item as $item){ + $l++; + $finalnum=$l-1; + } + echo + " + Gallery ".$i.": ".$gallery->title[0]->tagData." +
    + Description +
    + ".$gallery->description[0]->tagData." + "; + $i++; + foreach($gallery->item as $item){ + $k++; + } + } + ?> +
    +
    +
    + + \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/js/mootools-core.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/js/mootools-core.js Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,1 @@ +var MooTools={version:"1.2.2",build:"f0491d62fbb7e906789aa3733d6a67d43e5af7c9"};var Native=function(k){k=k||{};var a=k.name;var i=k.legacy;var b=k.protect;var c=k.implement;var h=k.generics;var f=k.initialize;var g=k.afterImplement||function(){};var d=f||i;h=h!==false;d.constructor=Native;d.$family={name:"native"};if(i&&f){d.prototype=i.prototype}d.prototype.constructor=d;if(a){var e=a.toLowerCase();d.prototype.$family={name:e};Native.typize(d,e)}var j=function(n,l,o,m){if(!b||m||!n.prototype[l]){n.prototype[l]=o}if(h){Native.genericize(n,l,b)}g.call(n,l,o);return n};d.alias=function(n,l,o){if(typeof n=="string"){if((n=this.prototype[n])){return j(this,l,n,o)}}for(var m in n){this.alias(m,n[m],l)}return this};d.implement=function(m,l,o){if(typeof m=="string"){return j(this,m,l,o)}for(var n in m){j(this,n,m[n],l)}return this};if(c){d.implement(c)}return d};Native.genericize=function(b,c,a){if((!a||!b[c])&&typeof b.prototype[c]=="function"){b[c]=function(){var d=Array.prototype.slice.call(arguments);return b.prototype[c].apply(d.shift(),d)}}};Native.implement=function(d,c){for(var b=0,a=d.length;b-1:this.indexOf(a)>-1},trim:function(){return this.replace(/^\s+|\s+$/g,"")},clean:function(){return this.replace(/\s+/g," ").trim()},camelCase:function(){return this.replace(/-\D/g,function(a){return a.charAt(1).toUpperCase()})},hyphenate:function(){return this.replace(/[A-Z]/g,function(a){return("-"+a.charAt(0).toLowerCase())})},capitalize:function(){return this.replace(/\b[a-z]/g,function(a){return a.toUpperCase()})},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")},toInt:function(a){return parseInt(this,a||10)},toFloat:function(){return parseFloat(this)},hexToRgb:function(b){var a=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return(a)?a.slice(1).hexToRgb(b):null},rgbToHex:function(b){var a=this.match(/\d{1,3}/g);return(a)?a.rgbToHex(b):null},stripScripts:function(b){var a="";var c=this.replace(/]*>([\s\S]*?)<\/script>/gi,function(){a+=arguments[1]+"\n";return""});if(b===true){$exec(a)}else{if($type(b)=="function"){b(a,c)}}return c},substitute:function(a,b){return this.replace(b||(/\\?\{([^{}]+)\}/g),function(d,c){if(d.charAt(0)=="\\"){return d.slice(1)}return(a[c]!=undefined)?a[c]:""})}});Hash.implement({has:Object.prototype.hasOwnProperty,keyOf:function(b){for(var a in this){if(this.hasOwnProperty(a)&&this[a]===b){return a}}return null},hasValue:function(a){return(Hash.keyOf(this,a)!==null)},extend:function(a){Hash.each(a,function(c,b){Hash.set(this,b,c)},this);return this},combine:function(a){Hash.each(a,function(c,b){Hash.include(this,b,c)},this);return this},erase:function(a){if(this.hasOwnProperty(a)){delete this[a]}return this},get:function(a){return(this.hasOwnProperty(a))?this[a]:null},set:function(a,b){if(!this[a]||this.hasOwnProperty(a)){this[a]=b}return this},empty:function(){Hash.each(this,function(b,a){delete this[a]},this);return this},include:function(a,b){if(this[a]==undefined){this[a]=b}return this},map:function(b,c){var a=new Hash;Hash.each(this,function(e,d){a.set(d,b.call(c,e,d,this))},this);return a},filter:function(b,c){var a=new Hash;Hash.each(this,function(e,d){if(b.call(c,e,d,this)){a.set(d,e)}},this);return a},every:function(b,c){for(var a in this){if(this.hasOwnProperty(a)&&!b.call(c,this[a],a)){return false}}return true},some:function(b,c){for(var a in this){if(this.hasOwnProperty(a)&&b.call(c,this[a],a)){return true}}return false},getKeys:function(){var a=[];Hash.each(this,function(c,b){a.push(b)});return a},getValues:function(){var a=[];Hash.each(this,function(b){a.push(b)});return a},toQueryString:function(a){var b=[];Hash.each(this,function(f,e){if(a){e=a+"["+e+"]"}var d;switch($type(f)){case"object":d=Hash.toQueryString(f,e);break;case"array":var c={};f.each(function(h,g){c[g]=h});d=Hash.toQueryString(c,e);break;default:d=e+"="+encodeURIComponent(f)}if(f!=undefined){b.push(d)}});return b.join("&")}});Hash.alias({keyOf:"indexOf",hasValue:"contains"});var Event=new Native({name:"Event",initialize:function(a,f){f=f||window;var k=f.document;a=a||f.event;if(a.$extended){return a}this.$extended=true;var j=a.type;var g=a.target||a.srcElement;while(g&&g.nodeType==3){g=g.parentNode}if(j.test(/key/)){var b=a.which||a.keyCode;var m=Event.Keys.keyOf(b);if(j=="keydown"){var d=b-111;if(d>0&&d<13){m="f"+d}}m=m||String.fromCharCode(b).toLowerCase()}else{if(j.match(/(click|mouse|menu)/i)){k=(!k.compatMode||k.compatMode=="CSS1Compat")?k.html:k.body;var i={x:a.pageX||a.clientX+k.scrollLeft,y:a.pageY||a.clientY+k.scrollTop};var c={x:(a.pageX)?a.pageX-f.pageXOffset:a.clientX,y:(a.pageY)?a.pageY-f.pageYOffset:a.clientY};if(j.match(/DOMMouseScroll|mousewheel/)){var h=(a.wheelDelta)?a.wheelDelta/120:-(a.detail||0)/3}var e=(a.which==3)||(a.button==2);var l=null;if(j.match(/over|out/)){switch(j){case"mouseover":l=a.relatedTarget||a.fromElement;break;case"mouseout":l=a.relatedTarget||a.toElement}if(!(function(){while(l&&l.nodeType==3){l=l.parentNode}return true}).create({attempt:Browser.Engine.gecko})()){l=false}}}}return $extend(this,{event:a,type:j,page:i,client:c,rightClick:e,wheel:h,relatedTarget:l,target:g,code:b,key:m,shift:a.shiftKey,control:a.ctrlKey,alt:a.altKey,meta:a.metaKey})}});Event.Keys=new Hash({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});Event.implement({stop:function(){return this.stopPropagation().preventDefault()},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation()}else{this.event.cancelBubble=true}return this},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault()}else{this.event.returnValue=false}return this}});function Class(b){if(b instanceof Function){b={initialize:b}}var a=function(){Object.reset(this);if(a._prototyping){return this}this._current=$empty;var c=(this.initialize)?this.initialize.apply(this,arguments):this;delete this._current;delete this.caller;return c}.extend(this);a.implement(b);a.constructor=Class;a.prototype.constructor=a;return a}Function.prototype.protect=function(){this._protected=true;return this};Object.reset=function(a,c){if(c==null){for(var e in a){Object.reset(a,e)}return a}delete a[c];switch($type(a[c])){case"object":var d=function(){};d.prototype=a[c];var b=new d;a[c]=Object.reset(b);break;case"array":a[c]=$unlink(a[c]);break}return a};new Native({name:"Class",initialize:Class}).extend({instantiate:function(b){b._prototyping=true;var a=new b;delete b._prototyping;return a},wrap:function(a,b,c){if(c._origin){c=c._origin}return function(){if(c._protected&&this._current==null){throw new Error('The method "'+b+'" cannot be called.')}var e=this.caller,f=this._current;this.caller=f;this._current=arguments.callee;var d=c.apply(this,arguments);this._current=f;this.caller=e;return d}.extend({_owner:a,_origin:c,_name:b})}});Class.implement({implement:function(a,d){if($type(a)=="object"){for(var e in a){this.implement(e,a[e])}return this}var f=Class.Mutators[a];if(f){d=f.call(this,d);if(d==null){return this}}var c=this.prototype;switch($type(d)){case"function":if(d._hidden){return this}c[a]=Class.wrap(this,a,d);break;case"object":var b=c[a];if($type(b)=="object"){$mixin(b,d)}else{c[a]=$unlink(d)}break;case"array":c[a]=$unlink(d);break;default:c[a]=d}return this}});Class.Mutators={Extends:function(a){this.parent=a;this.prototype=Class.instantiate(a);this.implement("parent",function(){var b=this.caller._name,c=this.caller._owner.parent.prototype[b];if(!c){throw new Error('The method "'+b+'" has no parent.')}return c.apply(this,arguments)}.protect())},Implements:function(a){$splat(a).each(function(b){if(b instanceof Function){b=Class.instantiate(b)}this.implement(b)},this)}};var Chain=new Class({$chain:[],chain:function(){this.$chain.extend(Array.flatten(arguments));return this},callChain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments):false},clearChain:function(){this.$chain.empty();return this}});var Events=new Class({$events:{},addEvent:function(c,b,a){c=Events.removeOn(c);if(b!=$empty){this.$events[c]=this.$events[c]||[];this.$events[c].include(b);if(a){b.internal=true}}return this},addEvents:function(a){for(var b in a){this.addEvent(b,a[b])}return this},fireEvent:function(c,b,a){c=Events.removeOn(c);if(!this.$events||!this.$events[c]){return this}this.$events[c].each(function(d){d.create({bind:this,delay:a,"arguments":b})()},this);return this},removeEvent:function(b,a){b=Events.removeOn(b);if(!this.$events[b]){return this}if(!a.internal){this.$events[b].erase(a)}return this},removeEvents:function(c){var d;if($type(c)=="object"){for(d in c){this.removeEvent(d,c[d])}return this}if(c){c=Events.removeOn(c)}for(d in this.$events){if(c&&c!=d){continue}var b=this.$events[d];for(var a=b.length;a--;a){this.removeEvent(d,b[a])}}return this}});Events.removeOn=function(a){return a.replace(/^on([A-Z])/,function(b,c){return c.toLowerCase()})};var Options=new Class({setOptions:function(){this.options=$merge.run([this.options].extend(arguments));if(!this.addEvent){return this}for(var a in this.options){if($type(this.options[a])!="function"||!(/^on[A-Z]/).test(a)){continue}this.addEvent(a,this.options[a]);delete this.options[a]}return this}});var Element=new Native({name:"Element",legacy:window.Element,initialize:function(a,b){var c=Element.Constructors.get(a);if(c){return c(b)}if(typeof a=="string"){return document.newElement(a,b)}return $(a).set(b)},afterImplement:function(a,b){Element.Prototype[a]=b;if(Array[a]){return}Elements.implement(a,function(){var c=[],g=true;for(var e=0,d=this.length;e"}return $.element(this.createElement(a)).set(b)},newTextNode:function(a){return this.createTextNode(a)},getDocument:function(){return this},getWindow:function(){return this.window}});Window.implement({$:function(b,c){if(b&&b.$family&&b.uid){return b}var a=$type(b);return($[a])?$[a](b,c,this.document):null},$$:function(a){if(arguments.length==1&&typeof a=="string"){return this.document.getElements(a)}var f=[];var c=Array.flatten(arguments);for(var d=0,b=c.length;d1);a.each(function(e){var f=this.getElementsByTagName(e.trim());(b)?c.extend(f):c=f},this);return new Elements(c,{ddup:b,cash:!d})}});(function(){var h={},f={};var i={input:"checked",option:"selected",textarea:(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerHTML":"value"};var c=function(l){return(f[l]||(f[l]={}))};var g=function(n,l){if(!n){return}var m=n.uid;if(Browser.Engine.trident){if(n.clearAttributes){var q=l&&n.cloneNode(false);n.clearAttributes();if(q){n.mergeAttributes(q)}}else{if(n.removeEvents){n.removeEvents()}}if((/object/i).test(n.tagName)){for(var o in n){if(typeof n[o]=="function"){n[o]=$empty}}Element.dispose(n)}}if(!m){return}h[m]=f[m]=null};var d=function(){Hash.each(h,g);if(Browser.Engine.trident){$A(document.getElementsByTagName("object")).each(g)}if(window.CollectGarbage){CollectGarbage()}h=f=null};var j=function(n,l,s,m,p,r){var o=n[s||l];var q=[];while(o){if(o.nodeType==1&&(!m||Element.match(o,m))){if(!p){return $(o,r)}q.push(o)}o=o[l]}return(p)?new Elements(q,{ddup:false,cash:!r}):null};var e={html:"innerHTML","class":"className","for":"htmlFor",text:(Browser.Engine.trident||(Browser.Engine.webkit&&Browser.Engine.version<420))?"innerText":"textContent"};var b=["compact","nowrap","ismap","declare","noshade","checked","disabled","readonly","multiple","selected","noresize","defer"];var k=["value","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","maxLength","readOnly","rowSpan","tabIndex","useMap"];b=b.associate(b);Hash.extend(e,b);Hash.extend(e,k.associate(k.map(String.toLowerCase)));var a={before:function(m,l){if(l.parentNode){l.parentNode.insertBefore(m,l)}},after:function(m,l){if(!l.parentNode){return}var n=l.nextSibling;(n)?l.parentNode.insertBefore(m,n):l.parentNode.appendChild(m)},bottom:function(m,l){l.appendChild(m)},top:function(m,l){var n=l.firstChild;(n)?l.insertBefore(m,n):l.appendChild(m)}};a.inside=a.bottom;Hash.each(a,function(l,m){m=m.capitalize();Element.implement("inject"+m,function(n){l(this,$(n,true));return this});Element.implement("grab"+m,function(n){l($(n,true),this);return this})});Element.implement({set:function(o,m){switch($type(o)){case"object":for(var n in o){this.set(n,o[n])}break;case"string":var l=Element.Properties.get(o);(l&&l.set)?l.set.apply(this,Array.slice(arguments,1)):this.setProperty(o,m)}return this},get:function(m){var l=Element.Properties.get(m);return(l&&l.get)?l.get.apply(this,Array.slice(arguments,1)):this.getProperty(m)},erase:function(m){var l=Element.Properties.get(m);(l&&l.erase)?l.erase.apply(this):this.removeProperty(m);return this},setProperty:function(m,n){var l=e[m];if(n==undefined){return this.removeProperty(m)}if(l&&b[m]){n=!!n}(l)?this[l]=n:this.setAttribute(m,""+n);return this},setProperties:function(l){for(var m in l){this.setProperty(m,l[m])}return this},getProperty:function(m){var l=e[m];var n=(l)?this[l]:this.getAttribute(m,2);return(b[m])?!!n:(l)?n:n||null},getProperties:function(){var l=$A(arguments);return l.map(this.getProperty,this).associate(l)},removeProperty:function(m){var l=e[m];(l)?this[l]=(l&&b[m])?false:"":this.removeAttribute(m);return this},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this},hasClass:function(l){return this.className.contains(l," ")},addClass:function(l){if(!this.hasClass(l)){this.className=(this.className+" "+l).clean()}return this},removeClass:function(l){this.className=this.className.replace(new RegExp("(^|\\s)"+l+"(?:\\s|$)"),"$1");return this},toggleClass:function(l){return this.hasClass(l)?this.removeClass(l):this.addClass(l)},adopt:function(){Array.flatten(arguments).each(function(l){l=$(l,true);if(l){this.appendChild(l)}},this);return this},appendText:function(m,l){return this.grab(this.getDocument().newTextNode(m),l)},grab:function(m,l){a[l||"bottom"]($(m,true),this);return this},inject:function(m,l){a[l||"bottom"](this,$(m,true));return this},replaces:function(l){l=$(l,true);l.parentNode.replaceChild(this,l);return this},wraps:function(m,l){m=$(m,true);return this.replaces(m).grab(m,l)},getPrevious:function(l,m){return j(this,"previousSibling",null,l,false,m)},getAllPrevious:function(l,m){return j(this,"previousSibling",null,l,true,m)},getNext:function(l,m){return j(this,"nextSibling",null,l,false,m)},getAllNext:function(l,m){return j(this,"nextSibling",null,l,true,m)},getFirst:function(l,m){return j(this,"nextSibling","firstChild",l,false,m)},getLast:function(l,m){return j(this,"previousSibling","lastChild",l,false,m)},getParent:function(l,m){return j(this,"parentNode",null,l,false,m)},getParents:function(l,m){return j(this,"parentNode",null,l,true,m)},getSiblings:function(l,m){return this.getParent().getChildren(l,m).erase(this)},getChildren:function(l,m){return j(this,"nextSibling","firstChild",l,true,m)},getWindow:function(){return this.ownerDocument.window},getDocument:function(){return this.ownerDocument},getElementById:function(o,n){var m=this.ownerDocument.getElementById(o);if(!m){return null}for(var l=m.parentNode;l!=this;l=l.parentNode){if(!l){return null}}return $.element(m,n)},getSelected:function(){return new Elements($A(this.options).filter(function(l){return l.selected}))},getComputedStyle:function(m){if(this.currentStyle){return this.currentStyle[m.camelCase()]}var l=this.getDocument().defaultView.getComputedStyle(this,null);return(l)?l.getPropertyValue([m.hyphenate()]):null},toQueryString:function(){var l=[];this.getElements("input, select, textarea",true).each(function(m){if(!m.name||m.disabled){return}var n=(m.tagName.toLowerCase()=="select")?Element.getSelected(m).map(function(o){return o.value}):((m.type=="radio"||m.type=="checkbox")&&!m.checked)?null:m.value;$splat(n).each(function(o){if(typeof o!="undefined"){l.push(m.name+"="+encodeURIComponent(o))}})});return l.join("&")},clone:function(o,l){o=o!==false;var r=this.cloneNode(o);var n=function(v,u){if(!l){v.removeAttribute("id")}if(Browser.Engine.trident){v.clearAttributes();v.mergeAttributes(u);v.removeAttribute("uid");if(v.options){var w=v.options,s=u.options;for(var t=w.length;t--;){w[t].selected=s[t].selected}}}var x=i[u.tagName.toLowerCase()];if(x&&u[x]){v[x]=u[x]}};if(o){var p=r.getElementsByTagName("*"),q=this.getElementsByTagName("*");for(var m=p.length;m--;){n(p[m],q[m])}}n(r,this);return $(r)},destroy:function(){Element.empty(this);Element.dispose(this);g(this,true);return null},empty:function(){$A(this.childNodes).each(function(l){Element.destroy(l)});return this},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this},hasChild:function(l){l=$(l,true);if(!l){return false}if(Browser.Engine.webkit&&Browser.Engine.version<420){return $A(this.getElementsByTagName(l.tagName)).contains(l)}return(this.contains)?(this!=l&&this.contains(l)):!!(this.compareDocumentPosition(l)&16)},match:function(l){return(!l||(l==this)||(Element.get(this,"tag")==l))}});Native.implement([Element,Window,Document],{addListener:function(o,n){if(o=="unload"){var l=n,m=this;n=function(){m.removeListener("unload",n);l()}}else{h[this.uid]=this}if(this.addEventListener){this.addEventListener(o,n,false)}else{this.attachEvent("on"+o,n)}return this},removeListener:function(m,l){if(this.removeEventListener){this.removeEventListener(m,l,false)}else{this.detachEvent("on"+m,l)}return this},retrieve:function(m,l){var o=c(this.uid),n=o[m];if(l!=undefined&&n==undefined){n=o[m]=l}return $pick(n)},store:function(m,l){var n=c(this.uid);n[m]=l;return this},eliminate:function(l){var m=c(this.uid);delete m[l];return this}});window.addListener("unload",d)})();Element.Properties=new Hash;Element.Properties.style={set:function(a){this.style.cssText=a},get:function(){return this.style.cssText},erase:function(){this.style.cssText=""}};Element.Properties.tag={get:function(){return this.tagName.toLowerCase()}};Element.Properties.html=(function(){var c=document.createElement("div");var a={table:[1,"","
    "],select:[1,""],tbody:[2,"","
    "],tr:[3,"","
    "]};a.thead=a.tfoot=a.tbody;var b={set:function(){var e=Array.flatten(arguments).join("");var f=Browser.Engine.trident&&a[this.get("tag")];if(f){var g=c;g.innerHTML=f[1]+e+f[2];for(var d=f[0];d--;){g=g.firstChild}this.empty().adopt(g.childNodes)}else{this.innerHTML=e}}};b.erase=b.set;return b})();if(Browser.Engine.webkit&&Browser.Engine.version<420){Element.Properties.text={get:function(){if(this.innerText){return this.innerText}var a=this.ownerDocument.newElement("div",{html:this.innerHTML}).inject(this.ownerDocument.body);var b=a.innerText;a.destroy();return b}}}Element.Properties.events={set:function(a){this.addEvents(a)}};Native.implement([Element,Window,Document],{addEvent:function(e,g){var h=this.retrieve("events",{});h[e]=h[e]||{keys:[],values:[]};if(h[e].keys.contains(g)){return this}h[e].keys.push(g);var f=e,a=Element.Events.get(e),c=g,i=this;if(a){if(a.onAdd){a.onAdd.call(this,g)}if(a.condition){c=function(j){if(a.condition.call(this,j)){return g.call(this,j)}return true}}f=a.base||f}var d=function(){return g.call(i)};var b=Element.NativeEvents[f];if(b){if(b==2){d=function(j){j=new Event(j,i.getWindow());if(c.call(i,j)===false){j.stop()}}}this.addListener(f,d)}h[e].values.push(d);return this},removeEvent:function(c,b){var a=this.retrieve("events");if(!a||!a[c]){return this}var f=a[c].keys.indexOf(b);if(f==-1){return this}a[c].keys.splice(f,1);var e=a[c].values.splice(f,1)[0];var d=Element.Events.get(c);if(d){if(d.onRemove){d.onRemove.call(this,b)}c=d.base||c}return(Element.NativeEvents[c])?this.removeListener(c,e):this},addEvents:function(a){for(var b in a){this.addEvent(b,a[b])}return this},removeEvents:function(a){var c;if($type(a)=="object"){for(c in a){this.removeEvent(c,a[c])}return this}var b=this.retrieve("events");if(!b){return this}if(!a){for(c in b){this.removeEvents(c)}this.eliminate("events")}else{if(b[a]){while(b[a].keys[0]){this.removeEvent(a,b[a].keys[0])}b[a]=null}}return this},fireEvent:function(d,b,a){var c=this.retrieve("events");if(!c||!c[d]){return this}c[d].keys.each(function(e){e.create({bind:this,delay:a,"arguments":b})()},this);return this},cloneEvents:function(d,a){d=$(d);var c=d.retrieve("events");if(!c){return this}if(!a){for(var b in c){this.cloneEvents(d,b)}}else{if(c[a]){c[a].keys.each(function(e){this.addEvent(a,e)},this)}}return this}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:1,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1};(function(){var a=function(b){var c=b.relatedTarget;if(c==undefined){return true}if(c===false){return false}return($type(this)!="document"&&c!=this&&c.prefix!="xul"&&!this.hasChild(c))};Element.Events=new Hash({mouseenter:{base:"mouseover",condition:a},mouseleave:{base:"mouseout",condition:a},mousewheel:{base:(Browser.Engine.gecko)?"DOMMouseScroll":"mousewheel"}})})();Element.Properties.styles={set:function(a){this.setStyles(a)}};Element.Properties.opacity={set:function(a,b){if(!b){if(a==0){if(this.style.visibility!="hidden"){this.style.visibility="hidden"}}else{if(this.style.visibility!="visible"){this.style.visibility="visible"}}}if(!this.currentStyle||!this.currentStyle.hasLayout){this.style.zoom=1}if(Browser.Engine.trident){this.style.filter=(a==1)?"":"alpha(opacity="+a*100+")"}this.style.opacity=a;this.store("opacity",a)},get:function(){return this.retrieve("opacity",1)}};Element.implement({setOpacity:function(a){return this.set("opacity",a,true)},getOpacity:function(){return this.get("opacity")},setStyle:function(b,a){switch(b){case"opacity":return this.set("opacity",parseFloat(a));case"float":b=(Browser.Engine.trident)?"styleFloat":"cssFloat"}b=b.camelCase();if($type(a)!="string"){var c=(Element.Styles.get(b)||"@").split(" ");a=$splat(a).map(function(e,d){if(!c[d]){return""}return($type(e)=="number")?c[d].replace("@",Math.round(e)):e}).join(" ")}else{if(a==String(Number(a))){a=Math.round(a)}}this.style[b]=a;return this},getStyle:function(g){switch(g){case"opacity":return this.get("opacity");case"float":g=(Browser.Engine.trident)?"styleFloat":"cssFloat"}g=g.camelCase();var a=this.style[g];if(!$chk(a)){a=[];for(var f in Element.ShortStyles){if(g!=f){continue}for(var e in Element.ShortStyles[f]){a.push(this.getStyle(e))}return a.join(" ")}a=this.getComputedStyle(g)}if(a){a=String(a);var c=a.match(/rgba?\([\d\s,]+\)/);if(c){a=a.replace(c[0],c[0].rgbToHex())}}if(Browser.Engine.presto||(Browser.Engine.trident&&!$chk(parseInt(a,10)))){if(g.test(/^(height|width)$/)){var b=(g=="width")?["left","right"]:["top","bottom"],d=0;b.each(function(h){d+=this.getStyle("border-"+h+"-width").toInt()+this.getStyle("padding-"+h).toInt()},this);return this["offset"+g.capitalize()]-d+"px"}if((Browser.Engine.presto)&&String(a).test("px")){return a}if(g.test(/(border(.+)Width|margin|padding)/)){return"0px"}}return a},setStyles:function(b){for(var a in b){this.setStyle(a,b[a])}return this},getStyles:function(){var a={};Array.each(arguments,function(b){a[b]=this.getStyle(b)},this);return a}});Element.Styles=new Hash({left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"});Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};["Top","Right","Bottom","Left"].each(function(g){var f=Element.ShortStyles;var b=Element.Styles;["margin","padding"].each(function(h){var i=h+g;f[h][i]=b[i]="@px"});var e="border"+g;f.border[e]=b[e]="@px @ rgb(@, @, @)";var d=e+"Width",a=e+"Style",c=e+"Color";f[e]={};f.borderWidth[d]=f[e][d]=b[d]="@px";f.borderStyle[a]=f[e][a]=b[a]="@";f.borderColor[c]=f[e][c]=b[c]="rgb(@, @, @)"});(function(){Element.implement({scrollTo:function(h,i){if(b(this)){this.getWindow().scrollTo(h,i)}else{this.scrollLeft=h;this.scrollTop=i}return this},getSize:function(){if(b(this)){return this.getWindow().getSize()}return{x:this.offsetWidth,y:this.offsetHeight}},getScrollSize:function(){if(b(this)){return this.getWindow().getScrollSize()}return{x:this.scrollWidth,y:this.scrollHeight}},getScroll:function(){if(b(this)){return this.getWindow().getScroll()}return{x:this.scrollLeft,y:this.scrollTop}},getScrolls:function(){var i=this,h={x:0,y:0};while(i&&!b(i)){h.x+=i.scrollLeft;h.y+=i.scrollTop;i=i.parentNode}return h},getOffsetParent:function(){var h=this;if(b(h)){return null}if(!Browser.Engine.trident){return h.offsetParent}while((h=h.parentNode)&&!b(h)){if(d(h,"position")!="static"){return h}}return null},getOffsets:function(){if(Browser.Engine.trident){var l=this.getBoundingClientRect(),j=this.getDocument().documentElement;var m=d(this,"position")=="fixed";return{x:l.left+((m)?0:j.scrollLeft)-j.clientLeft,y:l.top+((m)?0:j.scrollTop)-j.clientTop}}var i=this,h={x:0,y:0};if(b(this)){return h}while(i&&!b(i)){h.x+=i.offsetLeft;h.y+=i.offsetTop;if(Browser.Engine.gecko){if(!f(i)){h.x+=c(i);h.y+=g(i)}var k=i.parentNode;if(k&&d(k,"overflow")!="visible"){h.x+=c(k);h.y+=g(k)}}else{if(i!=this&&Browser.Engine.webkit){h.x+=c(i);h.y+=g(i)}}i=i.offsetParent}if(Browser.Engine.gecko&&!f(this)){h.x-=c(this);h.y-=g(this)}return h},getPosition:function(k){if(b(this)){return{x:0,y:0}}var l=this.getOffsets(),i=this.getScrolls();var h={x:l.x-i.x,y:l.y-i.y};var j=(k&&(k=$(k)))?k.getPosition():{x:0,y:0};return{x:h.x-j.x,y:h.y-j.y}},getCoordinates:function(j){if(b(this)){return this.getWindow().getCoordinates()}var h=this.getPosition(j),i=this.getSize();var k={left:h.x,top:h.y,width:i.x,height:i.y};k.right=k.left+k.width;k.bottom=k.top+k.height;return k},computePosition:function(h){return{left:h.x-e(this,"margin-left"),top:h.y-e(this,"margin-top")}},position:function(h){return this.setStyles(this.computePosition(h))}});Native.implement([Document,Window],{getSize:function(){if(Browser.Engine.presto||Browser.Engine.webkit){var i=this.getWindow();return{x:i.innerWidth,y:i.innerHeight}}var h=a(this);return{x:h.clientWidth,y:h.clientHeight}},getScroll:function(){var i=this.getWindow(),h=a(this);return{x:i.pageXOffset||h.scrollLeft,y:i.pageYOffset||h.scrollTop}},getScrollSize:function(){var i=a(this),h=this.getSize();return{x:Math.max(i.scrollWidth,h.x),y:Math.max(i.scrollHeight,h.y)}},getPosition:function(){return{x:0,y:0}},getCoordinates:function(){var h=this.getSize();return{top:0,left:0,bottom:h.y,right:h.x,height:h.y,width:h.x}}});var d=Element.getComputedStyle;function e(h,i){return d(h,i).toInt()||0}function f(h){return d(h,"-moz-box-sizing")=="border-box"}function g(h){return e(h,"border-top-width")}function c(h){return e(h,"border-left-width")}function b(h){return(/^(?:body|html)$/i).test(h.tagName)}function a(h){var i=h.getDocument();return(!i.compatMode||i.compatMode=="CSS1Compat")?i.html:i.body}})();Native.implement([Window,Document,Element],{getHeight:function(){return this.getSize().y},getWidth:function(){return this.getSize().x},getScrollTop:function(){return this.getScroll().y},getScrollLeft:function(){return this.getScroll().x},getScrollHeight:function(){return this.getScrollSize().y},getScrollWidth:function(){return this.getScrollSize().x},getTop:function(){return this.getPosition().y},getLeft:function(){return this.getPosition().x}});Native.implement([Document,Element],{getElements:function(h,g){h=h.split(",");var c,e={};for(var d=0,b=h.length;d1),cash:!g})}});Element.implement({match:function(b){if(!b||(b==this)){return true}var d=Selectors.Utils.parseTagAndID(b);var a=d[0],e=d[1];if(!Selectors.Filters.byID(this,e)||!Selectors.Filters.byTag(this,a)){return false}var c=Selectors.Utils.parseSelector(b);return(c)?Selectors.Utils.filter(this,c,{}):true}});var Selectors={Cache:{nth:{},parsed:{}}};Selectors.RegExps={id:(/#([\w-]+)/),tag:(/^(\w+|\*)/),quick:(/^(\w+|\*)$/),splitter:(/\s*([+>~\s])\s*([a-zA-Z#.*:\[])/g),combined:(/\.([\w-]+)|\[(\w+)(?:([!*^$~|]?=)(["']?)([^\4]*?)\4)?\]|:([\w-]+)(?:\(["']?(.*?)?["']?\)|$)/g)};Selectors.Utils={chk:function(b,c){if(!c){return true}var a=$uid(b);if(!c[a]){return c[a]=true}return false},parseNthArgument:function(h){if(Selectors.Cache.nth[h]){return Selectors.Cache.nth[h]}var e=h.match(/^([+-]?\d*)?([a-z]+)?([+-]?\d*)?$/);if(!e){return false}var g=parseInt(e[1],10);var d=(g||g===0)?g:1;var f=e[2]||false;var c=parseInt(e[3],10)||0;if(d!=0){c--;while(c<1){c+=d}while(c>=d){c-=d}}else{d=c;f="index"}switch(f){case"n":e={a:d,b:c,special:"n"};break;case"odd":e={a:2,b:0,special:"n"};break;case"even":e={a:2,b:1,special:"n"};break;case"first":e={a:0,special:"index"};break;case"last":e={special:"last-child"};break;case"only":e={special:"only-child"};break;default:e={a:(d-1),special:"index"}}return Selectors.Cache.nth[h]=e},parseSelector:function(e){if(Selectors.Cache.parsed[e]){return Selectors.Cache.parsed[e]}var d,h={classes:[],pseudos:[],attributes:[]};while((d=Selectors.RegExps.combined.exec(e))){var i=d[1],g=d[2],f=d[3],b=d[5],c=d[6],j=d[7];if(i){h.classes.push(i)}else{if(c){var a=Selectors.Pseudo.get(c);if(a){h.pseudos.push({parser:a,argument:j})}else{h.attributes.push({name:c,operator:"=",value:j})}}else{if(g){h.attributes.push({name:g,operator:f,value:b})}}}}if(!h.classes.length){delete h.classes}if(!h.attributes.length){delete h.attributes}if(!h.pseudos.length){delete h.pseudos}if(!h.classes&&!h.attributes&&!h.pseudos){h=null}return Selectors.Cache.parsed[e]=h},parseTagAndID:function(b){var a=b.match(Selectors.RegExps.tag);var c=b.match(Selectors.RegExps.id);return[(a)?a[1]:"*",(c)?c[1]:false]},filter:function(f,c,e){var d;if(c.classes){for(d=c.classes.length;d--;d){var g=c.classes[d];if(!Selectors.Filters.byClass(f,g)){return false}}}if(c.attributes){for(d=c.attributes.length;d--;d){var b=c.attributes[d];if(!Selectors.Filters.byAttribute(f,b.name,b.operator,b.value)){return false}}}if(c.pseudos){for(d=c.pseudos.length;d--;d){var a=c.pseudos[d];if(!Selectors.Filters.byPseudo(f,a.parser,a.argument,e)){return false}}}return true},getByTagAndID:function(b,a,d){if(d){var c=(b.getElementById)?b.getElementById(d,true):Element.getElementById(b,d,true);return(c&&Selectors.Filters.byTag(c,a))?[c]:[]}else{return b.getElementsByTagName(a)}},search:function(o,h,t){var b=[];var c=h.trim().replace(Selectors.RegExps.splitter,function(k,j,i){b.push(j);return":)"+i}).split(":)");var p,e,A;for(var z=0,v=c.length;z":function(h,g,j,a,f){var c=Selectors.Utils.getByTagAndID(g,j,a);for(var e=0,d=c.length;ea){return false}}return(c==a)},even:function(b,a){return Selectors.Pseudo["nth-child"].call(this,"2n+1",a)},odd:function(b,a){return Selectors.Pseudo["nth-child"].call(this,"2n",a)},selected:function(){return this.selected}});Element.Events.domready={onAdd:function(a){if(Browser.loaded){a.call(this)}}};(function(){var b=function(){if(Browser.loaded){return}Browser.loaded=true;window.fireEvent("domready");document.fireEvent("domready")};if(Browser.Engine.trident){var a=document.createElement("div");(function(){($try(function(){a.doScroll("left");return $(a).inject(document.body).set("html","temp").dispose()}))?b():arguments.callee.delay(50)})()}else{if(Browser.Engine.webkit&&Browser.Engine.version<525){(function(){(["loaded","complete"].contains(document.readyState))?b():arguments.callee.delay(50)})()}else{window.addEvent("load",b);document.addEvent("DOMContentLoaded",b)}}})();var JSON=new Hash({$specialChars:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},$replaceChars:function(a){return JSON.$specialChars[a]||"\\u00"+Math.floor(a.charCodeAt()/16).toString(16)+(a.charCodeAt()%16).toString(16)},encode:function(b){switch($type(b)){case"string":return'"'+b.replace(/[\x00-\x1f\\"]/g,JSON.$replaceChars)+'"';case"array":return"["+String(b.map(JSON.encode).filter($defined))+"]";case"object":case"hash":var a=[];Hash.each(b,function(e,d){var c=JSON.encode(e);if(c){a.push(JSON.encode(d)+":"+c)}});return"{"+a+"}";case"number":case"boolean":return String(b);case false:return"null"}return null},decode:function(string,secure){if($type(string)!="string"||!string.length){return null}if(secure&&!(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(string.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))){return null}return eval("("+string+")")}});Native.implement([Hash,Array,String,Number],{toJSON:function(){return JSON.encode(this)}});var Swiff=new Class({Implements:[Options],options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:"high",allowScriptAccess:"always",wMode:"transparent",swLiveConnect:true},callBacks:{},vars:{}},toElement:function(){return this.object},initialize:function(l,m){this.instance="Swiff_"+$time();this.setOptions(m);m=this.options;var b=this.id=m.id||this.instance;var a=$(m.container);Swiff.CallBacks[this.instance]={};var e=m.params,g=m.vars,f=m.callBacks;var h=$extend({height:m.height,width:m.width},m.properties);var k=this;for(var d in f){Swiff.CallBacks[this.instance][d]=(function(n){return function(){return n.apply(k.object,arguments)}})(f[d]);g[d]="Swiff.CallBacks."+this.instance+"."+d}e.flashVars=Hash.toQueryString(g);if(Browser.Engine.trident){h.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";e.movie=l}else{h.type="application/x-shockwave-flash";h.data=l}var j=''}}j+="";this.object=((a)?a.empty():new Element("div")).set("html",j).firstChild},replaces:function(a){a=$(a,true);a.parentNode.replaceChild(this.toElement(),a);return this},inject:function(a){$(a,true).appendChild(this.toElement());return this},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].extend(arguments))}});Swiff.CallBacks={};Swiff.remote=function(obj,fn){var rs=obj.CallFunction(''+__flash__argumentsToXML(arguments,2)+"");return eval(rs)};var Fx=new Class({Implements:[Chain,Events,Options],options:{fps:50,unit:false,duration:500,link:"ignore"},initialize:function(a){this.subject=this.subject||this;this.setOptions(a);this.options.duration=Fx.Durations[this.options.duration]||this.options.duration.toInt();var b=this.options.wait;if(b===false){this.options.link="cancel"}},getTransition:function(){return function(a){return -(Math.cos(Math.PI*a)-1)/2}},step:function(){var a=$time();if(a=(7-4*d)/11){e=c*c-Math.pow((11-6*d-11*f)/4,2);break}}return e},Elastic:function(b,a){return Math.pow(2,10*--b)*Math.cos(20*b*Math.PI*(a[0]||1)/3)}});["Quad","Cubic","Quart","Quint"].each(function(b,a){Fx.Transitions[b]=new Fx.Transition(function(c){return Math.pow(c,[a+2])})});var Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false,noCache:false},initialize:function(a){this.xhr=new Browser.Request();this.setOptions(a);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers=new Hash(this.options.headers)},onStateChange:function(){if(this.xhr.readyState!=4||!this.running){return}this.running=false;this.status=0;$try(function(){this.status=this.xhr.status}.bind(this));if(this.options.isSuccess.call(this,this.status)){this.response={text:this.xhr.responseText,xml:this.xhr.responseXML};this.success(this.response.text,this.response.xml)}else{this.response={text:null,xml:null};this.failure()}this.xhr.onreadystatechange=$empty},isSuccess:function(){return((this.status>=200)&&(this.status<300))},processScripts:function(a){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return $exec(a)}return a.stripScripts(this.options.evalScripts)},success:function(b,a){this.onSuccess(this.processScripts(b),a)},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain()},failure:function(){this.onFailure()},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr)},setHeader:function(a,b){this.headers.set(a,b);return this},getHeader:function(a){return $try(function(){return this.xhr.getResponseHeader(a)}.bind(this))},check:function(){if(!this.running){return true}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.bind(this,arguments));return false}return false},send:function(j){if(!this.check(j)){return this}this.running=true;var h=$type(j);if(h=="string"||h=="element"){j={data:j}}var d=this.options;j=$extend({data:d.data,url:d.url,method:d.method},j);var f=j.data,b=j.url,a=j.method;switch($type(f)){case"element":f=$(f).toQueryString();break;case"object":case"hash":f=Hash.toQueryString(f)}if(this.options.format){var i="format="+this.options.format;f=(f)?i+"&"+f:i}if(this.options.emulation&&["put","delete"].contains(a)){var g="_method="+a;f=(f)?g+"&"+f:g;a="post"}if(this.options.urlEncoded&&a=="post"){var c=(this.options.encoding)?"; charset="+this.options.encoding:"";this.headers.set("Content-type","application/x-www-form-urlencoded"+c)}if(this.options.noCache){var e="noCache="+new Date().getTime();f=(f)?e+"&"+f:e}if(f&&a=="get"){b=b+(b.contains("?")?"&":"?")+f;f=null}this.xhr.open(a.toUpperCase(),b,this.options.async);this.xhr.onreadystatechange=this.onStateChange.bind(this);this.headers.each(function(l,k){try{this.xhr.setRequestHeader(k,l)}catch(m){this.fireEvent("exception",[k,l])}},this);this.fireEvent("request");this.xhr.send(f);if(!this.options.async){this.onStateChange()}return this},cancel:function(){if(!this.running){return this}this.running=false;this.xhr.abort();this.xhr.onreadystatechange=$empty;this.xhr=new Browser.Request();this.fireEvent("cancel");return this}});(function(){var a={};["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(b){a[b]=function(){var c=Array.link(arguments,{url:String.type,data:$defined});return this.send($extend(c,{method:b.toLowerCase()}))}});Request.implement(a)})();Request.JSON=new Class({Extends:Request,options:{secure:true},initialize:function(a){this.parent(a);this.headers.extend({Accept:"application/json","X-Request":"JSON"})},success:function(a){this.response.json=JSON.decode(a,this.options.secure);this.onSuccess(this.response.json,a)}}); \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/js/mootools-more.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/js/mootools-more.js Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,1 @@ +MooTools.More={version:"1.2.2.1"};var Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:"px",grid:false,style:true,limit:false,handle:false,invert:false,preventDefault:false,modifiers:{x:"left",y:"top"}},initialize:function(){var b=Array.link(arguments,{options:Object.type,element:$defined});this.element=$(b.element);this.document=this.element.getDocument();this.setOptions(b.options||{});var a=$type(this.options.handle);this.handles=((a=="array"||a=="collection")?$$(this.options.handle):$(this.options.handle))||this.element;this.mouse={now:{},pos:{}};this.value={start:{},now:{}};this.selection=(Browser.Engine.trident)?"selectstart":"mousedown";this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:$lambda(false)};this.attach()},attach:function(){this.handles.addEvent("mousedown",this.bound.start);return this},detach:function(){this.handles.removeEvent("mousedown",this.bound.start);return this},start:function(c){if(this.options.preventDefault){c.preventDefault()}this.mouse.start=c.page;this.fireEvent("beforeStart",this.element);var a=this.options.limit;this.limit={x:[],y:[]};for(var d in this.options.modifiers){if(!this.options.modifiers[d]){continue}if(this.options.style){this.value.now[d]=this.element.getStyle(this.options.modifiers[d]).toInt()}else{this.value.now[d]=this.element[this.options.modifiers[d]]}if(this.options.invert){this.value.now[d]*=-1}this.mouse.pos[d]=c.page[d]-this.value.now[d];if(a&&a[d]){for(var b=2;b--;b){if($chk(a[d][b])){this.limit[d][b]=$lambda(a[d][b])()}}}}if($type(this.options.grid)=="number"){this.options.grid={x:this.options.grid,y:this.options.grid}}this.document.addEvents({mousemove:this.bound.check,mouseup:this.bound.cancel});this.document.addEvent(this.selection,this.bound.eventStop)},check:function(a){if(this.options.preventDefault){a.preventDefault()}var b=Math.round(Math.sqrt(Math.pow(a.page.x-this.mouse.start.x,2)+Math.pow(a.page.y-this.mouse.start.y,2)));if(b>this.options.snap){this.cancel();this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop});this.fireEvent("start",[this.element,a]).fireEvent("snap",this.element)}},drag:function(a){if(this.options.preventDefault){a.preventDefault()}this.mouse.now=a.page;for(var b in this.options.modifiers){if(!this.options.modifiers[b]){continue}this.value.now[b]=this.mouse.now[b]-this.mouse.pos[b];if(this.options.invert){this.value.now[b]*=-1}if(this.options.limit&&this.limit[b]){if($chk(this.limit[b][1])&&(this.value.now[b]>this.limit[b][1])){this.value.now[b]=this.limit[b][1]}else{if($chk(this.limit[b][0])&&(this.value.now[b]c.left&&a.xc.top)},checkDroppables:function(){var a=this.droppables.filter(this.checkAgainst,this).getLast();if(this.overed!=a){if(this.overed){this.fireEvent("leave",[this.element,this.overed])}if(a){this.fireEvent("enter",[this.element,a])}this.overed=a}},drag:function(a){this.parent(a);if(this.options.checkDroppables&&this.droppables.length){this.checkDroppables()}},stop:function(a){this.checkDroppables();this.fireEvent("drop",[this.element,this.overed,a]);this.overed=null;return this.parent(a)}});Element.implement({makeDraggable:function(a){var b=new Drag.Move(this,a);this.store("dragger",b);return b}});var Asset={javascript:function(f,d){d=$extend({onload:$empty,document:document,check:$lambda(true)},d);var b=new Element("script",{src:f,type:"text/javascript"});var e=d.onload.bind(b),a=d.check,g=d.document;delete d.onload;delete d.check;delete d.document;b.addEvents({load:e,readystatechange:function(){if(["loaded","complete"].contains(this.readyState)){e()}}}).set(d);if(Browser.Engine.webkit419){var c=(function(){if(!$try(a)){return}$clear(c);e()}).periodical(50)}return b.inject(g.head)},css:function(b,a){return new Element("link",$merge({rel:"stylesheet",media:"screen",type:"text/css",href:b},a)).inject(document.head)},image:function(c,b){b=$merge({onload:$empty,onabort:$empty,onerror:$empty},b);var d=new Image();var a=$(d)||new Element("img");["load","abort","error"].each(function(e){var f="on"+e;var g=b[f];delete b[f];d[f]=function(){if(!d){return}if(!a.parentNode){a.width=d.width;a.height=d.height}d=d.onload=d.onabort=d.onerror=null;g.delay(1,a,a);a.fireEvent(e,a,1)}});d.src=a.src=c;if(d&&d.complete){d.onload.delay(1)}return a.set(b)},images:function(d,c){c=$merge({onComplete:$empty,onProgress:$empty},c);d=$splat(d);var a=[];var b=0;return new Elements(d.map(function(e){return Asset.image(e,{onload:function(){c.onProgress.call(this,b,d.indexOf(e));b++;if(b==d.length){c.onComplete()}}})}))}};var Tips=new Class({Implements:[Events,Options],options:{onShow:function(a){a.setStyle("visibility","visible")},onHide:function(a){a.setStyle("visibility","hidden")},title:"title",text:function(a){return a.get("rel")||a.get("href")},showDelay:100,hideDelay:100,className:null,offset:{x:16,y:16},fixed:false},initialize:function(){var a=Array.link(arguments,{options:Object.type,elements:$defined});if(a.options&&a.options.offsets){a.options.offset=a.options.offsets}this.setOptions(a.options);this.container=new Element("div",{"class":"tip"});this.tip=this.getTip();if(a.elements){this.attach(a.elements)}},getTip:function(){return new Element("div",{"class":this.options.className,styles:{visibility:"hidden",display:"none",position:"absolute",top:0,left:0}}).adopt(new Element("div",{"class":"tip-top"}),this.container,new Element("div",{"class":"tip-bottom"})).inject(document.body)},attach:function(b){var a=function(d,c){if(d==null){return""}return $type(d)=="function"?d(c):c.get(d)};$$(b).each(function(d){var e=a(this.options.title,d);d.erase("title").store("tip:native",e).retrieve("tip:title",e);d.retrieve("tip:text",a(this.options.text,d));var c=["enter","leave"];if(!this.options.fixed){c.push("move")}c.each(function(f){d.addEvent("mouse"+f,d.retrieve("tip:"+f,this["element"+f.capitalize()].bindWithEvent(this,d)))},this)},this);return this},detach:function(a){$$(a).each(function(c){["enter","leave","move"].each(function(d){c.removeEvent("mouse"+d,c.retrieve("tip:"+d)||$empty)});c.eliminate("tip:enter").eliminate("tip:leave").eliminate("tip:move");if($type(this.options.title)=="string"&&this.options.title=="title"){var b=c.retrieve("tip:native");if(b){c.set("title",b)}}},this);return this},elementEnter:function(b,a){$A(this.container.childNodes).each(Element.dispose);["title","text"].each(function(d){var c=a.retrieve("tip:"+d);if(!c){return}this[d+"Element"]=new Element("div",{"class":"tip-"+d}).inject(this.container);this.fill(this[d+"Element"],c)},this);this.timer=$clear(this.timer);this.timer=this.show.delay(this.options.showDelay,this,a);this.tip.setStyle("display","block");this.position((!this.options.fixed)?b:{page:a.getPosition()})},elementLeave:function(b,a){$clear(this.timer);this.tip.setStyle("display","none");this.timer=this.hide.delay(this.options.hideDelay,this,a)},elementMove:function(a){this.position(a)},position:function(d){var b=window.getSize(),a=window.getScroll(),e={x:this.tip.offsetWidth,y:this.tip.offsetHeight},c={x:"left",y:"top"},f={};for(var g in c){f[c[g]]=d.page[g]+this.options.offset[g];if((f[c[g]]+e[g]-a[g])>b[g]){f[c[g]]=d.page[g]-this.options.offset[g]-e[g]}}this.tip.setStyles(f)},fill:function(a,b){if(typeof b=="string"){a.set("html",b)}else{a.adopt(b)}},show:function(a){this.fireEvent("show",[this.tip,a])},hide:function(a){this.fireEvent("hide",[this.tip,a])}}); \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/manager.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/manager.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,19 @@ + GALLERY_LOCATION, + 'assetBasePath' => 'Assets', + 'upload' => true, + 'destroy' => true, +)); + +$browser->fireEvent(!empty($_GET['event']) ? $_GET['event'] : null); \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/managerxml.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/managerxml.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,19 @@ + XML_LOCATION, + 'assetBasePath' => 'Assets', + 'upload' => true, + 'destroy' => true, +)); + +$browser->fireEvent(!empty($_GET['event']) ? $_GET['event'] : null); \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/outputxml.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/outputxml.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,420 @@ + + + + + (E)2 Gallery Pro File Manager + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + Download XML Sample File +

    Output XML for Image Gallery

    + Create the xml for the image inside which folder? Set the folder to look at to create the XML automagically. +
    +
    + Default file paths are:
    + $fold){ + if ($fold=='' || $fold=='.') continue; + if ($fold=='..' && $i>0 && end($out)!='..') array_pop($out); + else $out[]= $fold; + } return ($path{0}=='/'?'/':'').join('/', $out); + } + ?> + Gallery Path: Galleries/gallery1/ +
    + Large Path: Galleries/gallery1/large/ +
    + Thumbnail Path: Galleries/gallery1/thumbs/ +

    + 1024) $files[$fkey]['sizetext'] = (ceil($a['size']/1024*100)/100) . " K"; + else if ($a['size'] > 1024*1024) $files[$fkey]['sizetext'] = (ceil($a['size']/(1024*1024)*100)/100) . " Mb"; + else $files[$fkey]['sizetext'] = $a['size'] . " bytes"; + $files[$fkey]['name'] = $file; + $files[$fkey]['type'] = filetype($fullpath); + $fileNames[$i++] = $fkey; + } + closedir($dh); + } else {$errorMessage= true; echo "Cannot open directory: $path | Fill out a valid Gallery Path";} + } else {$errorMessage= true; echo "Path is not a directory: $path | Fill out a valid Gallery Path";} + sort($fileNames,SORT_STRING); + $sortedFiles = array(); + $i = 0; + $photos = array(); + $relativePath = rp( dirname($_SERVER['PHP_SELF']) ); + if($errorMessage != true){ + foreach($fileNames as $f) $sortedFiles[$i++] = $files[$f]; + + + echo'Copy the below XML and create your XML file and upload it via the Upload XML button above:'; + echo'Reset Output
    '; + echo '
    '; + echo'<gallery>
    '; + echo'    <title>'.$_GET['gallerytitle'].'</title>
    '; + echo'    <description>'.$_GET['galleryDescription'].'</description>
    '; + echo'    <gallerypath>'.$relativePath.'/'.$_GET['gallerypath'].'</gallerypath>
    '; + echo'    <largeimgpath>'.$relativePath.'/'.$_GET['largepath'].'</largeimgpath>
    '; + echo'    <thumbpath>'.$relativePath.'/'.$_GET['thumbpath'].'</thumbpath>
    '; + echo'    <mainthumb>'.$relativePath.'/'.$_GET['gallerypath'].'</mainthumb>
    '; + echo'    <mainthumbsrc>mainthumb.jpg</mainthumbsrc>
    '; + $j = 0; + + foreach ($sortedFiles as $file) { + + if($file['type']!='dir'&& $file['name']!='mainthumb.jpg'){ + // get image sizes + list($width, $height, $type, $attr) = getimagesize($path."/".$file['name'], $info); + $size = $file['sizetext']; + if(isset($info['APP13'])){ + $iptc = iptcparse($info['APP13']); + $title = $iptc['2#005'][0]; + if(isset($iptc['2#120'][0])){ + $description = $iptc['2#120'][0]; + $description = str_replace("\r", "
    ", $description); + $description = addslashes($description); + } + if(isset($iptc['2#025'][0])){ + $keywords = $iptc['2#025'][0]; + } + $author = $iptc['2#080'][0]; + $copyright = $iptc['2#116'][0]; + + }else if(isset($info['APP0']) && !isset($info['APP13'])){ + $iptc = iptcparse($info['APP0']); + $title = $iptc['2#005'][0]; + $description = $iptc['2#120'][0]; + $description = str_replace("\r", "
    ", $description); + $description = addslashes($description); + $keywords = $iptc['2#025'][0]; + $author = $iptc['2#080'][0]; + $copyright = $iptc['2#116'][0]; + }else{ + $title = ''; + $description = ''; + $description = ''; + $keywords = ''; + $author = ''; + $copyright = ''; + } + + + array_push($photos, $width); + array_push($photos, $height); + + //echo''; + //''; + //echo''; + + echo'    <item type="image">
    '; + echo'        <title>'.$title.'</title>
    '; + echo'        <author>'.$author.'</author>
    '; + echo'        <copyright>'.$copyright.'</copyright>
    '; + echo'        <description>'.$description.'</description>
    '; + echo'        <src>'.$file['name'].'</src>
    '; + echo'        <demensions width="'.$width.'" height="'.$height.'" />
    '; + if(isset($_GET['largepath'])){ + $largePath = $_GET['largepath']; + if(is_file($largePath."/".$file['name'])){ + list($largeWidth, $largeHeight, $largeType, $largeAttr) = getimagesize($largePath."/".$file['name'], $info); + echo'        <large width="'.$largeWidth.'" height="'.$largeHeight.'" />
    '; + } + } + if(isset($_GET['showforsale'])){ + $showforsale = $_GET['showforsale']; + if($showforsale=='true'){ + if($_GET['currency']=="USD"){$currencySymbol='$';}else if($_GET['currency']=="EURO"){$currencySymbol='€';} + echo'        <sellprint type="'.$_GET['checkouttype'].'" currency="'.$_GET['currency'].'" currencysymbol="'.$currencySymbol.'">
    '; + echo'            <price size="8x10">15</price>
    '; + echo'            <price size="11x14">25</price>
    '; + echo'            <price size="16x20">55</price>
    '; + echo'            <price size="20x24">65</price>
    '; + echo'        </sellprint>
    '; + } + echo'    </item>
    '; + + $j++; + } + } + + } + echo'    <totalitems>'.$j.'</totalitems>
    '; + echo'</gallery>
    '; + echo'
    '; + } + } + if(isset($_GET['gallerypath'])&&isset($_GET['thumbpath'])){ + getImages($_GET['gallerypath'], $_GET['thumbpath'] ); + ?> + Reset Output
    +

    Create New Gallery XML:


    +
    +
    + +
    + +

    + +
    + +

    + +
    + +

    + +
    + +

    + +
    +
    + (Fill out path even if you uploaded no large images it will detect that they're not there. unless there is no large folder) +

    +

    Sell Prints?

    + +

    +

    Checkout Type

    + +

    + +

    Currency:

    + +

    +
    + +
    +
    + +
    + +
    + +

    + +
    + +

    + +
    + +

    + +
    + +

    + +
    +
    + (Fill out path even if you uploaded no large images it will detect that they're not there. unless there is no large folder) +

    +

    Sell Prints?

    + +

    +

    Checkout Type

    + +

    + +

    Currency:

    + +

    +
    + +
    + + + + + +
    +
    +
    + + \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/password_protect.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/password_protect.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,199 @@ +Logout +# +############################################################### + +/* +------------------------------------------------------------------- +SAMPLE if you only want to request login and password on login form. +Each row represents different user. +Each row requires a comma in the end of it execpt the last + +$LOGIN_INFORMATION = array( + 'zubrag' => 'root', + 'test' => 'testpass', + 'admin' => 'passwd' +); + +-------------------------------------------------------------------- +SAMPLE if you only want to request only password on login form so only passwords are listed and required to login +Note: You will have to modify line 59 of this code to read false, and replace lines 52-56 with the sample array below + +$LOGIN_INFORMATION = array( + 'root', + 'testpass', + 'passwd' +); + +-------------------------------------------------------------------- +*/ + +/////////////////////////////////////////////////////// +// do not change code below +/////////////////////////////////////////////////////// + +// show usage example +if(isset($_GET['help'])) { + die('Include following code into every page you would like to protect, at the very beginning (first line):
    <?php include("' . str_replace('\\','\\\\',__FILE__) . '"); ?>'); +} + +// timeout in seconds +$timeout = (TIMEOUT_MINUTES == 0 ? 0 : time() + TIMEOUT_MINUTES * 60); + +// logout? +if(isset($_GET['logout'])) { + setcookie("e2verify", '', $timeout, '/'); // clear password; + header('Location: ' . LOGOUT_URL); + exit(); +} + +if(!function_exists('showLoginPasswordProtect')) { + +// show login form +function showLoginPasswordProtect($error_msg) { +?> + + + + + + + +(E)2 Gallery Pro Log In + + + + +
    + +
    +

    Login

    +
    +
    + Username


    '; ?> +
    +

    + +
    +
    +
    + + + +$val) { + $lp = (USE_USERNAME ? $key : '') .'%'.$val; + if ($_COOKIE['e2verify'] == md5($lp)) { + $found = true; + // prolong timeout + if (TIMEOUT_CHECK_ACTIVITY) { + setcookie("e2verify", md5($lp), $timeout, '/'); + } + break; + } + } + if (!$found) { + showLoginPasswordProtect(""); + } + +} + +?> diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/xml/e2gallery.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/xml/e2gallery.xml Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,1 @@ + (E)2 Gallery Demo (E)2 Gallery Demo Gallery Description /e2gallerypro/e2upload/Galleries/gallery1/ /e2gallerypro/e2upload/Galleries/gallery1/large/ /e2gallerypro/e2upload/Galleries/gallery1/thumbs/ /e2gallerypro/e2upload/Galleries/gallery1/ mainthumb.jpg Cloud Rays E2interactive Copyright E2interactive Looking up to the sky while the clouds pass on a summer day DSC_0670.jpg 35 45 65 Down the Tracks E2interactive Copyright E2interactive 2007 Looking across the bridge over the Crocked River in Crocked River Ranch Oregon DSC_2051.jpg 15 25 55 65 Sit Down E2interactive Copyright E2interactive DSC_2343.jpg 15 25 55 65 Sky High E2interactive Copyright E2interactive Went to the local race track to watch riders on the Motocross track. There was this kid on a small 125cc just screaming around the track showing all the older kids how to ride. DSC_7850.jpg 15 25 55 65 Untitled Ceiling E2interactive Copyright E2interactive I liked the lines of this ceiling so I took an image of it. E29_2000.jpg 15 25 55 65 5 4 Gallery Title Gallery Description /e2gallerypro/e2upload/Galleries/gallery2/ /e2gallerypro/e2upload/Galleries/gallery2/large/ /e2gallerypro/e2upload/Galleries/gallery2/thumbs/ /e2gallerypro/e2upload/Galleries/gallery2/ mainthumb.jpg http://www.youtube.com/watch?v=CQE5OQiLFPo E2 Gallery Pro Intro (E)2Interactive (E)2Interactive View the intro to (E)2 Gallery Pro /e2gallerypro/e2upload/Galleries/gallery2/mainthumb.jpg http://vimeo.com/5263580 Moab 2009 (E)2Interactive (E)2Interactive Went on a trip to Moab to ride the trails and Take some timelapse imagery, we hit the Moab Porcupine Rim Trail. The ride wiped me out and I didn\'t get to take any timelapse, but I got some photos I\'m happy with. Here is a video I put together about the trip. http://static.flickr.com/3416/3589545487_067b0e33ff.jpg \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/xml/e2galleryproXMLsample.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/xml/e2galleryproXMLsample.xml Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,51 @@ + + + + + + + Total Item Count + Gallery Title + Gallery Description + /main/gallery/path/ + /large/image/gallery/path/ + /thumbnail/path/ + /mainthumb/path/ + main thumb image name + + + + + + Image Title + Image Author Name + Copyright Name (No Special Characters) + Image Description + item name + + + + + 15 + 25 + 55 + 65 + + + + + + + + + Locations/of/media/file.mov + Timelapse Video 1 + E2interactive + 2009 E2interactive + Taken in Alberta Canada. 68 Photos 10 second exposures every 30 seconds + /gallerypro/Gallery4/thumb/canadarim.jpg + + + + + \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/e2upload/xml/judyYates.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/e2upload/xml/judyYates.xml Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,66 @@ + + + + + Judy Yates Prints + Prints Directly From the Artist. + /e2gallerypro/e2upload/Galleries/prints/ + /e2gallerypro/e2upload/Galleries/prints/large/ + /e2gallerypro/e2upload/Galleries/prints/thumbs/ + /e2gallerypro/e2upload/Galleries/prints/ + mainthumb.jpg + + Buffalo Verde + Judy Yates + Copyright Judy Yates Artist + Buffalo Verde + + Judy_Yates_Buffalo_Verde.jpg + + + + 265 + + + + Longhorn Sunset + Judy Yates + Copyright Judy Yates Artist + Longhorn Sunset + + Judy_Yates_Longhorn_Sunset.jpg + + + + 265 + + + + Turquoise Sky + Judy Yates + Copyright Judy Yates Artist + Winner of the Mass. Primitive Arms Stamp Contest + + Judy_Yates_Turquoise_Sky.jpg + + + +265 + + + + Wood Duck Pair + Judy Yates + Copyright Judy Yates Artist + Wood Duck Pair + + Judy_Yates_Wood_Duck_Pair.jpg + + + +265 + + + 4 + + diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/index.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/index.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,98 @@ + + + + + (E)2 Gallery Pro + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/js/e2gallerypro.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/js/e2gallerypro.js Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,1 @@ +var E2GalleryPro={version:"1.2"};var openclose=true;var slidesHidden=false;var imagecontainer=$("images");var busy=false;var previousid="0";var currentthumbpos=0;var showInfoType="show";var movedamount=0;var imagenumber=Number(1);var thumbnailNumberPos;var thumbSizing;var totalthumbsvisible=0;var currentThumbSpot=1;var thumbWidth=setThumbWidth;var largeHtmlIsCreated;var galleryHeight;var showThumbs="hide";var fsisopen="closed";var animatingPop=false;var moving=false;var timer;var playing=false;var prevHidden=false;var nextHidden=false;var totalNumImages;var totalNumQuicktime;var totalNumMedia;var closinggalleries=false;var currentGallery=maingalleries[0]["gallerynum"];var currentimage=0;var lastimage=maingalleries[0]["end"];var startImage=maingalleries[0]["start"];var largeIsOpen=false;function openforsale(){if(fsisopen=="open"){fsisopen="closed";var b=new Fx.Morph("fsbox",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});b.start({bottom:-277});var a=new Fx.Morph("fsclose",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});a.start({opacity:0})}else{fsisopen="open";var b=new Fx.Morph("fsbox",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});b.start({bottom:-100});var a=new Fx.Morph("fsclose",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});a.start({opacity:1})}}function addImage(e){currentimage=galleryimages[e]["imgid"];filetype=galleryimages[e]["filetype"];$("imgloader").empty();$("infoloader").empty();var f="";if(galleryimages[e]["title"]){f+="

    "+galleryimages[e]["title"]+"

    ";if(galleryimages[e]["forsale"]==true){f+='
    '+purchaseprinttxt+"
    "}}if(galleryimages[e]["description"]){f+=''+galleryimages[e]["description"]+"";if(galleryimages[e]["forsale"]==true){f+='
    '+purchaseprinttxt+"
    "}}if(galleryimages[e]["copyright"]){f+='";if(galleryimages[e]["forsale"]==true){f+='
    '+purchaseprinttxt+"
    "}}if(galleryimages[e]["author"]){f+='
    Author: '+galleryimages[e]["author"]+"
    ";if(galleryimages[e]["forsale"]==true){f+='
    '+purchaseprinttxt+"
    "}}if(f==""){f+="

    No Image Information Available

    ";if(galleryimages[e]["forsale"]==true){f+='
    '+purchaseprinttxt+"
    "}}$("infoloader").set("html",f);var d=new Fx.Morph("infoloader",{duration:transitionspeed});var b=new Fx.Morph("imgloader",{duration:transitionspeed,onComplete:function(){busy=false}});var g=new Fx.Morph("imgloader",{duration:transitionspeed,onComplete:function(){if(filetype=="image"){var o="";$("imgloader").set("html",o);b.start({opacity:1})}if(filetype=="flv"||filetype=="mp4"){fileWidth=galleryimages[e]["width"]||flashdefaultWidth;fileHeight=galleryimages[e]["height"]||flashdefaultHeight;media=new Swiff(""+NBpath+"?videoURL="+galleryimages[e]["mediaURL"]+"&allowSmoothing=true&autoPlay="+autoplay+"&buffer=6&showTimecode="+showTimecode+"&loop=true&controlColour="+controllerColor+"&scaleIfFullScreen=true&showScalingButton=false",{id:"MediaboxSWF",width:mediaWidth,height:mediaHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});media.inject("imgloader");b.start({opacity:1})}else{if(filetype=="mov"){var n=' ';$("imgloader").set("html",n);b.start({opacity:1})}else{if(filetype=="swf"){fileWidth=galleryimages[e]["width"]||flashdefaultWidth;fileHeight=galleryimages[e]["height"]||flashdefaultHeight;media=new Swiff(galleryimages[e]["mediaURL"],{id:"e2gallerySWF",width:fileWidth,height:fileHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});media.inject("imgloader");b.start({opacity:1})}else{if(filetype=="blip.tv"){fileWidth=galleryimages[e]["width"]||"640px";fileHeight=galleryimages[e]["height"]||"390px";media=new Swiff(galleryimages[e]["mediaURL"],{src:galleryimages[e]["mediaURL"],width:fileWidth,height:fileHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});media.inject("imgloader");b.start({opacity:1})}else{if(filetype=="dailymotion"){fileWidth=galleryimages[e]["width"]||"480px";fileHeight=galleryimages[e]["height"]||"381px";media=new Swiff(galleryimages[e]["mediaURL"],{id:mediaId,width:fileWidth,height:fileHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});media.inject("imgloader");b.start({opacity:1})}else{if(filetype=="flickr"){fileWidth=galleryimages[e]["width"]||"500px";fileHeight=galleryimages[e]["height"]||"375px";mediaSplit=galleryimages[e]["mediaURL"].split("/");mediaId=mediaSplit[5];media=new Swiff("http://www.flickr.com/apps/video/stewart.swf",{id:mediaId,classid:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",width:fileWidth,height:fileHeight,params:{flashvars:"photo_id="+mediaId+"&show_info_box="+flInfo,wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});media.inject("imgloader");b.start({opacity:1})}else{if(filetype=="google"){fileWidth=galleryimages[e]["width"]||"400px";fileHeight=galleryimages[e]["height"]||"326px";mediaSplit=galleryimages[e]["mediaURL"].split("=");mediaId=mediaSplit[1];media=new Swiff("http://video.google.com/googleplayer.swf?docId="+mediaId+"&autoplay="+autoplayNum,{id:mediaId,width:fileWidth,height:fileHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});media.inject("imgloader");b.start({opacity:1})}else{if(filetype=="metacafe"){fileWidth=galleryimages[e]["width"]||"400px";fileHeight=galleryimages[e]["height"]||"345px";mediaSplit=galleryimages[e]["mediaURL"].split("/");mediaId=mediaSplit[4];media=new Swiff("http://www.metacafe.com/fplayer/"+mediaId+"/.swf",{id:mediaId,width:fileWidth,height:fileHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});media.inject("imgloader");b.start({opacity:1})}else{if(filetype=="myspace"){fileWidth=galleryimages[e]["width"]||"425px";fileHeight=galleryimages[e]["height"]||"360px";mediaSplit=galleryimages[e]["mediaURL"].split("=");mediaId=mediaSplit[2];media=new Swiff("http://lads.myspace.com/videos/vplayer.swf?m="+mediaId+"&v=2&type=video",{id:mediaId,width:fileWidth,height:fileHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});media.inject("imgloader");b.start({opacity:1})}else{if(filetype=="revver"){fileWidth=galleryimages[e]["width"];fileHeight=galleryimages[e]["height"];mediaSplit=galleryimages[e]["mediaURL"].split("/");mediaId=mediaSplit[4];media=new Swiff("http://flash.revver.com/player/1.0/player.swf?mediaId="+mediaId+"&affiliateId="+revverID+"&allowFullScreen="+revverFullscreen+"&backColor=#"+revverBack+"&frontColor=#"+revverFront+"&gradColor=#"+revverGrad+"&shareUrl=revver",{id:mediaId,width:fileWidth,height:fileHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});media.inject("imgloader");b.start({opacity:1})}else{if(filetype=="rutube"){fileWidth=galleryimages[e]["width"]||"470px";fileHeight=galleryimages[e]["height"]||"353px";mediaSplit=galleryimages[e]["mediaURL"].split("=");mediaId=mediaSplit[1];media=new Swiff("http://video.rutube.ru/"+mediaId,{movie:"http://video.rutube.ru/"+mediaId,width:fileWidth,height:fileHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});media.inject("imgloader");b.start({opacity:1})}else{if(filetype=="seesmicm"){fileWidth=galleryimages[e]["width"]||"435px";fileHeight=galleryimages[e]["height"]||"355px";mediaSplit=galleryimages[e]["mediaURL"].split("/");mediaId=mediaSplit[5];media=new Swiff("http://seesmic.com/Standalone.swf?video="+mediaId,{id:mediaId,width:fileWidth,height:fileHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});media.inject("imgloader");b.start({opacity:1})}else{if(filetype=="tudou"){fileWidth=galleryimages[e]["width"]||"400px";fileHeight=galleryimages[e]["height"]||"340px";mediaSplit=galleryimages[e]["mediaURL"].split("/");mediaId=mediaSplit[5];media=new Swiff("http://www.tudou.com/v/"+mediaId,{width:fileWidth,height:fileHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});media.inject("imgloader");b.start({opacity:1})}else{if(filetype=="youku"){fileWidth=galleryimages[e]["width"]||"480px";fileHeight=galleryimages[e]["height"]||"400px";mediaSplit=galleryimages[e]["mediaURL"].split("id_");mediaId=mediaSplit[1];media=new Swiff("http://player.youku.com/player.php/sid/"+mediaId+"=/v.swf",{width:fileWidth,height:fileHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});media.inject("imgloader");b.start({opacity:1})}else{if(filetype=="youtube"){mediaSplit=galleryimages[e]["mediaURL"].split("v=");mediaId=mediaSplit[1];if(mediaId.match(/fmt=18/i)){mediaFmt="&ap=%2526fmt%3D18";mediaWidth=galleryimages[e]["width"]||"560px";mediaHeight=galleryimages[e]["height"]||"345px"}else{if(mediaId.match(/fmt=22/i)){mediaFmt="&ap=%2526fmt%3D22";mediaWidth=galleryimages[e]["width"]||"640px";mediaHeight=galleryimages[e]["height"]||"385px"}else{mediaFmt=ytQuality;mediaWidth=galleryimages[e]["width"]||"480px";mediaHeight=galleryimages[e]["height"]||"295px"}}media=new Swiff("http://www.youtube.com/v/"+mediaId+"&autoplay="+autoplayNum+"&fs="+fullscreenNum+mediaFmt+"&color1=0x"+ytColor1+"&color2=0x"+ytColor2,{id:mediaId,width:mediaWidth,height:mediaHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});media.inject("imgloader");b.start({opacity:1})}else{if(filetype=="veoh"){fileWidth=galleryimages[e]["width"]||"410px";fileHeight=galleryimages[e]["height"]||"341px";mediaSplit=galleryimages[e]["mediaURL"].split("videos/");mediaId=mediaSplit[1];media=new Swiff("http://www.veoh.com/videodetails2.swf?permalinkId="+mediaId+"&player=videodetailsembedded&videoAutoPlay="+AutoplayNum,{id:mediaId,width:fileWidth,height:fileHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});media.inject("imgloader");b.start({opacity:1})}else{if(filetype=="viddler"){fileWidth=galleryimages[e]["width"]||"437px";fileHeight=galleryimages[e]["height"]||"370px";mediaSplit=galleryimages[e]["mediaURL"].split("/");mediaId=mediaSplit[4];media=new Swiff(galleryimages[e]["mediaURL"],{id:"viddler_"+mediaId,movie:galleryimages[e]["mediaURL"],classid:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",width:fileWidth,height:fileHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen,id:"viddler_"+mediaId,movie:galleryimages[e]["mediaURL"]}});media.inject("imgloader");b.start({opacity:1})}else{if(filetype=="vimeo"){fileWidth=galleryimages[e]["width"]||"400px";fileHeight=galleryimages[e]["height"]||"225px";mediaSplit=galleryimages[e]["mediaURL"].split("/");mediaId=mediaSplit[3];media=new Swiff("http://www.vimeo.com/moogaloop.swf?clip_id="+mediaId+"&server=www.vimeo.com&fullscreen="+fullscreenNum+"&show_title="+vmTitle+"&show_byline="+vmByline+"&show_portrait="+vmPortrait+"&color="+vmColor,{id:mediaId,width:fileWidth,height:fileHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});media.inject("imgloader");b.start({opacity:1})}else{if(filetype=="12seconds"){fileWidth=galleryimages[e]["width"]||"430px";fileHeight=galleryimages[e]["height"]||"360px";mediaSplit=galleryimages[e]["mediaURL"].split("/");mediaId=mediaSplit[5];media=new Swiff("http://embed.12seconds.tv/players/remotePlayer.swf",{id:mediaId,width:fileWidth,height:fileHeight,params:{flashvars:"vid="+mediaId+"",wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});media.inject("imgloader");b.start({opacity:1})}}}}}}}}}}}}}}}}}}}if(galleryimages[e]["forsale"]==true){$("fsbox").empty();var m=new Element("div",{id:"fsbutton"}).inject($("fsbox"),"top");var h=new Element("div",{id:"fstop"}).inject($("fsbox"));var k=new Element("div",{id:"forsale"}).inject($("fsbox"));$("fsbutton").set("html",orderText+"
    ");if(galleryimages[e]["title"]==""||galleryimages[e]["title"]==null){placeTitle=galleryimages[e]["src"]}else{placeTitle=galleryimages[e]["title"]}var j=new Fx.Morph("fsbox",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut,onComplete:function(){var p=galleryimages[e]["paytype"];if(p=="paypal"){numOfPrices=galleryimages[e]["numOfPrices"];paypalform="";paypalform+='
    ';paypalform+=' ';paypalform+=' ';paypalform+=' ';paypalform+=" Buy: "+placeTitle+"
    ";paypalform+=" "+purchaseOf+placeTitle+shipinginfoshort+"
    ";paypalform+=" ";paypalform+=' ";paypalform+="
    '+galleryimages[e]["src"]+" -"+paypalSelectText+'
    ";paypalform+=' ';paypalform+=' ';paypalform+=' ';paypalform+="
    ";$("forsale").set("html",paypalform)}if(p=="google"){numOfPrices=galleryimages[e]["numOfPrices"];googleform="";googleform+='
    ';googleform+='';googleform+="Buy: "+placeTitle+"";googleform+="
    ";googleform+=purchaseOf+placeTitle+shipinginfoshort+"
    ";googleform+=selectSizes+": ";googleform+='
    ";for(i=1;i<=numOfPrices;i++){googleform+='';googleform+='';googleform+='';googleform+='';googleform+=''}googleform+='';googleform+="


    ";$("forsale").set("html",googleform)}$("fsbutton").addEvent("click",function(){openforsale();var q=new Fx.Morph("thumbnailPopUp",{duration:50,transition:Fx.Transitions.Expo.easeInOut});q.start({opacity:0})})}});j.start({opacity:1,bottom:-277});var l=new Fx.Morph("fsclose",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});l.start({opacity:0})}}});var c=new Fx.Morph(""+e+"",{duration:100,transition:Fx.Transitions.linear});c.start({"border-color":"#FFF","background-color":"#FFF",opacity:1});d.start({opacity:1});g.start({opacity:0});var a=new Fx.Morph("loading",{duration:200,onComplete:function(){}});a.start({opacity:0})}function setThumbClick(a){thumbPath=maingalleries[a]["thumbpath"];imagenumber=Number(1);$$(".thumbnail").addEvent("click",function(f){if(playing==true){slideshow()}if(!busy){if(filetype!="image"){$("imgloader").empty()}busy=true;var g=this.id;imagenumber=this.get("rel");imagenumber=Number(imagenumber);$("numOf").set("text",imagenumber+" of ").inject("photoNum","top");var b=Number(galleryimages[g]["imgid"]);loadimage(Number(g),Number(imagenumber));var d=new Fx.Morph(""+previousid+"",{duration:500,transition:Fx.Transitions.Expo.easeInOut});d.start({"border-color":"#FFF","background-color":"#FFF",opacity:0.5});var c=new Fx.Morph(g,{duration:500,transition:Fx.Transitions.linear});c.start({"border-color":"#FFF","background-color":"#FFF",opacity:1});previousid=b}});$("next").addEvent("click",function(c){if(playing==true){slideshow()}if(!busy){busy=true;nextnum=Number(currentimage+1);imagenumber=Number(imagenumber+1);realNum=$(""+nextnum+"").get("rel");$("numOf").set("text",realNum+" of ").inject("photoNum","top");loadimage(nextnum,imagenumber);var b=new Fx.Morph(""+currentimage+"",{duration:500,transition:Fx.Transitions.Expo.easeInOut});b.start({"border-color":"#FFF","background-color":"#FFF",opacity:0.5});thumbinview=$("thumbnails").getCoordinates().width;maxThumbsVisible=Math.floor(thumbinview/setThumbWidth);thumbsMod=imagenumber%maxThumbsVisible;if(imagenumber>=maxThumbsVisible&&thumbsMod==1||maxThumbsVisible==1){movethumbs("more")}currentimage=Number(galleryimages[nextnum]["imgid"]);previousid=currentimage}});$("previous").addEvent("click",function(c){if(playing==true){slideshow()}if(!busy){thumbinview=$("thumbnails").getCoordinates().width;maxThumbsVisible=Math.floor(thumbinview/setThumbWidth);thumbsMod=(imagenumber)%maxThumbsVisible;if(imagenumber>=maxThumbsVisible&&thumbsMod==1||maxThumbsVisible==1){movethumbs("back")}previousnum=Number(currentimage-1);busy=true;imagenumber=Number(imagenumber-1);realNum=$(""+previousnum+"").get("rel");$("numOf").set("text",realNum+" of ").inject("photoNum","top");loadimage(""+previousnum+"",imagenumber);var b=new Fx.Morph(""+currentimage+"",{duration:500,transition:Fx.Transitions.Expo.easeInOut});b.start({"border-color":"#FFF","background-color":"#FFF",opacity:0.5});currentimage=Number(galleryimages[previousnum]["imgid"]);previousid=currentimage}});$(window.document).addEvent("keydown",function(c){if(c.key=="right"&¤timage!=lastimage){if(playing==true){slideshow()}if(!busy){busy=true;nextnum=Number(currentimage+1);imagenumber=Number(imagenumber+1);realNum=$(""+nextnum+"").get("rel");$("numOf").set("text",realNum+" of ").inject("photoNum","top");loadimage(nextnum,imagenumber);var b=new Fx.Morph(""+currentimage+"",{duration:500,transition:Fx.Transitions.Expo.easeInOut});b.start({"border-color":"#FFF","background-color":"#FFF",opacity:0.5});thumbinview=$("thumbnails").getCoordinates().width;maxThumbsVisible=Math.floor(thumbinview/setThumbWidth);thumbsMod=imagenumber%maxThumbsVisible;if(imagenumber>=maxThumbsVisible&&thumbsMod==1||maxThumbsVisible==1){movethumbs("more")}currentimage=Number(galleryimages[nextnum]["imgid"]);previousid=currentimage}}if(c.key=="left"&¤timage!=0){if(playing==true){slideshow()}if(!busy){thumbinview=$("thumbnails").getCoordinates().width;maxThumbsVisible=Math.floor(thumbinview/setThumbWidth);thumbsMod=(imagenumber)%maxThumbsVisible;if(imagenumber>=maxThumbsVisible&&thumbsMod==1||maxThumbsVisible==1){movethumbs("back")}previousnum=Number(currentimage-1);busy=true;imagenumber=Number(imagenumber-1);realNum=$(""+previousnum+"").get("rel");$("numOf").set("text",realNum+" of ").inject("photoNum","top");loadimage(""+previousnum+"",imagenumber);var b=new Fx.Morph(""+currentimage+"",{duration:500,transition:Fx.Transitions.Expo.easeInOut});b.start({"border-color":"#FFF","background-color":"#FFF",opacity:0.5});currentimage=Number(galleryimages[previousnum]["imgid"]);previousid=currentimage}}});$$(".thumbnail").addEvent("mouseenter",function(){myid=this.id;var d=galleryimages[myid]["filetype"];var c=new Fx.Morph("thumbnailPopUp",{duration:25,transition:Fx.Transitions.Expo.easeInOut,onComplete:function(){$("thumbnailPopUp").empty();if(d=="image"){var f=new Element("img",{src:thumbPath+galleryimages[myid]["src"],id:"thumbPop"}).inject($("thumbnailPopUp"))}else{var f=new Element("img",{src:galleryimages[myid]["src"],id:"thumbPop"}).inject($("thumbnailPopUp"))}myX=$("gallery").getCoordinates().width;myY=$("images").getCoordinates().height;myImgWidth=$("thumbPop").getCoordinates().width;myImgHeight=$("thumbPop").getCoordinates().height;myNewX=((myX/2)-(myImgWidth/2));myNewY=(myY-(myImgHeight/2))-(($("thumbnailPopUp").getCoordinates().height/2)+6);if(animatingPop!=true){animatingPop=true;var e=function(){$("thumbnailPopUp").setStyles({position:"absolute",top:(myNewY),left:myNewX,visibility:"hidden"});var g=new Fx.Morph("thumbnailPopUp",{duration:200,transition:Fx.Transitions.Expo.easeOut,onComplete:function(){animatingPop=false}});g.start({top:myNewY,left:myNewX,opacity:1})};e.delay(250)}}});c.start({opacity:0});if(myid!=currentimage){var b=new Fx.Morph(myid,{duration:100,transition:Fx.Transitions.Expo.easeInOut});b.start({"border-color":"#FFF","background-color":"#FFF",opacity:1})}});$$(".thumbnail").addEvent("mouseleave",function(){myid=this.id;var c=new Fx.Morph("thumbnailPopUp",{duration:50,transition:Fx.Transitions.Expo.easeInOut});c.start({opacity:0});if(myid!=currentimage){var b=new Fx.Morph(myid,{duration:50,transition:Fx.Transitions.Expo.easeInOut});b.start({"border-color":"#FFF","background-color":"#FFF",opacity:0.5})}})}function loadThumbs(l,b){var e=$("thumbnailwrap");thumbnailNumberPos=1;totalNumImages=0;totalNumMedia=0;totalNumQuicktime=0;$("thumbnailwrap").empty();startImage=maingalleries[l]["start"];endImage=maingalleries[l]["end"];thumbPath=maingalleries[l]["thumbpath"];lastimage=maingalleries[l]["end"];currentGallery=maingalleries[l]["gallerynum"];currentimage=Number(galleryimages[startImage]["imgid"]);previousid=Number(startImage);busy=false;for(i=startImage;i<=endImage;i++){filetype=galleryimages[i]["filetype"];if(totalthumbsvisible<$("thumbnails").getCoordinates().width-setThumbWidth){totalthumbsvisible+=setThumbWidth}thumbWidth+=setThumbWidth;e.setStyles({width:thumbWidth});var a=i;if(filetype=="image"){var c=new Element("div",{"class":"thumbnail",id:galleryimages[i]["imgid"],rel:thumbnailNumberPos});var f=new Element("img",{src:thumbPath+galleryimages[i]["src"],rel:" ","class":" controls",title:galleryimages[i]["title"]}).injectInside(c);totalNumImages++}if(filetype=="flv "||filetype=="mov"||filetype=="mp4"||filetype=="mp3 "||filetype=="aac"||filetype=="swf"||filetype=="blip"||filetype=="dailymotion"||filetype=="flickr"||filetype=="googlevideo"||filetype=="metacafe"||filetype=="myspacetv"||filetype=="revver"||filetype=="rutube"||filetype=="seesmic"||filetype=="tudou"||filetype=="youku"||filetype=="youtube"||filetype=="Veoh"||filetype=="viddler"||filetype=="vimeo"||filetype=="12seconds"){var c=new Element("div",{"class":"thumbnail",id:galleryimages[i]["imgid"],rel:thumbnailNumberPos});var f=new Element("img",{src:galleryimages[i]["src"],"class":" controls",title:galleryimages[i]["title"]}).injectInside(c);totalNumMedia++}if(totalNumMedia>1){flashCount=totalNumMedia+" Media Files | "}else{if(totalNumMedia==1){flashCount=totalNumMedia+" Media File | "}else{flashCount=""}}$("flashNum").set("html",flashCount);if(totalNumImages>1){imagecountHTML=totalNumImages+" Photos | "}else{if(totalNumImages==1){imagecountHTML=totalNumImages+" Photo | "}else{imagecountHTML=""}}$("photoNum").set("html",'1 of '+imagecountHTML);c.injectInside($("thumbnailwrap"));thumbnailNumberPos++;$(""+i+"").setStyles({opacity:0});var g=new Fx.Morph(""+i+"",{duration:100,transition:Fx.Transitions.Expo.easeInOut,wait:true});if(i==0){g.start({opacity:1})}else{g.start({opacity:0.5})}if(i==endImage){thumbnailsviewable=Math.floor($("thumbnails").getCoordinates().width);if(thumbWidth>thumbnailsviewable){var d=new Fx.Morph("thumbleft",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});d.start({opacity:0,left:-40});var h=new Fx.Morph("thumbright",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});h.start({opacity:0.75,right:0})}else{var d=new Fx.Morph("thumbleft",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});d.start({opacity:0,left:-40});var h=new Fx.Morph("thumbright",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});h.start({opacity:0,right:-40})}if(b=="loadNew"){e.setStyles({left:0});currentthumbpos=0;loadimage(Number(startImage))}setThumbClick(l)}var j=$$(".controls");var k=new Tips(j,{showDelay:100,hideDelay:100,offsets:{x:8,y:8},title:"title",text:null,className:"minitooltips",fixed:false,onShow:function(m){m.fade(1)},onHide:function(m){m.fade(0)}})}}function galleries(){var c=new Fx.Morph("thumbnailPopUp",{duration:50,transition:Fx.Transitions.Expo.easeInOut});c.start({opacity:0});if(playing==true){slideshow()}var b=new Fx.Morph("galleries",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});var a=new Fx.Morph("fsbox",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});filetype=galleryimages[currentimage]["filetype"];galleryheight=$("gallery").getCoordinates().height;hiddenGalpas=(galleryheight-$("controls").getCoordinates().height);controlHeight=$("controls").getCoordinates().height;if(openclose==true){if(filetype!="image"){$("imgloader").setStyle("visibility","hidden")}b.start({bottom:[-galleryheight,controlHeight]});if(slidesHidden==true){showthumbbox()}openclose=false;a.start({opacity:0})}else{closinggalleries=true;b.start({bottom:-(hiddenGalpas-1)}).addEvent("onComplete",function(){if(closinggalleries==true){if(filetype!="image"){$("imgloader").setStyle("visibility","visible");closinggalleries=false}}});a.start({opacity:1});openclose=true}}function loadimage(f,d){fsisopen="closed";var h=new Fx.Morph("fsbox",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});h.start({opacity:0,bottom:-305});if(f==startImage){$("previous").setStyles({visibility:"hidden"});prevHidden=true}else{$("previous").setStyles({visibility:"visible"});prevHidden=false}if(f==lastimage){$("next").setStyles({visibility:"hidden"});nextHidden=true}else{$("next").setStyles({visibility:"visible"});nextHidden=false}var g=$("images");var j=$("loading");var k=$("gallery");$("loading").setStyles({position:"absolute",opacity:0,left:(k.getCoordinates().width/2)-(j.getCoordinates().width/2),top:(g.getCoordinates().height/2)-(j.getCoordinates().height/2)});if(imagesloaded[f]!=f){imagesloaded[f]=f;var a=new Fx.Morph("infoloader",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});var b=new Fx.Morph("imgloader",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut,onComplete:function(){$("imgloader").empty();filetype=galleryimages[f]["filetype"];if(filetype=="image"){new Asset.image(galleryimages[f]["path"]+galleryimages[f]["src"],{onload:function(){var l=new Fx.Morph("imagewrap",{duration:500,transition:Fx.Transitions.Expo.easeInOut,onComplete:function(){addImage(f)}});l.start({height:galleryimages[f]["height"],width:galleryimages[f]["width"],opacity:1,top:(((g.getCoordinates().height/2)-(galleryimages[f]["height"]/2))),left:(((g.getCoordinates().width/2)-(galleryimages[f]["width"]/2)))})}})}if(filetype=="flv "||filetype=="mov"||filetype=="mp4"||filetype=="mp3 "||filetype=="aac"||filetype=="swf"||filetype=="blip"||filetype=="dailymotion"||filetype=="flickr"||filetype=="googlevideo"||filetype=="metacafe"||filetype=="myspacetv"||filetype=="revver"||filetype=="rutube"||filetype=="seesmic"||filetype=="tudou"||filetype=="youku"||filetype=="youtube"||filetype=="Veoh"||filetype=="viddler"||filetype=="vimeo"||filetype=="12seconds"){if(playing==true){slideshow()}var e=new Fx.Morph("imagewrap",{duration:500,transition:Fx.Transitions.Expo.easeInOut,onComplete:function(){addImage(f)}});e.start({height:galleryimages[f]["height"],width:galleryimages[f]["width"],opacity:1,top:(((g.getCoordinates().height/2)-(galleryimages[f]["height"]/2))),left:(((g.getCoordinates().width/2)-(galleryimages[f]["width"]/2)))})}}});var c=new Fx.Morph("loading",{duration:200,transition:Fx.Transitions.Expo.easeInOut});a.start({opacity:0});b.start({opacity:0});c.start({opacity:1})}else{var b=new Fx.Morph("imgloader",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut,onComplete:function(){$("imgloader").empty();filetype=galleryimages[f]["filetype"];if(filetype=="image"){var e=new Fx.Morph("imagewrap",{duration:300,transition:Fx.Transitions.Expo.easeInOut,onComplete:function(){addImage(f)}});e.start({height:galleryimages[f]["height"],width:galleryimages[f]["width"],opacity:1,top:(((g.getCoordinates().height/2)-(galleryimages[f]["height"]/2))),left:(((g.getCoordinates().width/2)-(galleryimages[f]["width"]/2)))})}if(filetype=="flv "||filetype=="mov"||filetype=="mp4"||filetype=="mp3 "||filetype=="aac"||filetype=="swf"||filetype=="blip"||filetype=="dailymotion"||filetype=="flickr"||filetype=="googlevideo"||filetype=="metacafe"||filetype=="myspacetv"||filetype=="revver"||filetype=="rutube"||filetype=="seesmic"||filetype=="tudou"||filetype=="youku"||filetype=="youtube"||filetype=="Veoh"||filetype=="viddler"||filetype=="vimeo"||filetype=="12seconds"){if(playing==true){slideshow()}var e=new Fx.Morph("imagewrap",{duration:300,transition:Fx.Transitions.Expo.easeInOut,onComplete:function(){addImage(f)}});e.start({height:galleryimages[f]["height"],width:galleryimages[f]["width"],opacity:1,top:(((g.getCoordinates().height/2)-(galleryimages[f]["height"]/2))),left:(((g.getCoordinates().width/2)-(galleryimages[f]["width"]/2)))})}}});b.start({opacity:0})}}function nextprev(d,c){if(d=="previous"){var b=new Fx.Morph("previous",{duration:200,transition:Fx.Transitions.Expo.easeInOut});if(currentimage!=startImage){if(c=="enter"){b.start({opacity:1})}}if(c=="exit"&¤timage!=startImage){b.start({opacity:0.5})}}if(d=="next"){var a=new Fx.Morph("next",{duration:200,transition:Fx.Transitions.Expo.easeInOut});if(currentimage!=lastimage){if(c=="enter"){a.start({opacity:1})}}if(c=="exit"&¤timage!=lastimage){a.start({opacity:0.5})}}}function creategalleries(){var c=maingalleries.length-1;var b=function(d,j){var k=new Element("div",{"class":"gallery",id:"gallery"+d.gallerynum});var h=new Element("h3").set("html",d.name).injectInside(k);var e=new Element("img",{src:d.mainthumb+d.src,"class":"galleryimg",title:d.name,rel:d.description}).injectAfter(h);k.injectInside($("galleryset"));if(c==j){var g=$$(".galleryimg");var f=new Tips(g,{showDelay:100,hideDelay:100,offsets:{x:0,y:125},className:"tooltips",fixed:true,onShow:function(l){l.fade(1)},onHide:function(l){l.fade(0)}});$$(".gallery").addEvent("click",function(l){if(playing==true){slideshow()}var m=this.id;galleryID=""+m+"";galleries();galleryNum=Number(galleryID.slice(7));loadThumbs(galleryNum,"loadNew");movedamount=0})}};maingalleries.each(function(d,e){b(d,e)});var a=new Element("div",{"class":"clear"});a.inject($("galleryset"),"bottom")}function movethumbs(f){var e=$("thumbnails").getCoordinates().width-2;var g=setThumbWidth*(totalNumImages);var d=new Fx.Morph("thumbnailwrap",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});thisminusthat=g-e;if(f=="back"){if(!moving){moving=true;if(currentthumbpos!=0){move=(currentthumbpos+e);d.start({left:[currentthumbpos,move]}).addEvent("onComplete",function(){moving=false});currentthumbpos+=e;movedamount-=e}}}if(f=="more"){if(!moving){moving=true;move=(currentthumbpos-e);var c=new Fx.Morph("thumbgall",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});d.start({left:[currentthumbpos,move]}).addEvent("onComplete",function(){moving=false});currentthumbpos-=e;movedamount+=e}}thumbnailsviewable=$("thumbnails").getCoordinates().width;if(currentthumbpos==0){var b=new Fx.Morph("thumbleft",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});b.start({opacity:0,left:-40});var a=new Fx.Morph("thumbright",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});a.start({opacity:0.75,right:0})}else{if(movedamount";$("lrgloader").set("html",c);a.start({opacity:0.99999});var b=new Fx.Morph("closebtn",{duration:500,transition:Fx.Transitions.Expo.easeInOut});b.start({opacity:1})}function slideshow(){if(playing==false){$("slideshow").set("html",''+pauseText+'');playing=true;pp="play";var f=$$(".controls");var d=new Tips(f,{showDelay:100,hideDelay:100,offsets:{x:8,y:8},title:"title",text:null,className:"minitooltips",fixed:false,onShow:function(h){h.fade(1)},onHide:function(h){h.fade(0)}});var g=new Fx.Morph(""+currentimage+"",{duration:500,transition:Fx.Transitions.Expo.easeInOut});g.start({"border-color":"#FFF","background-color":"#FFF",opacity:0.5});if(currentimage!=lastimage){nextImage=currentimage+1;thumbinview=$("thumbnails").getCoordinates().width;maxThumbsVisible=Math.floor(thumbinview/setThumbWidth);thumbsMod=(nextImage+1)%maxThumbsVisible;if((nextImage+1)>=maxThumbsVisible&&thumbsMod==1||maxThumbsVisible==1){movethumbs("more")}}else{var e=new Fx.Morph("thumbnailwrap",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});e.start({left:[currentthumbpos,0]}).addEvent("onComplete",function(){moving=false});currentthumbpos=0;nextImage=startImage;if(currentthumbpos==0){var b=new Fx.Morph("thumbleft",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});b.start({opacity:0,left:-40});var a=new Fx.Morph("thumbright",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});a.start({opacity:0.75,right:0})}else{if(movedamount');playing=false;pp="pause";var f=$$(".controls");var d=new Tips(f,{showDelay:100,hideDelay:100,offsets:{x:8,y:8},title:"title",text:null,className:"minitooltips",fixed:false,onShow:function(h){h.fade(1)},onHide:function(h){h.fade(0)}})}var c=function(){if(currentimage!=lastimage){nextImage=currentimage+1;thumbinview=$("thumbnails").getCoordinates().width;maxThumbsVisible=Math.floor(thumbinview/setThumbWidth);thumbsMod=(nextImage+1)%maxThumbsVisible;if((nextImage+1)>=maxThumbsVisible&&thumbsMod==1||maxThumbsVisible==1){movethumbs("more")}}if(currentimage!=lastimage&&pp=="play"){var k=new Fx.Morph(""+currentimage+"",{duration:500,transition:Fx.Transitions.Expo.easeInOut});k.start({"border-color":"#FFF","background-color":"#FFF",opacity:0.5});imagenumber=$(""+nextImage+"").get("rel");$("numOf").set("text",imagenumber+" of ").inject("photoNum","top");loadimage(nextImage)}else{c=$clear(timer);$("slideshow").set("html",''+playText+'');playing=false;pp="pause";var j=$$(".controls");var h=new Tips(j,{showDelay:100,hideDelay:100,offsets:{x:8,y:8},title:"title",text:null,className:"minitooltips",fixed:false,onShow:function(l){l.fade(1)},onHide:function(l){l.fade(0)}})}};timer=c.periodical(slideshowtime)}function showthumbbox(){if(openclose!=false){minusThumb=$("thumbbox").getCoordinates().height;minusControls=$("controls").getCoordinates().height;var b=new Fx.Morph("gallery",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});var a=new Fx.Morph("thumbbox",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});if(showThumbs=="show"){showThumbs="hide";a.start({opacity:1});b.start({height:galleryHeight});slidesHidden=false}else{if(showThumbs=="hide"){showThumbs="show";a.start({opacity:0});b.start({height:(galleryHeight)-(minusThumb)});slidesHidden=true}}}}var resizeTimeout;prepareResize=function(){$clear(resizeTimeout);resizeTimeout=realResize.delay(300)};function createBackDrop(){if(largeHtmlIsCreated==null||largeHtmlIsCreated==""){var d=new Element("div",{id:"largeimage"}).injectInside(document.body);var b=new Element("div",{id:"lrgwrap","class":"close"}).injectInside("largeimage");var f=new Element("div",{id:"closebtn","class":"close"}).injectInside("largeimage");var c=new Element("div",{id:"lrgloader"}).injectInside("lrgwrap");var d=new Element("div",{id:"backdrop","class":"close"}).injectInside(document.body);$("largeimage").set("opacity",0);$("closebtn").set("opacity",0);$("largeimage").setStyles({height:0,width:0,opacity:0,top:($("gallery").getCoordinates().height)-50,left:(window.getWidth()/2)});$("backdrop").set("opacity",0);$("backdrop").setStyles({height:0,width:0,opacity:0,top:($("gallery").getCoordinates().height/2)-50,left:(window.getWidth()/2)});$$(".close").addEvent("click",function(){largeIsOpen=false;$clear(resizeTimeout);var g=new Fx.Morph("closebtn",{duration:500,transition:Fx.Transitions.Expo.easeInOut,onComplete:function(){$("lrgloader").empty();var j=new Fx.Morph("lrgwrap",{duration:500,transition:Fx.Transitions.Expo.easeInOut});var h=new Fx.Morph("largeimage",{duration:500,transition:Fx.Transitions.Expo.easeInOut});var k=new Fx.Morph("backdrop",{duration:1000,transition:Fx.Transitions.Expo.easeInOut,onComplete:function(){$("backdrop").setStyles({height:0,width:0,opacity:0,top:($("imagewrap").getCoordinates().height/2)+50,left:(window.getWidth()/2)})}});j.start({height:0,width:0,opacity:0});h.start({height:0,width:0,opacity:0,top:($("imagewrap").getCoordinates().height/2)+50,left:(window.getWidth()/2)});k.start({opacity:0})}});g.start({opacity:0})});largeHtmlIsCreated=true}if(galleryimages[currentimage]["lrgheight"]&&galleryimages[currentimage]["lrgwidth"]){var a=new Fx.Morph("loading",{duration:200,transition:Fx.Transitions.Expo.easeInOut});a.start({opacity:1});$("backdrop").setStyles({opacity:0,height:window.getScrollHeight(),width:"100%",top:0,left:0});var e=new Fx.Morph("backdrop",{duration:500,transition:Fx.Transitions.Expo.easeInOut,onComplete:function(){largeIsOpen=true;new Asset.image(galleryimages[currentimage]["lrgpath"]+galleryimages[currentimage]["src"],{onload:function(){var j=new Fx.Morph("loading",{duration:200,transition:Fx.Transitions.Expo.easeInOut});var h=new Fx.Morph("lrgwrap",{duration:500,transition:Fx.Transitions.Expo.easeInOut});var g=new Fx.Morph("largeimage",{duration:500,transition:Fx.Transitions.Expo.easeInOut});j.start({opacity:0});h.start({width:galleryimages[currentimage]["lrgwidth"],height:galleryimages[currentimage]["lrgheight"],opacity:1});g.start({width:galleryimages[currentimage]["lrgwidth"],height:galleryimages[currentimage]["lrgheight"],opacity:1,top:window.getScroll().y+20,left:((window.getWidth()/2)-(galleryimages[currentimage]["lrgwidth"]/2))}).addEvent("onComplete",function(){$("lrgloader").empty();var k=new Fx.Morph("lrgloader",{duration:500,transition:Fx.Transitions.Expo.easeInOut});k.start({opacity:0,width:galleryimages[currentimage]["lrgwidth"],height:galleryimages[currentimage]["lrgheight"],top:((($("largeimage").getCoordinates().height/2)-(galleryimages[currentimage]["lrgheight"]/2))),left:((($("largeimage").getCoordinates().width/2)-(galleryimages[currentimage]["lrgwidth"]/2)))}).addEvent("onComplete",function(){loadLarge()})})}})}});e.start({opacity:0.5});window.addEvent("resize",prepareResize);realResize=function(){var h=new Fx.Morph("backdrop",{duration:100,transition:Fx.Transitions.Expo.easeInOut,onComplete:function(){}});var g=new Fx.Morph("largeimage",{duration:100,transition:Fx.Transitions.Expo.easeInOut});h.start({opacity:0.5,height:window.getScrollHeight()});g.start({top:window.getScroll().y+20,left:((window.getWidth()/2)-(galleryimages[currentimage]["lrgwidth"]/2))})};$(window.document).addEvent("keydown",function(h){if(h.key=="esc"&&largeIsOpen==true){largeIsOpen=false;$clear(resizeTimeout);var g=new Fx.Morph("closebtn",{duration:500,transition:Fx.Transitions.Expo.easeInOut,onComplete:function(){$("lrgloader").empty();var k=new Fx.Morph("lrgwrap",{duration:500,transition:Fx.Transitions.Expo.easeInOut});var j=new Fx.Morph("largeimage",{duration:500,transition:Fx.Transitions.Expo.easeInOut});var l=new Fx.Morph("backdrop",{duration:1000,transition:Fx.Transitions.Expo.easeInOut,onComplete:function(){$("backdrop").setStyles({height:0,width:0,opacity:0,top:($("imagewrap").getCoordinates().height/2)+50,left:(window.getWidth()/2)})}});k.start({height:0,width:0,opacity:0});j.start({height:0,width:0,opacity:0,top:($("imagewrap").getCoordinates().height/2)+50,left:(window.getWidth()/2)});l.start({opacity:0})}});g.start({opacity:0})}})}}window.addEvent("domready",function(){$("slideshow").addEvent("click",function(){slideshow()});$("showthumbbox").addEvent("click",function(){showthumbbox()});$("showinfo").addEvent("click",function(){showInfo(135)});$("opengallery").addEvent("click",function(){galleries()});$("previous").addEvent("mouseenter",function(){nextprev("previous","enter");var d=new Fx.Morph("thumbnailPopUp",{duration:50,transition:Fx.Transitions.Expo.easeInOut});d.start({opacity:0})});$("images").addEvent("mouseenter",function(){nextprev("previous","exit");nextprev("next","exit");var d=new Fx.Morph("thumbnailPopUp",{duration:50,transition:Fx.Transitions.Expo.easeInOut});d.start({opacity:0});var f=new Fx.Morph("thumbleft",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});f.start({opacity:0.75});var e=new Fx.Morph("thumbright",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});e.start({opacity:0.75})});$("controls").addEvent("mouseenter",function(){nextprev("previous","exit");nextprev("next","exit");var d=new Fx.Morph("thumbnailPopUp",{duration:50,transition:Fx.Transitions.Expo.easeInOut});d.start({opacity:0})});$("previous").addEvent("mouseleave",function(){nextprev("previous","exit");nextprev("next","exit")});$("next").addEvent("mouseenter",function(){nextprev("next","enter");nextprev("previous","exit");var d=new Fx.Morph("thumbnailPopUp",{duration:50,transition:Fx.Transitions.Expo.easeInOut});d.start({opacity:0})});$("next").addEvent("mouseleave",function(){nextprev("next","exit");nextprev("previous","exit")});$("thumbleft").addEvent("mouseleave",function(){var e=new Fx.Morph("thumbleft",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});e.start({opacity:0.75});var d=new Fx.Morph("thumbright",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});d.start({opacity:0.75})});$("thumbleft").addEvent("mouseenter",function(){var f=new Fx.Morph("thumbleft",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});f.start({opacity:1});var d=new Fx.Morph("thumbnailPopUp",{duration:50,transition:Fx.Transitions.Expo.easeInOut});d.start({opacity:0});var e=new Fx.Morph("thumbright",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});e.start({opacity:0.75})});$("thumbright").addEvent("mouseleave",function(){var d=new Fx.Morph("thumbright",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});d.start({opacity:0.75})});$("thumbright").addEvent("mouseenter",function(){var f=new Fx.Morph("thumbright",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});f.start({opacity:1});var d=new Fx.Morph("thumbnailPopUp",{duration:50,transition:Fx.Transitions.Expo.easeInOut});d.start({opacity:0});var e=new Fx.Morph("thumbleft",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});e.start({opacity:0.75})});$("thumbleft").addEvent("click",function(){movethumbs("back")});$("thumbright").addEvent("click",function(){movethumbs("more")});$("thumbnailwrap").addEvent("mouseleave",function(){var d=new Fx.Morph("thumbnailPopUp",{duration:50,transition:Fx.Transitions.Expo.easeInOut});d.start({opacity:0})});var a=new Asset.image(designPath+"pause.png");galleryHeight=$("gallery").getCoordinates().height;$("imgloader").addEvent("click",function(){createBackDrop()});$("imgloader").addEvent("mouseenter",function(){if(galleryimages[currentimage]["lrgheight"]&&galleryimages[currentimage]["lrgwidth"]){smallMessage("show","Click Image to Enlarge",25)}});$("imgloader").addEvent("mouseleave",function(){if(galleryimages[currentimage]["lrgheight"]&&galleryimages[currentimage]["lrgwidth"]){smallMessage("hide")}if(currentimage!=0){var f=new Fx.Morph("thumbright",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});f.start({opacity:0.75});var d=new Fx.Morph("thumbnailPopUp",{duration:50,transition:Fx.Transitions.Expo.easeInOut});d.start({opacity:0});var e=new Fx.Morph("thumbleft",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});e.start({opacity:0.75})}if(currentimage!=lastimage){var e=new Fx.Morph("thumbleft",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});e.start({opacity:0.75});var d=new Fx.Morph("thumbnailPopUp",{duration:50,transition:Fx.Transitions.Expo.easeInOut});d.start({opacity:0});var f=new Fx.Morph("thumbright",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});f.start({opacity:0.75})}});$("fsbox").setStyles({left:($("gallery").getCoordinates().width/2)-($("fsbox").getCoordinates().width/2)});$("previous").set("opacity",0.5);$("next").set("opacity",0.5);creategalleries();loadThumbs(0,"loadNew");$("imagewrap").set("opacity",0);thumbSizing=$("1").getCoordinates().width;thumbRightMargin=$("1").getStyle("margin-right").toInt();thumbLeftMargin=$("1").getStyle("margin-left").toInt();setThumbWidth=Number(thumbSizing+thumbRightMargin+thumbLeftMargin);thumbWidth=Number(setThumbWidth);var c=$$(".controls");var b=new Tips(c,{showDelay:100,hideDelay:100,offsets:{x:8,y:8},title:"title",text:null,className:"minitooltips",fixed:false,onShow:function(d){d.fade(1)},onHide:function(d){d.fade(0)}});$(window.document).addEvent("keydown",function(d){if(d.key=="space"&&playing==true){slideshow()}if(d.key=="esc"&&playing==true){slideshow()}if(d.key=="esc"&&openclose==false){galleries()}})}); \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/js/mootools-1.2-core.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/js/mootools-1.2-core.js Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,1 @@ +var MooTools={version:"1.2.0",build:""};var Native=function(j){j=j||{};var f=j.afterImplement||function(){};var g=j.generics;g=(g!==false);var h=j.legacy;var e=j.initialize;var b=j.protect;var a=j.name;var c=e||h;c.constructor=Native;c.$family={name:"native"};if(h&&e){c.prototype=h.prototype}c.prototype.constructor=c;if(a){var d=a.toLowerCase();c.prototype.$family={name:d};Native.typize(c,d)}var i=function(m,k,n,l){if(!b||l||!m.prototype[k]){m.prototype[k]=n}if(g){Native.genericize(m,k,b)}f.call(m,k,n);return m};c.implement=function(l,k,n){if(typeof l=="string"){return i(this,l,k,n)}for(var m in l){i(this,m,l[m],k)}return this};c.alias=function(m,k,n){if(typeof m=="string"){m=this.prototype[m];if(m){i(this,k,m,n)}}else{for(var l in m){this.alias(l,m[l],k)}}return this};return c};Native.implement=function(d,c){for(var b=0,a=d.length;b-1:this.indexOf(a)>-1},trim:function(){return this.replace(/^\s+|\s+$/g,"")},clean:function(){return this.replace(/\s+/g," ").trim()},camelCase:function(){return this.replace(/-\D/g,function(a){return a.charAt(1).toUpperCase()})},hyphenate:function(){return this.replace(/[A-Z]/g,function(a){return("-"+a.charAt(0).toLowerCase())})},capitalize:function(){return this.replace(/\b[a-z]/g,function(a){return a.toUpperCase()})},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")},toInt:function(a){return parseInt(this,a||10)},toFloat:function(){return parseFloat(this)},hexToRgb:function(b){var a=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return(a)?a.slice(1).hexToRgb(b):null},rgbToHex:function(b){var a=this.match(/\d{1,3}/g);return(a)?a.rgbToHex(b):null},stripScripts:function(b){var a="";var c=this.replace(/]*>([\s\S]*?)<\/script>/gi,function(){a+=arguments[1]+"\n";return""});if(b===true){$exec(a)}else{if($type(b)=="function"){b(a,c)}}return c},substitute:function(a,b){return this.replace(b||(/\\?\{([^}]+)\}/g),function(d,c){if(d.charAt(0)=="\\"){return d.slice(1)}return(a[c]!=undefined)?a[c]:""})}});Hash.implement({has:Object.prototype.hasOwnProperty,keyOf:function(b){for(var a in this){if(this.hasOwnProperty(a)&&this[a]===b){return a}}return null},hasValue:function(a){return(Hash.keyOf(this,a)!==null)},extend:function(a){Hash.each(a,function(c,b){Hash.set(this,b,c)},this);return this},combine:function(a){Hash.each(a,function(c,b){Hash.include(this,b,c)},this);return this},erase:function(a){if(this.hasOwnProperty(a)){delete this[a]}return this},get:function(a){return(this.hasOwnProperty(a))?this[a]:null},set:function(a,b){if(!this[a]||this.hasOwnProperty(a)){this[a]=b}return this},empty:function(){Hash.each(this,function(b,a){delete this[a]},this);return this},include:function(b,c){var a=this[b];if(a==undefined){this[b]=c}return this},map:function(b,c){var a=new Hash;Hash.each(this,function(e,d){a.set(d,b.call(c,e,d,this))},this);return a},filter:function(b,c){var a=new Hash;Hash.each(this,function(e,d){if(b.call(c,e,d,this)){a.set(d,e)}},this);return a},every:function(b,c){for(var a in this){if(this.hasOwnProperty(a)&&!b.call(c,this[a],a)){return false}}return true},some:function(b,c){for(var a in this){if(this.hasOwnProperty(a)&&b.call(c,this[a],a)){return true}}return false},getKeys:function(){var a=[];Hash.each(this,function(c,b){a.push(b)});return a},getValues:function(){var a=[];Hash.each(this,function(b){a.push(b)});return a},toQueryString:function(a){var b=[];Hash.each(this,function(f,e){if(a){e=a+"["+e+"]"}var d;switch($type(f)){case"object":d=Hash.toQueryString(f,e);break;case"array":var c={};f.each(function(h,g){c[g]=h});d=Hash.toQueryString(c,e);break;default:d=e+"="+encodeURIComponent(f)}if(f!=undefined){b.push(d)}});return b.join("&")}});Hash.alias({keyOf:"indexOf",hasValue:"contains"});var Event=new Native({name:"Event",initialize:function(a,f){f=f||window;var k=f.document;a=a||f.event;if(a.$extended){return a}this.$extended=true;var j=a.type;var g=a.target||a.srcElement;while(g&&g.nodeType==3){g=g.parentNode}if(j.test(/key/)){var b=a.which||a.keyCode;var m=Event.Keys.keyOf(b);if(j=="keydown"){var d=b-111;if(d>0&&d<13){m="f"+d}}m=m||String.fromCharCode(b).toLowerCase()}else{if(j.match(/(click|mouse|menu)/i)){k=(!k.compatMode||k.compatMode=="CSS1Compat")?k.html:k.body;var i={x:a.pageX||a.clientX+k.scrollLeft,y:a.pageY||a.clientY+k.scrollTop};var c={x:(a.pageX)?a.pageX-f.pageXOffset:a.clientX,y:(a.pageY)?a.pageY-f.pageYOffset:a.clientY};if(j.match(/DOMMouseScroll|mousewheel/)){var h=(a.wheelDelta)?a.wheelDelta/120:-(a.detail||0)/3}var e=(a.which==3)||(a.button==2);var l=null;if(j.match(/over|out/)){switch(j){case"mouseover":l=a.relatedTarget||a.fromElement;break;case"mouseout":l=a.relatedTarget||a.toElement}if(!(function(){while(l&&l.nodeType==3){l=l.parentNode}return true}).create({attempt:Browser.Engine.gecko})()){l=false}}}}return $extend(this,{event:a,type:j,page:i,client:c,rightClick:e,wheel:h,relatedTarget:l,target:g,code:b,key:m,shift:a.shiftKey,control:a.ctrlKey,alt:a.altKey,meta:a.metaKey})}});Event.Keys=new Hash({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});Event.implement({stop:function(){return this.stopPropagation().preventDefault()},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation()}else{this.event.cancelBubble=true}return this},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault()}else{this.event.returnValue=false}return this}});var Class=new Native({name:"Class",initialize:function(b){b=b||{};var a=function(e){for(var d in this){this[d]=$unlink(this[d])}for(var f in Class.Mutators){if(!this[f]){continue}Class.Mutators[f](this,this[f]);delete this[f]}this.constructor=a;if(e===$empty){return this}var c=(this.initialize)?this.initialize.apply(this,arguments):this;if(this.options&&this.options.initialize){this.options.initialize.call(this)}return c};$extend(a,this);a.constructor=Class;a.prototype=b;return a}});Class.implement({implement:function(){Class.Mutators.Implements(this.prototype,Array.slice(arguments));return this}});Class.Mutators={Implements:function(a,b){$splat(b).each(function(c){$extend(a,($type(c)=="class")?new c($empty):c)})},Extends:function(self,klass){var instance=new klass($empty);delete instance.parent;delete instance.parentOf;for(var key in instance){var current=self[key],previous=instance[key];if(current==undefined){self[key]=previous;continue}var ctype=$type(current),ptype=$type(previous);if(ctype!=ptype){continue}switch(ctype){case"function":if(!arguments.callee.caller){self[key]=eval("("+String(current).replace(/\bthis\.parent\(\s*(\))?/g,function(full,close){return"arguments.callee._parent_.call(this"+(close||", ")})+")")}self[key]._parent_=previous;break;case"object":self[key]=$merge(previous,current)}}self.parent=function(){return arguments.callee.caller._parent_.apply(this,arguments)};self.parentOf=function(descendant){return descendant._parent_.apply(this,Array.slice(arguments,1))}}};var Chain=new Class({chain:function(){this.$chain=(this.$chain||[]).extend(arguments);return this},callChain:function(){return(this.$chain&&this.$chain.length)?this.$chain.shift().apply(this,arguments):false},clearChain:function(){if(this.$chain){this.$chain.empty()}return this}});var Events=new Class({addEvent:function(c,b,a){c=Events.removeOn(c);if(b!=$empty){this.$events=this.$events||{};this.$events[c]=this.$events[c]||[];this.$events[c].include(b);if(a){b.internal=true}}return this},addEvents:function(a){for(var b in a){this.addEvent(b,a[b])}return this},fireEvent:function(c,b,a){c=Events.removeOn(c);if(!this.$events||!this.$events[c]){return this}this.$events[c].each(function(d){d.create({bind:this,delay:a,"arguments":b})()},this);return this},removeEvent:function(b,a){b=Events.removeOn(b);if(!this.$events||!this.$events[b]){return this}if(!a.internal){this.$events[b].erase(a)}return this},removeEvents:function(c){for(var d in this.$events){if(c&&c!=d){continue}var b=this.$events[d];for(var a=b.length;a--;a){this.removeEvent(d,b[a])}}return this}});Events.removeOn=function(a){return a.replace(/^on([A-Z])/,function(b,c){return c.toLowerCase()})};var Options=new Class({setOptions:function(){this.options=$merge.run([this.options].extend(arguments));if(!this.addEvent){return this}for(var a in this.options){if($type(this.options[a])!="function"||!(/^on[A-Z]/).test(a)){continue}this.addEvent(a,this.options[a]);delete this.options[a]}return this}});Document.implement({newElement:function(a,b){if(Browser.Engine.trident&&b){["name","type","checked"].each(function(c){if(!b[c]){return}a+=" "+c+'="'+b[c]+'"';if(c!="checked"){delete b[c]}});a="<"+a+">"}return $.element(this.createElement(a)).set(b)},newTextNode:function(a){return this.createTextNode(a)},getDocument:function(){return this},getWindow:function(){return this.defaultView||this.parentWindow},purge:function(){var c=this.getElementsByTagName("*");for(var b=0,a=c.length;b1);a.each(function(e){var f=this.getElementsByTagName(e.trim());(b)?c.extend(f):c=f},this);return new Elements(c,{ddup:b,cash:!d})}});Element.Storage={get:function(a){return(this[a]||(this[a]={}))}};Element.Inserters=new Hash({before:function(b,a){if(a.parentNode){a.parentNode.insertBefore(b,a)}},after:function(b,a){if(!a.parentNode){return}var c=a.nextSibling;(c)?a.parentNode.insertBefore(b,c):a.parentNode.appendChild(b)},bottom:function(b,a){a.appendChild(b)},top:function(b,a){var c=a.firstChild;(c)?a.insertBefore(b,c):a.appendChild(b)}});Element.Inserters.inside=Element.Inserters.bottom;Element.Inserters.each(function(c,b){var a=b.capitalize();Element.implement("inject"+a,function(d){c(this,$(d,true));return this});Element.implement("grab"+a,function(d){c($(d,true),this);return this})});Element.implement({getDocument:function(){return this.ownerDocument},getWindow:function(){return this.ownerDocument.getWindow()},getElementById:function(d,c){var b=this.ownerDocument.getElementById(d);if(!b){return null}for(var a=b.parentNode;a!=this;a=a.parentNode){if(!a){return null}}return $.element(b,c)},set:function(d,b){switch($type(d)){case"object":for(var c in d){this.set(c,d[c])}break;case"string":var a=Element.Properties.get(d);(a&&a.set)?a.set.apply(this,Array.slice(arguments,1)):this.setProperty(d,b)}return this},get:function(b){var a=Element.Properties.get(b);return(a&&a.get)?a.get.apply(this,Array.slice(arguments,1)):this.getProperty(b)},erase:function(b){var a=Element.Properties.get(b);(a&&a.erase)?a.erase.apply(this,Array.slice(arguments,1)):this.removeProperty(b);return this},match:function(a){return(!a||Element.get(this,"tag")==a)},inject:function(b,a){Element.Inserters.get(a||"bottom")(this,$(b,true));return this},wraps:function(b,a){b=$(b,true);return this.replaces(b).grab(b,a)},grab:function(b,a){Element.Inserters.get(a||"bottom")($(b,true),this);return this},appendText:function(b,a){return this.grab(this.getDocument().newTextNode(b),a)},adopt:function(){Array.flatten(arguments).each(function(a){a=$(a,true);if(a){this.appendChild(a)}},this);return this},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this},clone:function(d,c){switch($type(this)){case"element":var h={};for(var g=0,e=this.attributes.length;g1),cash:!g})}});Element.implement({match:function(b){if(!b){return true}var d=Selectors.Utils.parseTagAndID(b);var a=d[0],e=d[1];if(!Selectors.Filters.byID(this,e)||!Selectors.Filters.byTag(this,a)){return false}var c=Selectors.Utils.parseSelector(b);return(c)?Selectors.Utils.filter(this,c,{}):true}});var Selectors={Cache:{nth:{},parsed:{}}};Selectors.RegExps={id:(/#([\w-]+)/),tag:(/^(\w+|\*)/),quick:(/^(\w+|\*)$/),splitter:(/\s*([+>~\s])\s*([a-zA-Z#.*:\[])/g),combined:(/\.([\w-]+)|\[(\w+)(?:([!*^$~|]?=)["']?(.*?)["']?)?\]|:([\w-]+)(?:\(["']?(.*?)?["']?\)|$)/g)};Selectors.Utils={chk:function(b,c){if(!c){return true}var a=$uid(b);if(!c[a]){return c[a]=true}return false},parseNthArgument:function(h){if(Selectors.Cache.nth[h]){return Selectors.Cache.nth[h]}var e=h.match(/^([+-]?\d*)?([a-z]+)?([+-]?\d*)?$/);if(!e){return false}var g=parseInt(e[1]);var d=(g||g===0)?g:1;var f=e[2]||false;var c=parseInt(e[3])||0;if(d!=0){c--;while(c<1){c+=d}while(c>=d){c-=d}}else{d=c;f="index"}switch(f){case"n":e={a:d,b:c,special:"n"};break;case"odd":e={a:2,b:0,special:"n"};break;case"even":e={a:2,b:1,special:"n"};break;case"first":e={a:0,special:"index"};break;case"last":e={special:"last-child"};break;case"only":e={special:"only-child"};break;default:e={a:(d-1),special:"index"}}return Selectors.Cache.nth[h]=e},parseSelector:function(e){if(Selectors.Cache.parsed[e]){return Selectors.Cache.parsed[e]}var d,h={classes:[],pseudos:[],attributes:[]};while((d=Selectors.RegExps.combined.exec(e))){var i=d[1],g=d[2],f=d[3],b=d[4],c=d[5],j=d[6];if(i){h.classes.push(i)}else{if(c){var a=Selectors.Pseudo.get(c);if(a){h.pseudos.push({parser:a,argument:j})}else{h.attributes.push({name:c,operator:"=",value:j})}}else{if(g){h.attributes.push({name:g,operator:f,value:b})}}}}if(!h.classes.length){delete h.classes}if(!h.attributes.length){delete h.attributes}if(!h.pseudos.length){delete h.pseudos}if(!h.classes&&!h.attributes&&!h.pseudos){h=null}return Selectors.Cache.parsed[e]=h},parseTagAndID:function(b){var a=b.match(Selectors.RegExps.tag);var c=b.match(Selectors.RegExps.id);return[(a)?a[1]:"*",(c)?c[1]:false]},filter:function(f,c,e){var d;if(c.classes){for(d=c.classes.length;d--;d){var g=c.classes[d];if(!Selectors.Filters.byClass(f,g)){return false}}}if(c.attributes){for(d=c.attributes.length;d--;d){var b=c.attributes[d];if(!Selectors.Filters.byAttribute(f,b.name,b.operator,b.value)){return false}}}if(c.pseudos){for(d=c.pseudos.length;d--;d){var a=c.pseudos[d];if(!Selectors.Filters.byPseudo(f,a.parser,a.argument,e)){return false}}}return true},getByTagAndID:function(b,a,d){if(d){var c=(b.getElementById)?b.getElementById(d,true):Element.getElementById(b,d,true);return(c&&Selectors.Filters.byTag(c,a))?[c]:[]}else{return b.getElementsByTagName(a)}},search:function(p,o,u){var b=[];var c=o.trim().replace(Selectors.RegExps.splitter,function(k,j,i){b.push(j);return":)"+i}).split(":)");var q,f,e,B;for(var A=0,w=c.length;A":function(h,g,j,a,f){var c=Selectors.Utils.getByTagAndID(g,j,a);for(var e=0,d=c.length;ea){return false}}return(c==a)},even:function(b,a){return Selectors.Pseudo["nth-child"].call(this,"2n+1",a)},odd:function(b,a){return Selectors.Pseudo["nth-child"].call(this,"2n",a)}});Element.Events.domready={onAdd:function(a){if(Browser.loaded){a.call(this)}}};(function(){var b=function(){if(Browser.loaded){return}Browser.loaded=true;window.fireEvent("domready");document.fireEvent("domready")};switch(Browser.Engine.name){case"webkit":(function(){(["loaded","complete"].contains(document.readyState))?b():arguments.callee.delay(50)})();break;case"trident":var a=document.createElement("div");(function(){($try(function(){a.doScroll("left");return $(a).inject(document.body).set("html","temp").dispose()}))?b():arguments.callee.delay(50)})();break;default:window.addEvent("load",b);document.addEvent("DOMContentLoaded",b)}})();var JSON=new Hash({encode:function(b){switch($type(b)){case"string":return'"'+b.replace(/[\x00-\x1f\\"]/g,JSON.$replaceChars)+'"';case"array":return"["+String(b.map(JSON.encode).filter($defined))+"]";case"object":case"hash":var a=[];Hash.each(b,function(e,d){var c=JSON.encode(e);if(c){a.push(JSON.encode(d)+":"+c)}});return"{"+a+"}";case"number":case"boolean":return String(b);case false:return"null"}return null},$specialChars:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},$replaceChars:function(a){return JSON.$specialChars[a]||"\\u00"+Math.floor(a.charCodeAt()/16).toString(16)+(a.charCodeAt()%16).toString(16)},decode:function(string,secure){if($type(string)!="string"||!string.length){return null}if(secure&&!(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(string.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))){return null}return eval("("+string+")")}});Native.implement([Hash,Array,String,Number],{toJSON:function(){return JSON.encode(this)}});var Cookie=new Class({Implements:Options,options:{path:false,domain:false,duration:false,secure:false,document:document},initialize:function(b,a){this.key=b;this.setOptions(a)},write:function(b){b=encodeURIComponent(b);if(this.options.domain){b+="; domain="+this.options.domain}if(this.options.path){b+="; path="+this.options.path}if(this.options.duration){var a=new Date();a.setTime(a.getTime()+this.options.duration*24*60*60*1000);b+="; expires="+a.toGMTString()}if(this.options.secure){b+="; secure"}this.options.document.cookie=this.key+"="+b;return this},read:function(){var a=this.options.document.cookie.match("(?:^|;)\\s*"+this.key.escapeRegExp()+"=([^;]*)");return(a)?decodeURIComponent(a[1]):null},dispose:function(){new Cookie(this.key,$merge(this.options,{duration:-1})).write("");return this}});Cookie.write=function(b,c,a){return new Cookie(b,a).write(c)};Cookie.read=function(a){return new Cookie(a).read()};Cookie.dispose=function(b,a){return new Cookie(b,a).dispose()};var Swiff=new Class({Implements:[Options],options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:"high",allowScriptAccess:"always",wMode:"transparent",swLiveConnect:true},callBacks:{},vars:{}},toElement:function(){return this.object},initialize:function(l,m){this.instance="Swiff_"+$time();this.setOptions(m);m=this.options;var b=this.id=m.id||this.instance;var a=$(m.container);Swiff.CallBacks[this.instance]={};var e=m.params,g=m.vars,f=m.callBacks;var h=$extend({height:m.height,width:m.width},m.properties);var k=this;for(var d in f){Swiff.CallBacks[this.instance][d]=(function(n){return function(){return n.apply(k.object,arguments)}})(f[d]);g[d]="Swiff.CallBacks."+this.instance+"."+d}e.flashVars=Hash.toQueryString(g);if(Browser.Engine.trident){h.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";e.movie=l}else{h.type="application/x-shockwave-flash";h.data=l}var j=''}}j+="";this.object=((a)?a.empty():new Element("div")).set("html",j).firstChild},replaces:function(a){a=$(a,true);a.parentNode.replaceChild(this.toElement(),a);return this},inject:function(a){$(a,true).appendChild(this.toElement());return this},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].extend(arguments))}});Swiff.CallBacks={};Swiff.remote=function(obj,fn){var rs=obj.CallFunction(''+__flash__argumentsToXML(arguments,2)+"");return eval(rs)};var Fx=new Class({Implements:[Chain,Events,Options],options:{fps:50,unit:false,duration:500,link:"ignore",transition:function(a){return -(Math.cos(Math.PI*a)-1)/2}},initialize:function(a){this.subject=this.subject||this;this.setOptions(a);this.options.duration=Fx.Durations[this.options.duration]||this.options.duration.toInt();var b=this.options.wait;if(b===false){this.options.link="cancel"}},step:function(){var a=$time();if(a=(7-4*d)/11){e=-Math.pow((11-6*d-11*f)/4,2)+c*c;break}}return e},Elastic:function(b,a){return Math.pow(2,10*--b)*Math.cos(20*b*Math.PI*(a[0]||1)/3)}});["Quad","Cubic","Quart","Quint"].each(function(b,a){Fx.Transitions[b]=new Fx.Transition(function(c){return Math.pow(c,[a+2])})});var Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false},initialize:function(a){this.xhr=new Browser.Request();this.setOptions(a);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers=new Hash(this.options.headers)},onStateChange:function(){if(this.xhr.readyState!=4||!this.running){return}this.running=false;this.status=0;$try(function(){this.status=this.xhr.status}.bind(this));if(this.options.isSuccess.call(this,this.status)){this.response={text:this.xhr.responseText,xml:this.xhr.responseXML};this.success(this.response.text,this.response.xml)}else{this.response={text:null,xml:null};this.failure()}this.xhr.onreadystatechange=$empty},isSuccess:function(){return((this.status>=200)&&(this.status<300))},processScripts:function(a){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return $exec(a)}return a.stripScripts(this.options.evalScripts)},success:function(b,a){this.onSuccess(this.processScripts(b),a)},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain()},failure:function(){this.onFailure()},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr)},setHeader:function(a,b){this.headers.set(a,b);return this},getHeader:function(a){return $try(function(){return this.xhr.getResponseHeader(a)}.bind(this))},check:function(a){if(!this.running){return true}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(a.bind(this,Array.slice(arguments,1)));return false}return false},send:function(i){if(!this.check(arguments.callee,i)){return this}this.running=true;var g=$type(i);if(g=="string"||g=="element"){i={data:i}}var d=this.options;i=$extend({data:d.data,url:d.url,method:d.method},i);var e=i.data,b=i.url,a=i.method;switch($type(e)){case"element":e=$(e).toQueryString();break;case"object":case"hash":e=Hash.toQueryString(e)}if(this.options.format){var h="format="+this.options.format;e=(e)?h+"&"+e:h}if(this.options.emulation&&["put","delete"].contains(a)){var f="_method="+a;e=(e)?f+"&"+e:f;a="post"}if(this.options.urlEncoded&&a=="post"){var c=(this.options.encoding)?"; charset="+this.options.encoding:"";this.headers.set("Content-type","application/x-www-form-urlencoded"+c)}if(e&&a=="get"){b=b+(b.contains("?")?"&":"?")+e;e=null}this.xhr.open(a.toUpperCase(),b,this.options.async);this.xhr.onreadystatechange=this.onStateChange.bind(this);this.headers.each(function(k,j){if(!$try(function(){this.xhr.setRequestHeader(j,k);return true}.bind(this))){this.fireEvent("exception",[j,k])}},this);this.fireEvent("request");this.xhr.send(e);if(!this.options.async){this.onStateChange()}return this},cancel:function(){if(!this.running){return this}this.running=false;this.xhr.abort();this.xhr.onreadystatechange=$empty;this.xhr=new Browser.Request();this.fireEvent("cancel");return this}});(function(){var a={};["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(b){a[b]=function(){var c=Array.link(arguments,{url:String.type,data:$defined});return this.send($extend(c,{method:b.toLowerCase()}))}});Request.implement(a)})();Element.Properties.send={set:function(a){var b=this.retrieve("send");if(b){b.cancel()}return this.eliminate("send").store("send:options",$extend({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")},a))},get:function(a){if(a||!this.retrieve("send")){if(a||!this.retrieve("send:options")){this.set("send",a)}this.store("send",new Request(this.retrieve("send:options")))}return this.retrieve("send")}};Element.implement({send:function(a){var b=this.get("send");b.send({data:this,url:a||b.options.url});return this}});Request.HTML=new Class({Extends:Request,options:{update:false,evalScripts:true,filter:false},processHTML:function(c){var b=c.match(/]*>([\s\S]*?)<\/body>/i);c=(b)?b[1]:c;var a=new Element("div");return $try(function(){var d=""+c+"",g;if(Browser.Engine.trident){g=new ActiveXObject("Microsoft.XMLDOM");g.async=false;g.loadXML(d)}else{g=new DOMParser().parseFromString(d,"text/xml")}d=g.getElementsByTagName("root")[0];for(var f=0,e=d.childNodes.length;fthis.options.snap){this.cancel();this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop});this.fireEvent("start",this.element).fireEvent("snap",this.element)}},drag:function(a){if(this.options.preventDefault){a.preventDefault()}this.mouse.now=a.page;for(var b in this.options.modifiers){if(!this.options.modifiers[b]){continue}this.value.now[b]=this.mouse.now[b]-this.mouse.pos[b];if(this.options.invert){this.value.now[b]*=-1}if(this.options.limit&&this.limit[b]){if($chk(this.limit[b][1])&&(this.value.now[b]>this.limit[b][1])){this.value.now[b]=this.limit[b][1]}else{if($chk(this.limit[b][0])&&(this.value.now[b]b.left&&a.xb.top)},checkDroppables:function(){var a=this.droppables.filter(this.checkAgainst,this).getLast();if(this.overed!=a){if(this.overed){this.fireEvent("leave",[this.element,this.overed])}if(a){this.overed=a;this.fireEvent("enter",[this.element,a])}else{this.overed=null}}},drag:function(a){this.parent(a);if(this.droppables.length){this.checkDroppables()}},stop:function(a){this.checkDroppables();this.fireEvent("drop",[this.element,this.overed]);this.overed=null;return this.parent(a)}});Element.implement({makeDraggable:function(a){return new Drag.Move(this,a)}});Hash.Cookie=new Class({Extends:Cookie,options:{autoSave:true},initialize:function(b,a){this.parent(b,a);this.load()},save:function(){var a=JSON.encode(this.hash);if(!a||a.length>4096){return false}if(a=="{}"){this.dispose()}else{this.write(a)}return true},load:function(){this.hash=new Hash(JSON.decode(this.read(),true));return this}});Hash.Cookie.implement((function(){var a={};Hash.each(Hash.prototype,function(c,b){a[b]=function(){var d=c.apply(this.hash,arguments);if(this.options.autoSave){this.save()}return d}});return a})());var Color=new Native({initialize:function(b,c){if(arguments.length>=3){c="rgb";b=Array.slice(arguments,0,3)}else{if(typeof b=="string"){if(b.match(/rgb/)){b=b.rgbToHex().hexToRgb(true)}else{if(b.match(/hsb/)){b=b.hsbToRgb()}else{b=b.hexToRgb(true)}}}}c=c||"rgb";switch(c){case"hsb":var a=b;b=b.hsbToRgb();b.hsb=a;break;case"hex":b=b.hexToRgb(true);break}b.rgb=b.slice(0,3);b.hsb=b.hsb||b.rgbToHsb();b.hex=b.rgbToHex();return $extend(b,this)}});Color.implement({mix:function(){var a=Array.slice(arguments);var c=($type(a.getLast())=="number")?a.pop():50;var b=this.slice();a.each(function(d){d=new Color(d);for(var e=0;e<3;e++){b[e]=Math.round((b[e]/100*(100-c))+(d[e]/100*c))}});return new Color(b,"rgb")},invert:function(){return new Color(this.map(function(a){return 255-a}))},setHue:function(a){return new Color([a,this.hsb[1],this.hsb[2]],"hsb")},setSaturation:function(a){return new Color([this.hsb[0],a,this.hsb[2]],"hsb")},setBrightness:function(a){return new Color([this.hsb[0],this.hsb[1],a],"hsb")}});function $RGB(d,c,a){return new Color([d,c,a],"rgb")}function $HSB(d,c,a){return new Color([d,c,a],"hsb")}function $HEX(a){return new Color(a,"hex")}Array.implement({rgbToHsb:function(){var b=this[0],c=this[1],j=this[2];var g,f,h;var i=Math.max(b,c,j),e=Math.min(b,c,j);var k=i-e;h=i/255;f=(i!=0)?k/i:0;if(f==0){g=0}else{var d=(i-b)/k;var a=(i-c)/k;var l=(i-j)/k;if(b==i){g=l-a}else{if(c==i){g=2+d-l}else{g=4+a-d}}g/=6;if(g<0){g++}}return[Math.round(g*360),Math.round(f*100),Math.round(h*100)]},hsbToRgb:function(){var c=Math.round(this[2]/100*255);if(this[1]==0){return[c,c,c]}else{var a=this[0]%360;var e=a%60;var g=Math.round((this[2]*(100-this[1]))/10000*255);var d=Math.round((this[2]*(6000-this[1]*e))/600000*255);var b=Math.round((this[2]*(6000-this[1]*(60-e)))/600000*255);switch(Math.floor(a/60)){case 0:return[c,b,g];case 1:return[d,c,g];case 2:return[g,c,b];case 3:return[g,d,c];case 4:return[b,g,c];case 5:return[c,g,d]}}return false}});String.implement({rgbToHsb:function(){var a=this.match(/\d{1,3}/g);return(a)?hsb.rgbToHsb():null},hsbToRgb:function(){var a=this.match(/\d{1,3}/g);return(a)?a.hsbToRgb():null}});var Group=new Class({initialize:function(){this.instances=Array.flatten(arguments);this.events={};this.checker={}},addEvent:function(b,a){this.checker[b]=this.checker[b]||{};this.events[b]=this.events[b]||[];if(this.events[b].contains(a)){return false}else{this.events[b].push(a)}this.instances.each(function(c,d){c.addEvent(b,this.check.bind(this,[b,c,d]))},this);return this},check:function(c,a,b){this.checker[c][b]=true;var d=this.instances.every(function(f,e){return this.checker[c][e]||false},this);if(!d){return}this.checker[c]={};this.events[c].each(function(e){e.call(this,this.instances,a)},this)}});var Asset=new Hash({javascript:function(f,d){d=$extend({onload:$empty,document:document,check:$lambda(true)},d);var b=new Element("script",{src:f,type:"text/javascript"});var e=d.onload.bind(b),a=d.check,g=d.document;delete d.onload;delete d.check;delete d.document;b.addEvents({load:e,readystatechange:function(){if(["loaded","complete"].contains(this.readyState)){e()}}}).setProperties(d);if(Browser.Engine.webkit419){var c=(function(){if(!$try(a)){return}$clear(c);e()}).periodical(50)}return b.inject(g.head)},css:function(b,a){return new Element("link",$merge({rel:"stylesheet",media:"screen",type:"text/css",href:b},a)).inject(document.head)},image:function(c,b){b=$merge({onload:$empty,onabort:$empty,onerror:$empty},b);var d=new Image();var a=$(d)||new Element("img");["load","abort","error"].each(function(e){var f="on"+e;var g=b[f];delete b[f];d[f]=function(){if(!d){return}if(!a.parentNode){a.width=d.width;a.height=d.height}d=d.onload=d.onabort=d.onerror=null;g.delay(1,a,a);a.fireEvent(e,a,1)}});d.src=a.src=c;if(d&&d.complete){d.onload.delay(1)}return a.setProperties(b)},images:function(d,c){c=$merge({onComplete:$empty,onProgress:$empty},c);if(!d.push){d=[d]}var a=[];var b=0;d.each(function(f){var e=new Asset.image(f,{onload:function(){c.onProgress.call(this,b,d.indexOf(f));b++;if(b==d.length){c.onComplete()}}});a.push(e)});return new Elements(a)}});var Sortables=new Class({Implements:[Events,Options],options:{snap:4,opacity:1,clone:false,revert:false,handle:false,constrain:false},initialize:function(a,b){this.setOptions(b);this.elements=[];this.lists=[];this.idle=true;this.addLists($$($(a)||a));if(!this.options.clone){this.options.revert=false}if(this.options.revert){this.effect=new Fx.Morph(null,$merge({duration:250,link:"cancel"},this.options.revert))}},attach:function(){this.addLists(this.lists);return this},detach:function(){this.lists=this.removeLists(this.lists);return this},addItems:function(){Array.flatten(arguments).each(function(a){this.elements.push(a);var b=a.retrieve("sortables:start",this.start.bindWithEvent(this,a));(this.options.handle?a.getElement(this.options.handle)||a:a).addEvent("mousedown",b)},this);return this},addLists:function(){Array.flatten(arguments).each(function(a){this.lists.push(a);this.addItems(a.getChildren())},this);return this},removeItems:function(){var a=[];Array.flatten(arguments).each(function(b){a.push(b);this.elements.erase(b);var c=b.retrieve("sortables:start");(this.options.handle?b.getElement(this.options.handle)||b:b).removeEvent("mousedown",c)},this);return $$(a)},removeLists:function(){var a=[];Array.flatten(arguments).each(function(b){a.push(b);this.lists.erase(b);this.removeItems(b.getChildren())},this);return $$(a)},getClone:function(b,a){if(!this.options.clone){return new Element("div").inject(document.body)}if($type(this.options.clone)=="function"){return this.options.clone.call(this,b,a,this.list)}return a.clone(true).setStyles({margin:"0px",position:"absolute",visibility:"hidden",width:a.getStyle("width")}).inject(this.list).position(a.getPosition(a.getOffsetParent()))},getDroppables:function(){var a=this.list.getChildren();if(!this.options.constrain){a=this.lists.concat(a).erase(this.list)}return a.erase(this.clone).erase(this.element)},insert:function(c,b){var a="inside";if(this.lists.contains(b)){this.list=b;this.drag.droppables=this.getDroppables()}else{a=this.element.getAllPrevious().contains(b)?"before":"after"}this.element.inject(b,a);this.fireEvent("sort",[this.element,this.clone])},start:function(b,a){if(!this.idle){return}this.idle=false;this.element=a;this.opacity=a.get("opacity");this.list=a.getParent();this.clone=this.getClone(b,a);this.drag=new Drag.Move(this.clone,{snap:this.options.snap,container:this.options.constrain&&this.element.getParent(),droppables:this.getDroppables(),onSnap:function(){b.stop();this.clone.setStyle("visibility","visible");this.element.set("opacity",this.options.opacity||0);this.fireEvent("start",[this.element,this.clone])}.bind(this),onEnter:this.insert.bind(this),onCancel:this.reset.bind(this),onComplete:this.end.bind(this)});this.clone.inject(this.element,"before");this.drag.start(b)},end:function(){this.drag.detach();this.element.set("opacity",this.opacity);if(this.effect){var a=this.element.getStyles("width","height");var b=this.clone.computePosition(this.element.getPosition(this.clone.offsetParent));this.effect.element=this.clone;this.effect.start({top:b.top,left:b.left,width:a.width,height:a.height,opacity:0.25}).chain(this.reset.bind(this))}else{this.reset()}},reset:function(){this.idle=true;this.clone.destroy();this.fireEvent("complete",this.element)},serialize:function(){var c=Array.link(arguments,{modifier:Function.type,index:$defined});var b=this.lists.map(function(d){return d.getChildren().map(c.modifier||function(e){return e.get("id")},this)},this);var a=c.index;if(this.lists.length==1){a=0}return $chk(a)&&a>=0&&ab[f]){g=d.page[f]-this.options.offsets[f]-e[f]}this.tip.setStyle(c[f],g)}},fill:function(a,b){(typeof b=="string")?a.set("html",b):a.adopt(b)},show:function(){this.fireEvent("show",this.tip)},hide:function(){this.fireEvent("hide",this.tip)}});var SmoothScroll=new Class({Extends:Fx.Scroll,initialize:function(b,c){c=c||document;var e=c.getDocument(),d=c.getWindow();this.parent(e,b);this.links=(this.options.links)?$$(this.options.links):$$(e.links);var a=d.location.href.match(/^[^#]*/)[0]+"#";this.links.each(function(g){if(g.href.indexOf(a)!=0){return}var f=g.href.substr(a.length);if(f&&$(f)){this.useLink(g,f)}},this);if(!Browser.Engine.webkit419){this.addEvent("complete",function(){d.location.hash=this.anchor},true)}},useLink:function(b,a){b.addEvent("click",function(c){this.anchor=a;this.toElement(a);c.stop()}.bind(this))}});var Slider=new Class({Implements:[Events,Options],options:{onTick:function(a){if(this.options.snap){a=this.toPosition(this.step)}this.knob.setStyle(this.property,a)},snap:false,offset:0,range:false,wheel:false,steps:100,mode:"horizontal"},initialize:function(e,a,d){this.setOptions(d);this.element=$(e);this.knob=$(a);this.previousChange=this.previousEnd=this.step=-1;this.element.addEvent("mousedown",this.clickedElement.bind(this));if(this.options.wheel){this.element.addEvent("mousewheel",this.scrolledElement.bindWithEvent(this))}var f,b={},c={x:false,y:false};switch(this.options.mode){case"vertical":this.axis="y";this.property="top";f="offsetHeight";break;case"horizontal":this.axis="x";this.property="left";f="offsetWidth"}this.half=this.knob[f]/2;this.full=this.element[f]-this.knob[f]+(this.options.offset*2);this.min=$chk(this.options.range[0])?this.options.range[0]:0;this.max=$chk(this.options.range[1])?this.options.range[1]:this.options.steps;this.range=this.max-this.min;this.steps=this.options.steps||this.full;this.stepSize=Math.abs(this.range)/this.steps;this.stepWidth=this.stepSize*this.full/Math.abs(this.range);this.knob.setStyle("position","relative").setStyle(this.property,-this.options.offset);c[this.axis]=this.property;b[this.axis]=[-this.options.offset,this.full-this.options.offset];this.drag=new Drag(this.knob,{snap:0,limit:b,modifiers:c,onDrag:this.draggedKnob.bind(this),onStart:this.draggedKnob.bind(this),onComplete:function(){this.draggedKnob();this.end()}.bind(this)});if(this.options.snap){this.drag.options.grid=Math.ceil(this.stepWidth);this.drag.options.limit[this.axis][1]=this.full}},set:function(a){if(!((this.range>0)^(a0)^(a>this.max))){a=this.max}this.step=Math.round(a);this.checkStep();this.end();this.fireEvent("tick",this.toPosition(this.step));return this},clickedElement:function(c){var b=this.range<0?-1:1;var a=c.page[this.axis]-this.element.getPosition()[this.axis]-this.half;a=a.limit(-this.options.offset,this.full-this.options.offset);this.step=Math.round(this.min+b*this.toStep(a));this.checkStep();this.end();this.fireEvent("tick",a)},scrolledElement:function(a){var b=(this.options.mode=="horizontal")?(a.wheel<0):(a.wheel>0);this.set(b?this.step-this.stepSize:this.step+this.stepSize);a.stop()},draggedKnob:function(){var b=this.range<0?-1:1;var a=this.drag.value.now[this.axis];a=a.limit(-this.options.offset,this.full-this.options.offset);this.step=Math.round(this.min+b*this.toStep(a));this.checkStep()},checkStep:function(){if(this.previousChange!=this.step){this.previousChange=this.step;this.fireEvent("change",this.step)}},end:function(){if(this.previousEnd!==this.step){this.previousEnd=this.step;this.fireEvent("complete",this.step+"")}},toStep:function(a){var b=(a+this.options.offset)*this.stepSize/this.full*this.steps;return this.options.steps?Math.round(b-=b%this.stepSize):b},toPosition:function(a){return(this.full*Math.abs(this.min-a))/(this.steps*this.stepSize)-this.options.offset}});var Scroller=new Class({Implements:[Events,Options],options:{area:20,velocity:1,onChange:function(a,b){this.element.scrollTo(a,b)}},initialize:function(b,a){this.setOptions(a);this.element=$(b);this.listener=($type(this.element)!="element")?$(this.element.getDocument().body):this.element;this.timer=null;this.coord=this.getCoords.bind(this)},start:function(){this.listener.addEvent("mousemove",this.coord)},stop:function(){this.listener.removeEvent("mousemove",this.coord);this.timer=$clear(this.timer)},getCoords:function(a){this.page=(this.listener.get("tag")=="body")?a.client:a.page;if(!this.timer){this.timer=this.scroll.periodical(50,this)}},scroll:function(){var b=this.element.getSize(),a=this.element.getScroll(),e=this.element.getPosition(),d={x:0,y:0};for(var c in this.page){if(this.page[c]<(this.options.area+e[c])&&a[c]!=0){d[c]=(this.page[c]-this.options.area-e[c])*this.options.velocity}else{if(this.page[c]+this.options.area>(b[c]+e[c])&&b[c]+b[c]!=a[c]){d[c]=(this.page[c]-b[c]+this.options.area-e[c])*this.options.velocity}}}if(d.y||d.x){this.fireEvent("change",[a.x+d.x,a.y+d.y])}}});var Accordion=new Class({Extends:Fx.Elements,options:{display:0,show:false,height:true,width:false,opacity:true,fixedHeight:false,fixedWidth:false,wait:false,alwaysHide:false},initialize:function(){var c=Array.link(arguments,{container:Element.type,options:Object.type,togglers:$defined,elements:$defined});this.parent(c.elements,c.options);this.togglers=$$(c.togglers);this.container=$(c.container);this.previous=-1;if(this.options.alwaysHide){this.options.wait=true}if($chk(this.options.show)){this.options.display=false;this.previous=this.options.show}if(this.options.start){this.options.display=false;this.options.show=false}this.effects={};if(this.options.opacity){this.effects.opacity="fullOpacity"}if(this.options.width){this.effects.width=this.options.fixedWidth?"fullWidth":"offsetWidth"}if(this.options.height){this.effects.height=this.options.fixedHeight?"fullHeight":"scrollHeight"}for(var b=0,a=this.togglers.length;b0));this.fireEvent(c?"background":"active",[this.togglers[d],e]);for(var f in this.effects){b[d][f]=c?0:e[this.effects[f]]}},this);return this.start(b)}}); \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/js/setupvars.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/js/setupvars.js Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,2 @@ +var setThumbWidth = 56; //Thumbnail width (in pixels) var transitionspeed = 250; //Transition speed for fades. (1000 = 1 second) +var slideshowtime = 6000; //Time delay for Slideshow (1000 = 1 second) //setting for text output and selling prints var playText = "Play Slide Show"; var pauseText = "Pause Slide Show"; var purchaseprinttxt = "Prints Available; See Below"; var purchaseOf = ""; var shipinginfoshort = ""; var selectSizes = "Select Size"; var orderText = "Buy Print"; //If you sell your prints with Google Checkout var merchantId = ""; //If you sell your prints with Paypal var paypalButtonId = "2JVJAN2X7GRZ2"; var paypalSelectText = ""; /*######*/ /*Begin Media Variables*/ /*######*/ var flashdefaultWidth= 360; // Initial width of the box (in pixels) var flashdefaultHeight= 240; // Initial height of the box (in pixels) // Global media options var scriptaccess= 'true'; // Allow script access to flash files var fullscreen= 'true'; // Use fullscreen var fullscreenNum= '1'; // 1 = true var autoplay= 'true'; // Plays the video as soon as it's opened var autoplayNum= '1'; // 1 = true var bgcolor= '#000000'; // Background color used for both flash and QT media // NonverBlaster // NonverBlaster Settings, allows to play .FLV, .SWF files var playerpath = 'nonverblaster/NonverBlaster.swf'; // Path to NonverBlaster.swf var controllerColor= '0x777777'; // set the controlbar color var showTimecode= 'false'; // turn timecode display off or on // Flickr options var flInfo= 'true'; // Show title and info at video start // Revver options var revverID= '340881'; // Revver affiliate ID required for ad revinue sharing var revverFullscreen= 'true'; // Fullscreen option var revverBack= '000000'; // Background colour var revverFront= 'ffffff'; // Foreground colour var revverGrad= '000000'; // Gradation colour // Youtube options var ytColor1= '000000'; // Outline colour var ytColor2= '333333'; // Base interface colour (highlight colours stay consistent) var ytQuality= '&ap=%2526fmt%3D18'; // Default quality setting - leave empty for standard quality use '&ap=%2526fmt%3D18' for high quality and '&ap=%2526fmt%3D22' for HD (note that not all videos are availible in high quality and very few in HD) // Vimeo options var vmTitle= '1'; // Show video title var vmByline= '1'; // Show byline var vmPortrait= '1'; // Show author portrait var vmColor= 'ffffff'; // Custom controller colours hex value minus the # sign defult is 5ca0b5 /*######*/ /*End Media Variables*/ /*######*/ \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/nonverblaster/NonverBlaster.swf Binary file e2gallerypro/nonverblaster/NonverBlaster.swf has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/nonverblaster/Readme_NonverBlaster.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/nonverblaster/Readme_NonverBlaster.txt Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,5 @@ +NonverBlaster is a simple video player with fullscreenMode ability + +NonverBlaster is provided by http://nonverbla.de + +Go check out http://nonverbla.de site for more info. \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/nonverblaster/swfobject.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/nonverblaster/swfobject.js Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,138 @@ +/** + * SWFObject v1.4.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/ + * + * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License: + * http://www.opensource.org/licenses/mit-license.php + * + * **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for + * legal reasons. + */ +if(typeof deconcept=="undefined"){var deconcept=new Object();} +if(typeof deconcept.util=="undefined"){deconcept.util=new Object();} +if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();} +deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){if(!document.getElementById){return;} +this.DETECT_KEY=_b?_b:"detectflash"; +this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY); +this.params=new Object(); +this.variables=new Object(); +this.attributes=new Array(); +if(_1){this.setAttribute("swf",_1);} +if(id){this.setAttribute("id",id);} +if(w){this.setAttribute("width",w);} +if(h){this.setAttribute("height",h);} +if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));} +this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion(); +if(c){this.addParam("bgcolor",c);} +var q=_8?_8:"high"; +this.addParam("quality",q); +this.setAttribute("useExpressInstall",_7); +this.setAttribute("doExpressInstall",false); +var _d=(_9)?_9:window.location; +this.setAttribute("xiRedirectUrl",_d); +this.setAttribute("redirectUrl",""); +if(_a){this.setAttribute("redirectUrl",_a);}}; +deconcept.SWFObject.prototype={setAttribute:function(_e,_f){ +this.attributes[_e]=_f; +},getAttribute:function(_10){ +return this.attributes[_10]; +},addParam:function(_11,_12){ +this.params[_11]=_12; +},getParams:function(){ +return this.params; +},addVariable:function(_13,_14){ +this.variables[_13]=_14; +},getVariable:function(_15){ +return this.variables[_15]; +},getVariables:function(){ +return this.variables; +},getVariablePairs:function(){ +var _16=new Array(); +var key; +var _18=this.getVariables(); +for(key in _18){_16.push(key+"="+_18[key]);} +return _16;},getSWFHTML:function(){var _19=""; +if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){ +if(this.getAttribute("doExpressInstall")){ +this.addVariable("MMplayerType","PlugIn");} +_19="0){_19+="flashvars=\""+_1c+"\"";}_19+="/>"; +}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");} +_19=""; +_19+=""; +var _1d=this.getParams(); +for(var key in _1d){_19+="";} +var _1f=this.getVariablePairs().join("&"); +if(_1f.length>0){_19+="";}_19+="";} +return _19; +},write:function(_20){ +if(this.getAttribute("useExpressInstall")){ +var _21=new deconcept.PlayerVersion([6,0,65]); +if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){ +this.setAttribute("doExpressInstall",true); +this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl"))); +document.title=document.title.slice(0,47)+" - Flash Player Installation"; +this.addVariable("MMdoctitle",document.title);}} +if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){ +var n=(typeof _20=="string")?document.getElementById(_20):_20; +n.innerHTML=this.getSWFHTML();return true; +}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}} +return false;}}; +deconcept.SWFObjectUtil.getPlayerVersion=function(){ +var _23=new deconcept.PlayerVersion([0,0,0]); +if(navigator.plugins&&navigator.mimeTypes.length){ +var x=navigator.plugins["Shockwave Flash"]; +if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));} +}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");} +catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); +_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";} +catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");} +catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}} +return _23;}; +deconcept.PlayerVersion=function(_27){ +this.major=_27[0]!=null?parseInt(_27[0]):0; +this.minor=_27[1]!=null?parseInt(_27[1]):0; +this.rev=_27[2]!=null?parseInt(_27[2]):0; +}; +deconcept.PlayerVersion.prototype.versionIsValid=function(fv){ +if(this.majorfv.major){return true;} +if(this.minorfv.minor){return true;} +if(this.rev +var imagesloaded = new Array(); +var maingalleries = new Array(); + +maingalleries = [ +Parse(); +$i=0; +$k=0; +$l=0; +foreach($parser->document->gallery as $gallery){ + if($i!=0){ + echo','; + } + foreach($gallery->item as $item){ + $l++; + $finalnum=$l-1; + } + echo "{'name':'".$gallery->title[0]->tagData."', 'imgpath': '".$gallery->gallerypath[0]->tagData."','lrgpath': '".$gallery->largeimgpath[0]->tagData."', 'thumbpath': '".$gallery->thumbpath[0]->tagData."', 'mainthumb': '".$gallery->mainthumb[0]->tagData."', 'src':'".$gallery->mainthumbsrc[0]->tagData."', 'description':'".$gallery->description[0]->tagData."', 'start':".$k.", 'end':".$finalnum.", 'gallerynum':".$i."}"; + $i++; + foreach($gallery->item as $item){ + $k++; + } +} + +?> +]; + +var galleryimages = new Array(); + +galleryimages = [ +document->gallery as $gallery){ + foreach($gallery->item as $item){ + if($j!=0){ + echo', +'; + } + if(isset($item->sellprint[0])){ + $sellprintSet = $item->sellprint[0]; + }else{ + $sellprintSet = NULL; + } + if($sellprintSet != NULL || $sellprintSet!=""){ + if($item->sellprint[0]->tagAttrs['type']=='paypal'||$item->sellprint[0]->tagAttrs['type']=='google'){ + $sellprint = "true"; + $selltype = ",'paytype':'".$item->sellprint[0]->tagAttrs['type']."'"; + $pNum = 1; + $pricing =""; + if($item->sellprint[0]->price!= NULL ){ + foreach($item->sellprint[0]->price as $price){ + $pricing .= ", 'price".$pNum."': '".$price->tagData."', 'pricecurrency".$pNum."': '".$item->sellprint[0]->tagAttrs['currency']."', 'pricecurrencysymbol".$pNum."': '".$item->sellprint[0]->tagAttrs['currencysymbol']."', 'pricesize".$pNum."': '".$price->tagAttrs['size']."'"; + $pNum++; + } + } + + }else{ + $sellprint = "false"; + $selltype = ""; + $pricing=""; + $pNum = 1; + } + }else{ + $sellprint = "false"; + $selltype = ""; + $pricing=""; + $pNum = 1; + } + if($item->tagAttrs['type']=='image'){ + echo"{'filetype':'".$item->tagAttrs['type']."', 'path':'".$gallery->gallerypath[0]->tagData."','src':'".$item->src[0]->tagData."', 'width':'".$item->demensions[0]->tagAttrs['width']."', 'height':'".$item->demensions[0]->tagAttrs['height']."', 'lrgwidth':'".$item->large[0]->tagAttrs['width']."', 'lrgheight':'".$item->large[0]->tagAttrs['height']."', 'lrgpath':'".$gallery->largeimgpath[0]->tagData."','title': '".$item->title[0]->tagData."', 'author':'".$item->author[0]->tagData."', 'copyright':'".$item->copyright[0]->tagData."', 'description':'".$item->description[0]->tagData."','forsale':".$sellprint."".$selltype." ".$pricing.",'numOfPrices':".($pNum-1).", 'imgid':".$j."}"; + }else{ + echo"{'filetype':'".$item->tagAttrs['type']."','mediaURL':'".$item->mediaurl[0]->tagData."', 'path':'".$gallery->gallerypath[0]->tagData."','src':'".$item->src[0]->tagData."', 'width':'".$item->demensions[0]->tagAttrs['width']."', 'height':'".$item->demensions[0]->tagAttrs['height']."', 'lrgwidth':'".$item->large[0]->tagAttrs['width']."', 'lrgheight':'".$item->large[0]->tagAttrs['height']."', 'lrgpath':'".$gallery->largeimgpath[0]->tagData."','title': '".$item->title[0]->tagData."', 'author':'".$item->author[0]->tagData."', 'copyright':'".$item->copyright[0]->tagData."', 'description':'".$item->description[0]->tagData."','forsale':".$sellprint."".$selltype." ".$pricing.",'numOfPrices':".($pNum-1).", 'imgid':".$j."}"; + } + $j++; + } +} +?> + +]; + + \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/php/xmlparse.v4.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/php/xmlparse.v4.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,435 @@ + + * @copyright Copyright (c) 2005-2007, Adam A. Flynn + * + * @version 1.3.0 + */ +class XMLParser +{ + /** + * The XML parser + * + * @var resource + */ + var $parser; + + /** + * The XML document + * + * @var string + */ + var $xml; + + /** + * Document tag + * + * @var object + */ + var $document; + + /** + * Current object depth + * + * @var array + */ + var $stack; + /** + * Whether or not to replace dashes and colons in tag + * names with underscores. + * + * @var bool + */ + var $cleanTagNames; + + + /** + * Constructor. Loads XML document. + * + * @param string $xml The string of the XML document + * @return XMLParser + */ + function XMLParser($xml = '', $cleanTagNames = true) + { + //Load XML document + $this->xml = $xml; + + // Set stack to an array + $this->stack = array(); + + //Set whether or not to clean tag names + $this->cleanTagNames = $cleanTagNames; + } + + /** + * Initiates and runs PHP's XML parser + */ + function Parse() + { + //Create the parser resource + $this->parser = xml_parser_create(); + + //Set the handlers + xml_set_object($this->parser, $this); + xml_set_element_handler($this->parser, 'StartElement', 'EndElement'); + xml_set_character_data_handler($this->parser, 'CharacterData'); + + //Error handling + if (!xml_parse($this->parser, $this->xml)) + $this->HandleError(xml_get_error_code($this->parser), xml_get_current_line_number($this->parser), xml_get_current_column_number($this->parser)); + + //Free the parser + xml_parser_free($this->parser); + } + + /** + * Handles an XML parsing error + * + * @param int $code XML Error Code + * @param int $line Line on which the error happened + * @param int $col Column on which the error happened + */ + function HandleError($code, $line, $col) + { + trigger_error('XML Parsing Error at '.$line.':'.$col.'. Error '.$code.': '.xml_error_string($code)); + } + + + /** + * Gets the XML output of the PHP structure within $this->document + * + * @return string + */ + function GenerateXML() + { + return $this->document->GetXML(); + } + + /** + * Gets the reference to the current direct parent + * + * @return object + */ + function GetStackLocation() + { + $return = ''; + + foreach($this->stack as $stack) + $return .= $stack.'->'; + + return rtrim($return, '->'); + } + + /** + * Handler function for the start of a tag + * + * @param resource $parser + * @param string $name + * @param array $attrs + */ + function StartElement($parser, $name, $attrs = array()) + { + //Make the name of the tag lower case + $name = strtolower($name); + + //Check to see if tag is root-level + if (count($this->stack) == 0) + { + //If so, set the document as the current tag + $this->document = new XMLTag($name, $attrs); + + //And start out the stack with the document tag + $this->stack = array('document'); + } + //If it isn't root level, use the stack to find the parent + else + { + //Get the name which points to the current direct parent, relative to $this + $parent = $this->GetStackLocation(); + + //Add the child + eval('$this->'.$parent.'->AddChild($name, $attrs, '.count($this->stack).', $this->cleanTagNames);'); + + //If the cleanTagName feature is on, replace colons and dashes with underscores + if($this->cleanTagNames) + $name = str_replace(array(':', '-'), '_', $name); + + + //Update the stack + eval('$this->stack[] = $name.\'[\'.(count($this->'.$parent.'->'.$name.') - 1).\']\';'); + } + } + + /** + * Handler function for the end of a tag + * + * @param resource $parser + * @param string $name + */ + function EndElement($parser, $name) + { + //Update stack by removing the end value from it as the parent + array_pop($this->stack); + } + + /** + * Handler function for the character data within a tag + * + * @param resource $parser + * @param string $data + */ + function CharacterData($parser, $data) + { + //Get the reference to the current parent object + $tag = $this->GetStackLocation(); + + //Assign data to it + eval('$this->'.$tag.'->tagData .= trim($data);'); + } +} + + +/** + * XML Tag Object (php4) + * + * This object stores all of the direct children of itself in the $children array. They are also stored by + * type as arrays. So, if, for example, this tag had 2 tags as children, there would be a class member + * called $font created as an array. $font[0] would be the first font tag, and $font[1] would be the second. + * + * To loop through all of the direct children of this object, the $children member should be used. + * + * To loop through all of the direct children of a specific tag for this object, it is probably easier + * to use the arrays of the specific tag names, as explained above. + * + * @author Adam A. Flynn + * @copyright Copyright (c) 2005-2007, Adam A. Flynn + * + * @version 1.3.0 + */ +class XMLTag +{ + /** + * Array with the attributes of this XML tag + * + * @var array + */ + var $tagAttrs; + + /** + * The name of the tag + * + * @var string + */ + var $tagName; + + /** + * The data the tag contains + * + * So, if the tag doesn't contain child tags, and just contains a string, it would go here + * + * @var string + */ + var $tagData; + + /** + * Array of references to the objects of all direct children of this XML object + * + * @var array + */ + var $tagChildren; + + /** + * The number of parents this XML object has (number of levels from this tag to the root tag) + * + * Used presently only to set the number of tabs when outputting XML + * + * @var int + */ + var $tagParents; + + /** + * Constructor, sets up all the default values + * + * @param string $name + * @param array $attrs + * @param int $parents + * @return XMLTag + */ + function XMLTag($name, $attrs = array(), $parents = 0) + { + //Make the keys of the attr array lower case, and store the value + $this->tagAttrs = array_change_key_case($attrs, CASE_LOWER); + + //Make the name lower case and store the value + $this->tagName = strtolower($name); + + //Set the number of parents + $this->tagParents = $parents; + + //Set the types for children and data + $this->tagChildren = array(); + $this->tagData = ''; + } + + /** + * Adds a direct child to this object + * + * @param string $name + * @param array $attrs + * @param int $parents + * @param bool $cleanTagName + */ + function AddChild($name, $attrs, $parents, $cleanTagName = true) + { + //If the tag is a reserved name, output an error + if(in_array($name, array('tagChildren', 'tagAttrs', 'tagParents', 'tagData', 'tagName'))) + { + trigger_error('You have used a reserved name as the name of an XML tag. Please consult the documentation (http://www.criticaldevelopment.net/xml/) and rename the tag named "'.$name.'" to something other than a reserved name.', E_USER_ERROR); + + return; + } + + //Create the child object itself + $child = new XMLTag($name, $attrs, $parents); + + //If the cleanTagName feature is on, replace colons and dashes with underscores + if($cleanTagName) + $name = str_replace(array(':', '-'), '_', $name); + + //Toss up a notice if someone's trying to to use a colon or dash in a tag name + elseif(strstr($name, ':') || strstr($name, '-')) + trigger_error('Your tag named "'.$name.'" contains either a dash or a colon. Neither of these characters are friendly with PHP variable names, and, as such, they cannot be accessed and will cause the parser to not work. You must enable the cleanTagName feature (pass true as the second argument of the XMLParser constructor). For more details, see http://www.criticaldevelopment.net/xml/', E_USER_ERROR); + + //If there is no array already set for the tag name being added, + //create an empty array for it + if(!isset($this->$name)) + $this->$name = array(); + + //Add the reference of it to the end of an array member named for the tag's name + $this->{$name}[] =& $child; + + //Add the reference to the children array member + $this->tagChildren[] =& $child; + } + + /** + * Returns the string of the XML document which would be generated from this object + * + * This function works recursively, so it gets the XML of itself and all of its children, which + * in turn gets the XML of all their children, which in turn gets the XML of all thier children, + * and so on. So, if you call GetXML from the document root object, it will return a string for + * the XML of the entire document. + * + * This function does not, however, return a DTD or an XML version/encoding tag. That should be + * handled by XMLParser::GetXML() + * + * @return string + */ + function GetXML() + { + //Start a new line, indent by the number indicated in $this->parents, add a <, and add the name of the tag + $out = "\n".str_repeat("\t", $this->tagParents).'<'.$this->tagName; + + //For each attribute, add attr="value" + foreach($this->tagAttrs as $attr => $value) + $out .= ' '.$attr.'="'.$value.'"'; + + //If there are no children and it contains no data, end it off with a /> + if(empty($this->tagChildren) && empty($this->tagData)) + $out .= " />"; + + //Otherwise... + else + { + //If there are children + if(!empty($this->tagChildren)) + { + //Close off the start tag + $out .= '>'; + + //For each child, call the GetXML function (this will ensure that all children are added recursively) + foreach($this->tagChildren as $child) + { + if(is_object($child)) + $out .= $child->GetXML(); + } + + //Add the newline and indentation to go along with the close tag + $out .= "\n".str_repeat("\t", $this->tagParents); + } + + //If there is data, close off the start tag and add the data + elseif(!empty($this->tagData)) + $out .= '>'.$this->tagData; + + //Add the end tag + $out .= 'tagName.'>'; + } + + //Return the final output + return $out; + } + + /** + * Deletes this tag's child with a name of $childName and an index + * of $childIndex + * + * @param string $childName + * @param int $childIndex + */ + function Delete($childName, $childIndex = 0) + { + //Delete all of the children of that child + $this->{$childName}[$childIndex]->DeleteChildren(); + + //Destroy the child's value + $this->{$childName}[$childIndex] = null; + + //Remove the child's name from the named array + unset($this->{$childName}[$childIndex]); + + //Loop through the tagChildren array and remove any null + //values left behind from the above operation + for($x = 0; $x < count($this->tagChildren); $x ++) + { + if(is_null($this->tagChildren[$x])) + unset($this->tagChildren[$x]); + } + } + + /** + * Removes all of the children of this tag in both name and value + */ + function DeleteChildren() + { + //Loop through all child tags + for($x = 0; $x < count($this->tagChildren); $x ++) + { + //Do this recursively + $this->tagChildren[$x]->DeleteChildren(); + + //Delete the name and value + $this->tagChildren[$x] = null; + unset($this->tagChildren[$x]); + } + } +} +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 e2gallerypro/php/xmlparse.v5.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e2gallerypro/php/xmlparse.v5.php Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,430 @@ + + * @copyright Copyright (c) 2005-2007, Adam A. Flynn + * + * @version 1.3.0 + */ +class XMLParser +{ + /** + * The XML parser + * + * @var resource + */ + private $parser; + + /** + * The XML document + * + * @var string + */ + private $xml; + + /** + * Document tag + * + * @var object + */ + public $document; + + /** + * Current object depth + * + * @var array + */ + private $stack; + + /** + * Whether or not to replace dashes and colons in tag + * names with underscores. + * + * @var bool + */ + private $cleanTagNames; + + + /** + * Constructor. Loads XML document. + * + * @param string $xml The string of the XML document + * @return XMLParser + */ + function __construct($xml = '', $cleanTagNames = true) + { + //Load XML document + $this->xml = $xml; + + //Set stack to an array + $this->stack = array(); + + //Set whether or not to clean tag names + $this->cleanTagNames = $cleanTagNames; + } + + /** + * Initiates and runs PHP's XML parser + */ + public function Parse() + { + //Create the parser resource + $this->parser = xml_parser_create(); + + //Set the handlers + xml_set_object($this->parser, $this); + xml_set_element_handler($this->parser, 'StartElement', 'EndElement'); + xml_set_character_data_handler($this->parser, 'CharacterData'); + + //Error handling + if (!xml_parse($this->parser, $this->xml)) + $this->HandleError(xml_get_error_code($this->parser), xml_get_current_line_number($this->parser), xml_get_current_column_number($this->parser)); + + //Free the parser + xml_parser_free($this->parser); + } + + /** + * Handles an XML parsing error + * + * @param int $code XML Error Code + * @param int $line Line on which the error happened + * @param int $col Column on which the error happened + */ + private function HandleError($code, $line, $col) + { + trigger_error('XML Parsing Error at '.$line.':'.$col.'. Error '.$code.': '.xml_error_string($code)); + } + + + /** + * Gets the XML output of the PHP structure within $this->document + * + * @return string + */ + public function GenerateXML() + { + return $this->document->GetXML(); + } + + /** + * Gets the reference to the current direct parent + * + * @return object + */ + private function GetStackLocation() + { + //Returns the reference to the current direct parent + return end($this->stack); + } + + /** + * Handler function for the start of a tag + * + * @param resource $parser + * @param string $name + * @param array $attrs + */ + private function StartElement($parser, $name, $attrs = array()) + { + //Make the name of the tag lower case + $name = strtolower($name); + + //Check to see if tag is root-level + if (count($this->stack) == 0) + { + //If so, set the document as the current tag + $this->document = new XMLTag($name, $attrs); + + //And start out the stack with the document tag + $this->stack = array(&$this->document); + } + //If it isn't root level, use the stack to find the parent + else + { + //Get the reference to the current direct parent + $parent = $this->GetStackLocation(); + + $parent->AddChild($name, $attrs, count($this->stack), $this->cleanTagNames); + + //If the cleanTagName feature is on, clean the tag names + if($this->cleanTagNames) + $name = str_replace(array(':', '-'), '_', $name); + + //Update the stack + $this->stack[] = end($parent->$name); + } + } + + /** + * Handler function for the end of a tag + * + * @param resource $parser + * @param string $name + */ + private function EndElement($parser, $name) + { + //Update stack by removing the end value from it as the parent + array_pop($this->stack); + } + + /** + * Handler function for the character data within a tag + * + * @param resource $parser + * @param string $data + */ + private function CharacterData($parser, $data) + { + //Get the reference to the current parent object + $tag = $this->GetStackLocation(); + + //Assign data to it + $tag->tagData .= trim($data); + } +} + + +/** + * XML Tag Object (php5) + * + * This object stores all of the direct children of itself in the $children array. They are also stored by + * type as arrays. So, if, for example, this tag had 2 tags as children, there would be a class member + * called $font created as an array. $font[0] would be the first font tag, and $font[1] would be the second. + * + * To loop through all of the direct children of this object, the $children member should be used. + * + * To loop through all of the direct children of a specific tag for this object, it is probably easier + * to use the arrays of the specific tag names, as explained above. + * + * @author Adam A. Flynn + * @copyright Copyright (c) 2005-2007, Adam A. Flynn + * + * @version 1.3.0 + */ +class XMLTag +{ + /** + * Array with the attributes of this XML tag + * + * @var array + */ + public $tagAttrs; + + /** + * The name of the tag + * + * @var string + */ + public $tagName; + + /** + * The data the tag contains + * + * So, if the tag doesn't contain child tags, and just contains a string, it would go here + * + * @var stat + */ + public $tagData; + + /** + * Array of references to the objects of all direct children of this XML object + * + * @var array + */ + public $tagChildren; + + /** + * The number of parents this XML object has (number of levels from this tag to the root tag) + * + * Used presently only to set the number of tabs when outputting XML + * + * @var int + */ + public $tagParents; + + /** + * Constructor, sets up all the default values + * + * @param string $name + * @param array $attrs + * @param int $parents + * @return XMLTag + */ + function __construct($name, $attrs = array(), $parents = 0) + { + //Make the keys of the attr array lower case, and store the value + $this->tagAttrs = array_change_key_case($attrs, CASE_LOWER); + + //Make the name lower case and store the value + $this->tagName = strtolower($name); + + //Set the number of parents + $this->tagParents = $parents; + + //Set the types for children and data + $this->tagChildren = array(); + $this->tagData = ''; + } + + /** + * Adds a direct child to this object + * + * @param string $name + * @param array $attrs + * @param int $parents + * @param bool $cleanTagName + */ + public function AddChild($name, $attrs, $parents, $cleanTagName = true) + { + //If the tag is a reserved name, output an error + if(in_array($name, array('tagChildren', 'tagAttrs', 'tagParents', 'tagData', 'tagName'))) + { + trigger_error('You have used a reserved name as the name of an XML tag. Please consult the documentation (http://www.criticaldevelopment.net/xml/) and rename the tag named "'.$name.'" to something other than a reserved name.', E_USER_ERROR); + + return; + } + + //Create the child object itself + $child = new XMLTag($name, $attrs, $parents); + + //If the cleanTagName feature is on, replace colons and dashes with underscores + if($cleanTagName) + $name = str_replace(array(':', '-'), '_', $name); + + //Toss up a notice if someone's trying to to use a colon or dash in a tag name + elseif(strstr($name, ':') || strstr($name, '-')) + trigger_error('Your tag named "'.$name.'" contains either a dash or a colon. Neither of these characters are friendly with PHP variable names, and, as such, you may have difficulty accessing them. You might want to think about enabling the cleanTagName feature (pass true as the second argument of the XMLParser constructor). For more details, see http://www.criticaldevelopment.net/xml/', E_USER_NOTICE); + + //If there is no array already set for the tag name being added, + //create an empty array for it + if(!isset($this->$name)) + $this->$name = array(); + + //Add the reference of it to the end of an array member named for the tag's name + $this->{$name}[] = &$child; + + //Add the reference to the children array member + $this->tagChildren[] = &$child; + + //Return a reference to this object for the stack + return $this; + } + + /** + * Returns the string of the XML document which would be generated from this object + * + * This function works recursively, so it gets the XML of itself and all of its children, which + * in turn gets the XML of all their children, which in turn gets the XML of all thier children, + * and so on. So, if you call GetXML from the document root object, it will return a string for + * the XML of the entire document. + * + * This function does not, however, return a DTD or an XML version/encoding tag. That should be + * handled by XMLParser::GetXML() + * + * @return string + */ + public function GetXML() + { + //Start a new line, indent by the number indicated in $this->parents, add a <, and add the name of the tag + $out = "\n".str_repeat("\t", $this->tagParents).'<'.$this->tagName; + + //For each attribute, add attr="value" + foreach($this->tagAttrs as $attr => $value) + $out .= ' '.$attr.'="'.$value.'"'; + + //If there are no children and it contains no data, end it off with a /> + if(empty($this->tagChildren) && empty($this->tagData)) + $out .= " />"; + + //Otherwise... + else + { + //If there are children + if(!empty($this->tagChildren)) + { + //Close off the start tag + $out .= '>'; + + //For each child, call the GetXML function (this will ensure that all children are added recursively) + foreach($this->tagChildren as $child) + $out .= $child->GetXML(); + + //Add the newline and indentation to go along with the close tag + $out .= "\n".str_repeat("\t", $this->tagParents); + } + + //If there is data, close off the start tag and add the data + elseif(!empty($this->tagData)) + $out .= '>'.$this->tagData; + + //Add the end tag + $out .= 'tagName.'>'; + } + + //Return the final output + return $out; + } + + /** + * Deletes this tag's child with a name of $childName and an index + * of $childIndex + * + * @param string $childName + * @param int $childIndex + */ + public function Delete($childName, $childIndex = 0) + { + //Delete all of the children of that child + $this->{$childName}[$childIndex]->DeleteChildren(); + + //Destroy the child's value + $this->{$childName}[$childIndex] = null; + + //Remove the child's name from the named array + unset($this->{$childName}[$childIndex]); + + //Loop through the tagChildren array and remove any null + //values left behind from the above operation + for($x = 0; $x < count($this->tagChildren); $x ++) + { + if(is_null($this->tagChildren[$x])) + unset($this->tagChildren[$x]); + } + } + + /** + * Removes all of the children of this tag in both name and value + */ + private function DeleteChildren() + { + //Loop through all child tags + for($x = 0; $x < count($this->tagChildren); $x ++) + { + //Do this recursively + $this->tagChildren[$x]->DeleteChildren(); + + //Delete the name and value + $this->tagChildren[$x] = null; + unset($this->tagChildren[$x]); + } + } +} +?> \ No newline at end of file diff -r 670229c4eb4b -r 3f6b44aa6b35 feedback.html --- a/feedback.html Fri Feb 19 11:14:52 2010 -0500 +++ b/feedback.html Mon Feb 22 08:02:39 2010 -0500 @@ -18,14 +18,14 @@ @@ -58,14 +58,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 firetest.css --- a/firetest.css Fri Feb 19 11:14:52 2010 -0500 +++ b/firetest.css Mon Feb 22 08:02:39 2010 -0500 @@ -247,4 +247,4 @@ } - \ No newline at end of file + diff -r 670229c4eb4b -r 3f6b44aa6b35 gallery1.html --- a/gallery1.html Fri Feb 19 11:14:52 2010 -0500 +++ b/gallery1.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,14 +13,14 @@ @@ -84,14 +84,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 gallery10.html --- a/gallery10.html Fri Feb 19 11:14:52 2010 -0500 +++ b/gallery10.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,14 +13,14 @@ @@ -80,14 +80,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 gallery11.html --- a/gallery11.html Fri Feb 19 11:14:52 2010 -0500 +++ b/gallery11.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,14 +13,14 @@ @@ -80,14 +80,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 gallery12.html --- a/gallery12.html Fri Feb 19 11:14:52 2010 -0500 +++ b/gallery12.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,14 +13,14 @@ @@ -80,14 +80,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 gallery13.html --- a/gallery13.html Fri Feb 19 11:14:52 2010 -0500 +++ b/gallery13.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,14 +13,14 @@ @@ -80,14 +80,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 gallery14.html --- a/gallery14.html Fri Feb 19 11:14:52 2010 -0500 +++ b/gallery14.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,14 +13,14 @@ @@ -80,14 +80,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 gallery15.html --- a/gallery15.html Fri Feb 19 11:14:52 2010 -0500 +++ b/gallery15.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,14 +13,14 @@ @@ -80,14 +80,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 gallery16.html --- a/gallery16.html Fri Feb 19 11:14:52 2010 -0500 +++ b/gallery16.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,14 +13,14 @@ @@ -80,14 +80,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 gallery17.html --- a/gallery17.html Fri Feb 19 11:14:52 2010 -0500 +++ b/gallery17.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,14 +13,14 @@ @@ -80,14 +80,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 gallery18.html --- a/gallery18.html Fri Feb 19 11:14:52 2010 -0500 +++ b/gallery18.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,14 +13,14 @@ @@ -80,14 +80,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 gallery19.html --- a/gallery19.html Fri Feb 19 11:14:52 2010 -0500 +++ b/gallery19.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,14 +13,14 @@ @@ -80,14 +80,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 gallery2.html --- a/gallery2.html Fri Feb 19 11:14:52 2010 -0500 +++ b/gallery2.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,14 +13,14 @@ @@ -80,14 +80,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 gallery20.html --- a/gallery20.html Fri Feb 19 11:14:52 2010 -0500 +++ b/gallery20.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,14 +13,14 @@ @@ -80,14 +80,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 gallery21.html --- a/gallery21.html Fri Feb 19 11:14:52 2010 -0500 +++ b/gallery21.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,14 +13,14 @@ @@ -80,14 +80,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 gallery3.html --- a/gallery3.html Fri Feb 19 11:14:52 2010 -0500 +++ b/gallery3.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,14 +13,14 @@ @@ -80,14 +80,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 gallery4.html --- a/gallery4.html Fri Feb 19 11:14:52 2010 -0500 +++ b/gallery4.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,14 +13,14 @@ @@ -80,14 +80,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 gallery5.html --- a/gallery5.html Fri Feb 19 11:14:52 2010 -0500 +++ b/gallery5.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,14 +13,14 @@ @@ -80,14 +80,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 gallery6.html --- a/gallery6.html Fri Feb 19 11:14:52 2010 -0500 +++ b/gallery6.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,14 +13,14 @@ @@ -80,14 +80,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 gallery7.html --- a/gallery7.html Fri Feb 19 11:14:52 2010 -0500 +++ b/gallery7.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,14 +13,14 @@ @@ -80,14 +80,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 gallery8.html --- a/gallery8.html Fri Feb 19 11:14:52 2010 -0500 +++ b/gallery8.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,14 +13,14 @@ @@ -80,14 +80,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 gallery9.html --- a/gallery9.html Fri Feb 19 11:14:52 2010 -0500 +++ b/gallery9.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,14 +13,14 @@ @@ -80,14 +80,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 hto.html --- a/hto.html Fri Feb 19 11:14:52 2010 -0500 +++ b/hto.html Mon Feb 22 08:02:39 2010 -0500 @@ -17,14 +17,14 @@ @@ -69,14 +69,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 index.html --- a/index.html Fri Feb 19 11:14:52 2010 -0500 +++ b/index.html Mon Feb 22 08:02:39 2010 -0500 @@ -21,14 +21,14 @@ @@ -59,14 +59,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 judyYates.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/judyYates.xml Mon Feb 22 08:02:39 2010 -0500 @@ -0,0 +1,66 @@ + + + + + Judy Yates Prints + Prints Directly From the Artist. + /e2gallerypro/e2upload/Galleries/prints/ + /e2gallerypro/e2upload/Galleries/prints/large/ + /e2gallerypro/e2upload/Galleries/prints/thumbs/ + /e2gallerypro/e2upload/Galleries/prints/ + mainthumb.jpg + + Buffalo Verde + Judy Yates + Copyright Judy Yates Artist + Buffalo Verde + + Judy_Yates_Buffalo_Verde.jpg + + + + 265 + + + + Longhorn Sunset + Judy Yates + Copyright Judy Yates Artist + Longhorn Sunset + + Judy_Yates_Longhorn_Sunset.jpg + + + + 265 + + + + Turquoise Sky + Judy Yates + Copyright Judy Yates Artist + Winner of the Mass. Primitive Arms Stamp Contest + + Judy_Yates_Turquoise_Sky.jpg + + + +265 + + + + Wood Duck Pair + Judy Yates + Copyright Judy Yates Artist + Wood Duck Pair + + Judy_Yates_Wood_Duck_Pair.jpg + + + +265 + + + 4 + + diff -r 670229c4eb4b -r 3f6b44aa6b35 log/error_log.log --- a/log/error_log.log Fri Feb 19 11:14:52 2010 -0500 +++ b/log/error_log.log Mon Feb 22 08:02:39 2010 -0500 @@ -2,3 +2,390 @@ [Fri Feb 19 06:03:30 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/favicon.ico [Fri Feb 19 10:02:21 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/favicon.ico [Fri Feb 19 10:02:24 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/favicon.ico +[Sat Feb 20 10:07:57 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/favicon.ico +[Sat Feb 20 10:18:00 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/favicon.ico +[Sat Feb 20 10:50:55 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/favicon.ico +[Sat Feb 20 10:51:08 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Sat Feb 20 10:51:08 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Sat Feb 20 10:51:08 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Sat Feb 20 10:51:08 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Sat Feb 20 10:51:39 2010] [crit] [client 18.238.1.90] (13)Permission denied: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable +[Sat Feb 20 10:51:46 2010] [crit] [client 18.238.1.90] (13)Permission denied: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable +[Sat Feb 20 10:53:27 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Sat Feb 20 10:53:27 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Sat Feb 20 10:53:27 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Sat Feb 20 10:53:27 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Sat Feb 20 10:53:43 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/rsrc, referer: http://judyates.rlmcintyre.com/e2gallerypro/e2upload/ +[Sat Feb 20 10:57:05 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Sat Feb 20 10:57:05 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Sat Feb 20 10:57:05 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Sat Feb 20 10:57:05 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Sat Feb 20 10:58:01 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Sat Feb 20 10:58:01 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Sat Feb 20 10:58:01 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Sat Feb 20 10:58:02 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Sat Feb 20 10:58:07 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/favicon.ico +[Sat Feb 20 10:58:09 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/favicon.ico +[Mon Feb 22 05:24:11 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 05:24:11 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 05:24:11 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 05:24:11 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 05:24:11 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/favicon.ico +[Mon Feb 22 05:24:14 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/favicon.ico +[Mon Feb 22 05:24:49 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 05:24:49 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 05:24:49 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 05:24:49 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 05:24:53 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 05:24:53 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 05:24:53 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 05:24:53 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 05:28:04 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/rsrc, referer: http://judyates.rlmcintyre.com/e2gallerypro/e2upload/ +[Mon Feb 22 05:28:12 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 05:28:12 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 05:28:12 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 05:28:12 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 05:47:58 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 05:47:58 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 05:47:58 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 05:47:58 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:02:56 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/favicon.ico +[Mon Feb 22 06:02:59 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/favicon.ico +[Mon Feb 22 06:05:16 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:05:16 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:05:16 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:05:16 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:06:29 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Assets/Icons/xml.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/e2upload/ +[Mon Feb 22 06:06:29 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/none, referer: http://judyates.rlmcintyre.com/e2gallerypro/e2upload/ +[Mon Feb 22 06:06:50 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:06:50 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:06:50 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:06:50 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:07:26 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:07:26 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:07:26 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:07:26 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:15:14 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:15:14 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:15:14 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:15:14 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:16:20 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:16:20 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:16:20 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:16:20 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:19:25 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Assets/Icons/xml.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/e2upload/outputxml.php?gallerytitle=Judy+Yates+Prints&galleryDescription=Special+Prints+Available+Direct+From+the+Artist.&gallerypath=Galleries%2FPrints%2F&thumbpath=Galleries%2FPrints%2Fthumbs%2F&largepath=Galleries%2FPrints%2Flarge%2F&showforsale=true&checkouttype=paypal¤cy=USD&submit=Output+XML +[Mon Feb 22 06:19:25 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/none, referer: http://judyates.rlmcintyre.com/e2gallerypro/e2upload/outputxml.php?gallerytitle=Judy+Yates+Prints&galleryDescription=Special+Prints+Available+Direct+From+the+Artist.&gallerypath=Galleries%2FPrints%2F&thumbpath=Galleries%2FPrints%2Fthumbs%2F&largepath=Galleries%2FPrints%2Flarge%2F&showforsale=true&checkouttype=paypal¤cy=USD&submit=Output+XML +[Mon Feb 22 06:19:38 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:19:38 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:19:38 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:19:38 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:22:45 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:22:45 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:22:45 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:22:45 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:25:09 2010] [crit] [client 18.238.1.90] (13)Permission denied: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable +[Mon Feb 22 06:26:29 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/none, referer: http://judyates.rlmcintyre.com/e2gallerypro/e2upload/ +[Mon Feb 22 06:29:30 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/none, referer: http://judyates.rlmcintyre.com/e2gallerypro/e2upload/ +[Mon Feb 22 06:36:29 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Assets/Icons/xml.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/e2upload/outputxml.php?gallerytitle=Judy+Yates+Prints&galleryDescription=Prints+Directly+From+the+Artist.&gallerypath=Galleries%2Fprints%2F&thumbpath=Galleries%2Fprints%2Fthumbs%2F&largepath=Galleries%2Fprints%2Flarge%2F&showforsale=true&checkouttype=paypal¤cy=USD&submit=Output+XML +[Mon Feb 22 06:36:29 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/none, referer: http://judyates.rlmcintyre.com/e2gallerypro/e2upload/outputxml.php?gallerytitle=Judy+Yates+Prints&galleryDescription=Prints+Directly+From+the+Artist.&gallerypath=Galleries%2Fprints%2F&thumbpath=Galleries%2Fprints%2Fthumbs%2F&largepath=Galleries%2Fprints%2Flarge%2F&showforsale=true&checkouttype=paypal¤cy=USD&submit=Output+XML +[Mon Feb 22 06:36:42 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:36:42 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:36:42 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:36:42 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:36:54 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:36:54 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:36:54 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:36:54 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:39:38 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:39:38 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:39:38 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:39:38 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:39:38 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/e2gallerypro/ +[Mon Feb 22 06:46:21 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/e2gallerypro/e2upload/ +[Mon Feb 22 06:48:13 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:48:13 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/js, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:48:13 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/js, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:48:13 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/js, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:48:13 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/js, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:48:13 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/js, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:48:14 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/js, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:48:14 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/js, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:48:14 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/js, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:48:14 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:48:14 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:48:14 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:48:14 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:48:14 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:49:30 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/js, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:49:30 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/js, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:49:30 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/js, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:49:30 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/js, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:49:30 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/js, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:49:30 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/js, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:49:30 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/js, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:49:30 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/js, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:49:30 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:49:30 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:49:30 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:49:30 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:49:30 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:49:30 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:49:30 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:49:30 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:49:30 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:50:45 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:50:45 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:50:45 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:50:45 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:50:45 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:50:45 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:50:45 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:51:42 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:51:42 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:51:42 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:51:42 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:51:42 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:51:42 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:51:42 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:52:37 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:52:37 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:52:37 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:52:37 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:52:37 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:52:37 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:52:37 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:59:03 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:59:03 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 06:59:03 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:59:03 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:59:03 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:59:03 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 06:59:03 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:00:06 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:00:06 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:00:06 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:00:06 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:00:06 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:00:06 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:00:06 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:00:24 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallery +[Mon Feb 22 07:00:30 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:00:30 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:00:30 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:00:30 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:00:30 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/e2gallerypro/ +[Mon Feb 22 07:07:00 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:07:00 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:07:00 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:07:00 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:07:00 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:07:00 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:07:00 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:08:17 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:08:17 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:08:17 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:08:17 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:08:17 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:08:17 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:08:17 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:09:37 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:09:37 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:09:37 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:09:37 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:09:37 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:09:37 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:09:37 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:10:06 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:10:06 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:10:06 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:10:06 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:10:06 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:10:06 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:10:06 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:16:25 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:16:25 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:16:25 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:16:25 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:16:25 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/e2gallerypro/ +[Mon Feb 22 07:22:19 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/rsrc, referer: http://judyates.rlmcintyre.com/e2gallerypro/e2upload/outputxml.php +[Mon Feb 22 07:23:11 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Assets/Icons/xml.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/e2upload/outputxml.php +[Mon Feb 22 07:23:11 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/none, referer: http://judyates.rlmcintyre.com/e2gallerypro/e2upload/outputxml.php +[Mon Feb 22 07:23:21 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:23:21 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:23:21 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:23:21 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:23:21 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/e2gallerypro/ +[Mon Feb 22 07:23:48 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:23:48 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:23:48 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:23:48 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:23:48 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:23:48 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:23:48 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:27:42 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Assets/Icons/xml.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/e2upload/outputxml.php +[Mon Feb 22 07:27:42 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/none, referer: http://judyates.rlmcintyre.com/e2gallerypro/e2upload/outputxml.php +[Mon Feb 22 07:27:53 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:27:53 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:27:53 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:27:53 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:27:53 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/e2gallerypro/ +[Mon Feb 22 07:28:24 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:28:24 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:28:24 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:28:24 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:28:24 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/e2gallerypro/ +[Mon Feb 22 07:28:40 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:28:40 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:28:40 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:28:40 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:28:40 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/e2gallerypro/ +[Mon Feb 22 07:29:13 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:29:13 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:29:13 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:29:13 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:29:13 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/e2gallerypro/ +[Mon Feb 22 07:31:29 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:31:29 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:31:29 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:31:29 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:31:29 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/e2gallerypro/ +[Mon Feb 22 07:34:27 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/none, referer: http://judyates.rlmcintyre.com/e2gallerypro/e2upload/outputxml.php +[Mon Feb 22 07:34:51 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:34:51 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:34:51 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:34:51 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:34:51 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/e2gallerypro/ +[Mon Feb 22 07:36:24 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:36:24 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:36:24 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:36:24 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:36:24 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/e2gallerypro/ +[Mon Feb 22 07:37:42 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/none, referer: http://judyates.rlmcintyre.com/e2gallerypro/e2upload/outputxml.php +[Mon Feb 22 07:37:51 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:37:51 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:37:51 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:37:51 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:37:51 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/e2gallerypro/ +[Mon Feb 22 07:39:44 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:39:44 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:39:44 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:39:44 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:39:44 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:39:44 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:39:44 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:39:44 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:39:44 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:39:44 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:41:14 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:41:14 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:41:14 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:41:14 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:41:14 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:41:14 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:41:14 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:41:14 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:41:38 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:41:38 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:41:38 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:41:38 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:41:38 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:41:38 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:41:38 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:42:18 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:42:18 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:42:18 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:42:18 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:42:18 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:42:18 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:42:18 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:42:44 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:42:44 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:42:44 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:42:44 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:42:44 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:42:44 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:42:44 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:42:55 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:42:55 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:42:55 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:42:55 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:42:55 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:42:55 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:42:55 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:43:07 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:43:07 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:43:07 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:43:07 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:43:07 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:43:07 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:43:07 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:45:06 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:45:06 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:45:06 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:45:06 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:45:06 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:45:06 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:45:06 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:45:30 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:45:30 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:45:30 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:45:30 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:45:30 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:45:30 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:45:30 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:46:43 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:46:43 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:46:43 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:46:43 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:46:43 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:46:43 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:46:43 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:47:34 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:47:34 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:47:34 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:47:34 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:47:34 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:47:34 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:47:34 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:50:08 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:50:08 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:50:08 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:50:08 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:50:08 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:50:08 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:50:08 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:58:41 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:58:41 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:58:41 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:58:41 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:58:41 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:58:41 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:58:41 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:59:10 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:59:10 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:59:10 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:59:10 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:59:10 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:59:10 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:59:10 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:59:22 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:59:22 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:59:22 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:59:22 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:59:22 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:59:22 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:59:22 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:59:37 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:59:37 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 07:59:37 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:59:37 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:59:37 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:59:37 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 07:59:37 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 08:00:50 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 08:00:50 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/design, referer: http://judyates.rlmcintyre.com/recent_sales.html +[Mon Feb 22 08:00:50 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/left_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 08:00:50 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/right_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 08:00:50 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/controls_bg.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 08:00:50 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/design/e2simple/pop_arrow.png, referer: http://judyates.rlmcintyre.com/e2gallerypro/design/e2simple/design.css +[Mon Feb 22 08:00:50 2010] [error] [client 18.238.1.90] File does not exist: /home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/prints/mainthumb.jpg, referer: http://judyates.rlmcintyre.com/recent_sales.html diff -r 670229c4eb4b -r 3f6b44aa6b35 menu.html --- a/menu.html Fri Feb 19 11:14:52 2010 -0500 +++ b/menu.html Mon Feb 22 08:02:39 2010 -0500 @@ -3,14 +3,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 menu2.html --- a/menu2.html Fri Feb 19 11:14:52 2010 -0500 +++ b/menu2.html Mon Feb 22 08:02:39 2010 -0500 @@ -3,13 +3,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 perl/meet_the_artist.pl --- a/perl/meet_the_artist.pl Fri Feb 19 11:14:52 2010 -0500 +++ b/perl/meet_the_artist.pl Mon Feb 22 08:02:39 2010 -0500 @@ -150,4 +150,4 @@ THERE -} \ No newline at end of file +} diff -r 670229c4eb4b -r 3f6b44aa6b35 perl/menu.pl --- a/perl/menu.pl Fri Feb 19 11:14:52 2010 -0500 +++ b/perl/menu.pl Mon Feb 22 08:02:39 2010 -0500 @@ -6,14 +6,14 @@ @@ -28,13 +28,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 pets1.html --- a/pets1.html Fri Feb 19 11:14:52 2010 -0500 +++ b/pets1.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,14 +13,14 @@ @@ -59,14 +59,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 pets2.html --- a/pets2.html Fri Feb 19 11:14:52 2010 -0500 +++ b/pets2.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,14 +13,14 @@ @@ -93,14 +93,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 pets3.html --- a/pets3.html Fri Feb 19 11:14:52 2010 -0500 +++ b/pets3.html Mon Feb 22 08:02:39 2010 -0500 @@ -13,14 +13,14 @@ @@ -53,14 +53,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 pricing.html --- a/pricing.html Fri Feb 19 11:14:52 2010 -0500 +++ b/pricing.html Mon Feb 22 08:02:39 2010 -0500 @@ -15,14 +15,14 @@ @@ -46,14 +46,14 @@ diff -r 670229c4eb4b -r 3f6b44aa6b35 prints/large/Judy_Yates_Buffalo_Verde.jpg Binary file prints/large/Judy_Yates_Buffalo_Verde.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 prints/large/Judy_Yates_Longhorn_Sunset.jpg Binary file prints/large/Judy_Yates_Longhorn_Sunset.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 prints/large/Judy_Yates_Turquoise_Sky.jpg Binary file prints/large/Judy_Yates_Turquoise_Sky.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 prints/large/Judy_Yates_Wood_Duck_Pair.jpg Binary file prints/large/Judy_Yates_Wood_Duck_Pair.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 prints/normal/Judy_Yates_Buffalo_Verde.jpg Binary file prints/normal/Judy_Yates_Buffalo_Verde.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 prints/normal/Judy_Yates_Longhorn_Sunset.jpg Binary file prints/normal/Judy_Yates_Longhorn_Sunset.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 prints/normal/Judy_Yates_Turquoise_Sky.jpg Binary file prints/normal/Judy_Yates_Turquoise_Sky.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 prints/normal/Judy_Yates_Wood_Duck_Pair.jpg Binary file prints/normal/Judy_Yates_Wood_Duck_Pair.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 prints/source/Judy_Yates_Bufallo_Mesa.jpg Binary file prints/source/Judy_Yates_Bufallo_Mesa.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 prints/source/Judy_Yates_Buffalo_Verde.jpg Binary file prints/source/Judy_Yates_Buffalo_Verde.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 prints/source/Judy_Yates_Duck_Stamp.jpg Binary file prints/source/Judy_Yates_Duck_Stamp.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 prints/source/Judy_Yates_Longhorn_Sunset.jpg Binary file prints/source/Judy_Yates_Longhorn_Sunset.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 prints/source/Judy_Yates_Longhorn_Sunset_Scale.jpg Binary file prints/source/Judy_Yates_Longhorn_Sunset_Scale.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 prints/source/Judy_Yates_Mass_Deer_Stamp.jpg Binary file prints/source/Judy_Yates_Mass_Deer_Stamp.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 prints/source/Judy_Yates_Turquoise_Sky.jpg Binary file prints/source/Judy_Yates_Turquoise_Sky.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 prints/source/Judy_Yates_Wood_Duck_Pair.jpg Binary file prints/source/Judy_Yates_Wood_Duck_Pair.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 prints/thumbs/Judy_Yates_Buffalo_Verde.jpg Binary file prints/thumbs/Judy_Yates_Buffalo_Verde.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 prints/thumbs/Judy_Yates_Longhorn_Sunset.jpg Binary file prints/thumbs/Judy_Yates_Longhorn_Sunset.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 prints/thumbs/Judy_Yates_Turquoise_Sky.jpg Binary file prints/thumbs/Judy_Yates_Turquoise_Sky.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 prints/thumbs/Judy_Yates_Wood_Duck_Pair.jpg Binary file prints/thumbs/Judy_Yates_Wood_Duck_Pair.jpg has changed diff -r 670229c4eb4b -r 3f6b44aa6b35 recent_sales.html --- a/recent_sales.html Fri Feb 19 11:14:52 2010 -0500 +++ b/recent_sales.html Mon Feb 22 08:02:39 2010 -0500 @@ -1,9 +1,53 @@ + + + + + + Judy Yates - Prints + + + + + + + + + + + + + + + - - - + + + + + @@ -21,43 +65,96 @@ -
    -

    - - - - - -Judy Yates has prepared this custom order of a Texas Longhorn as the first painting for 2009! What will she paint for you?                                                                                                                                                                             - - - -

    -
    +
    + + + + + +
    + +
    + + + + + +