-
Posts
24,566 -
Joined
-
Last visited
-
Days Won
822
Everything posted by Barand
-
Why does my code automatically think the textbox is empty?
Barand replied to Skittle's topic in PHP Coding Help
elseif (is_numeric($minPrice)) probably needs to be elseif (!is_numeric($minPrice)) // error if NOT numeric -
Then it sounds like your rotation function is the same as you posted earlier - yes? $filename = '/images/myphoto.jpg'; $exif = exif_read_data($filesname); echo '<pre>BEFORE: ' . print_r($exif, 1) . '</pre>'; correctImageOrientation($filename); $exif = exif_read_data($filesname); echo '<pre>AFTER: ' . print_r($exif, 1) . '</pre>';
-
You start with FileA. You rotate it and store it in FileB. If you now output the exif data for FileA then of course it's the same. You need to get the exif from FileB to see changes (but there won't be much exif data there)
-
, COALESCE(oc.recipient_address_line_1, mailAddr.Address_Line_1) as RecipientAddress1 etc instead of the two address_Line_1 columns. Do same for each address column.
-
If the exif data is the same you must be getting it from the same file. Try getting the exif data from the rotated file.
-
Why does my code automatically think the textbox is empty?
Barand replied to Skittle's topic in PHP Coding Help
@cyberRobot seems keen on this topic, so I'll leave you in his capable hands. -
Why does my code automatically think the textbox is empty?
Barand replied to Skittle's topic in PHP Coding Help
One way is to edit the code, changing $_GET['city'] to $_POST['city']. -
Why does my code automatically think the textbox is empty?
Barand replied to Skittle's topic in PHP Coding Help
Note, from that output, there is no $_GET['city']. This isn't surprising as you form's method is POST. Try checking for $_POST['city'] instead. -
Why does my code automatically think the textbox is empty?
Barand replied to Skittle's topic in PHP Coding Help
It might be an idea to check what your script is receiving in the GET and POST array. At top of the script, put echo '<pre>GET = ', print_r($_GET, 1), '</pre>'; echo '<pre>POST = ', print_r($_POST, 1), '</pre>'; -
Why does my code automatically think the textbox is empty?
Barand replied to Skittle's topic in PHP Coding Help
First thing to do then is fix those errors. -
Why does my code automatically think the textbox is empty?
Barand replied to Skittle's topic in PHP Coding Help
If you put those 2 lines back in, what error messages do get? -
Why does my code automatically think the textbox is empty?
Barand replied to Skittle's topic in PHP Coding Help
If you are having problems why have you commented out the two lines at the top that might tell you why you are having those problems? -
How to return an entire array from a PHP Function?
Barand replied to SaranacLake's topic in PHP Coding Help
You need to assign the value returned by your function to a variable. $photoFiles = getPhotoFilesArray($photoPath); var_dump($photoFiles); I suggest you read up on how to use functions variable scope -
Not necessarily TABLE customer TABLE customer_order +--------------+ +------------------+ | customer_id | | order_no | | cust_name | | order_date | | address | | customer_id | +--------------+ | deliver_to | +------------------+ SELECT cust_name , order_no , order_date , COALESCE(deliver_to, address) as deliver_to FROM customer_order o JOIN customer c USING (customer_id)
-
TABLE addya TABLE addyb +----+-----------+-----------+ +----+-----------+-----------+ | id | address1 | address2 | | id | address1 | address2 | +----+-----------+-----------+ +----+-----------+-----------+ | 1 | add A 1 1 | add A 1 2 | | 1 | add B 1 1 | add B 1 2 | | 2 | add A 2 1 | add A 2 2 | | 2 | NULL | NULL | | 3 | NULL | NULL | | 3 | add B 3 1 | add B 3 2 | +----+-----------+-----------+ +----+-----------+-----------+ SELECT id , COALESCE(a.address1, b.address1) as add1 , COALESCE(a.address2, b.address2) as add2 FROM addya a JOIN addyb b USING(id); +----+-----------+-----------+ | id | add1 | add2 | +----+-----------+-----------+ | 1 | add A 1 1 | add A 1 2 | | 2 | add A 2 1 | add A 2 2 | | 3 | add B 3 1 | add B 3 2 | +----+-----------+-----------+
-
Use the COALESCE() function
-
Yes, or do them both in the same operation. Not in the image. If you store the original image then you can still get it any time you want it.. You would have to amend your rotation function as it currently overwrites the input file.
-
When you resize, or rotate, you are creating a new copied image using the GD library. This copy loses the exif data that the original contains.
-
Then you destroyed the exif info.
-
From your "BEFORE" exif data (above) it was created by GD library in PHP. Uploading should just copy the file. Are you doing any PHP processing on the file after uploading, such as resizing? My image was copied from my camera to my PC.
-
I don't see any "orientation" index in your exif data. My "BEFORE" exif data looks like this (as you can see, orientation = 8)... Array ( [FileName] => DSCN0035.JPG [FileDateTime] => 1528993833 [FileSize] => 4044525 [FileType] => 2 [MimeType] => image/jpeg [SectionsFound] => ANY_TAG, IFD0, THUMBNAIL, EXIF, GPS, INTEROP, MAKERNOTE [COMPUTED] => Array ( [html] => width="4896" height="3672" [Height] => 3672 [Width] => 4896 [IsColor] => 1 [ByteOrderMotorola] => 0 [ApertureFNumber] => f/5.8 [UserComment] => [UserCommentEncoding] => UNDEFINED [Thumbnail.FileType] => 2 [Thumbnail.MimeType] => image/jpeg ) [ImageDescription] => [Make] => NIKON [Model] => COOLPIX P520 [Orientation] => 8 <<*************** ORIENTATION ************** [XResolution] => 300/1 [YResolution] => 300/1 [ResolutionUnit] => 2 [Software] => COOLPIX P520 V1.0 [DateTime] => 2014:06:30 13:33:43 [YCbCrPositioning] => 2 [Exif_IFD_Pointer] => 314 [GPS_IFD_Pointer] => 1002 [THUMBNAIL] => Array ( [Compression] => 6 [XResolution] => 300/1 [YResolution] => 300/1 [ResolutionUnit] => 2 [JPEGInterchangeFormat] => 4032 [JPEGInterchangeFormatLength] => 4658 ) [ExposureTime] => 10/6400 [FNumber] => 58/10 [ExposureProgram] => 3 [ISOSpeedRatings] => 80 [UndefinedTag:0x8830] => 1 [ExifVersion] => 0230 [DateTimeOriginal] => 2014:06:30 13:33:43 [DateTimeDigitized] => 2014:06:30 13:33:43 [ComponentsConfiguration] => [CompressedBitsPerPixel] => 2/1 [ExposureBiasValue] => 0/10 [MaxApertureValue] => 32/10 [MeteringMode] => 5 [LightSource] => 0 [Flash] => 16 [FocalLength] => 356/10 [MakerNote] => Nikon [UserComment] => [FlashPixVersion] => 0100 [ColorSpace] => 1 [ExifImageWidth] => 4896 [ExifImageLength] => 3672 [InteroperabilityOffset] => 1114 [FileSource] => [SceneType] => [CustomRendered] => 0 [ExposureMode] => 0 [WhiteBalance] => 0 [DigitalZoomRatio] => 0/100 [FocalLengthIn35mmFilm] => 200 [SceneCaptureType] => 0 [GainControl] => 0 [Contrast] => 0 [Saturation] => 0 [Sharpness] => 0 [SubjectDistanceRange] => 0 [GPSVersion] => [InterOperabilityIndex] => R98 [InterOperabilityVersion] => 0100 ) As for your question about print_r(), see the manual
-
For the function to create a new file, the original image must have an orientation value and that value must be something other than 1. If it is 3, 6, or 8 it is rotated.
-
I'll have to pass on that. Did the output of your original's exif data contain the "Orientation" value? In my test, the original had an orientation = 8. Here's the before and after <img src="images/DSCN0035.JPG" width="500" > <img src="images/RDSCN0035.JPG" height="500" > <!-- rotated version --> Results