https://imagemagick.org/discourse-server/viewforum.php?f=3).
* Fixed a number of issues (reference
https://github.com/ImageMagick/ImageMagick/issues).
+ * Honor SOURCE_DATE_EPOCH environment variable (reference
+ https://github.com/ImageMagick/ImageMagick/pull/1496/).
2019-04-07 7.0.8-39 Cristy <quetzlzacatenango@image...>
* Release ImageMagick version 7.0.8-39, GIT revision 15489:6120f8bc1:20190406
/*
Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
-
+
You may not use this file except in compliance with the License. You may
obtain a copy of the License at
-
+
https://imagemagick.org/script/license.php
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
extern "C" {
#endif
+static inline void GetUTCTime(const time_t *timep,struct tm *result)
+{
+#if defined(MAGICKCORE_HAVE_GMTIME_R)
+ (void) gmtime_r(timep,result);
+#else
+ {
+ struct tm
+ *my_time;
+
+ my_time=gmtime(timep);
+ if (my_time != (struct tm *) NULL)
+ (void) memcpy(result,my_time,sizeof(gm_time));
+ }
+#endif
+}
+
+static inline void GetLocalTime(const time_t *timep,struct tm *result)
+{
+#if defined(MAGICKCORE_HAVE_GMTIME_R)
+ (void) localtime_r(timep,result);
+#else
+ {
+ struct tm
+ *my_time;
+
+ my_time=localtime(timep);
+ if (my_time != (struct tm *) NULL)
+ (void) memcpy(result,my_time,sizeof(gm_time));
+ }
+#endif
+}
+
extern MagickPrivate time_t
GetMagickTime(void);
count;
struct tm
- gm_time,
- local_time;
+ gm_time;
assert(timestamp != (char *) NULL);
- (void) memset(&local_time,0,sizeof(local_time));
- (void) memset(&gm_time,0,sizeof(gm_time));
-#if defined(MAGICKCORE_HAVE_LOCALTIME_R)
- (void) localtime_r(&time,&local_time);
-#else
- {
- struct tm
- *my_time;
-
- my_time=localtime(&time);
- if (my_time != (struct tm *) NULL)
- (void) memcpy(&local_time,my_time,sizeof(local_time));
- }
-#endif
-#if defined(MAGICKCORE_HAVE_GMTIME_R)
- (void) gmtime_r(&time,&gm_time);
-#else
- {
- struct tm
- *my_time;
-
- my_time=gmtime(&time);
- if (my_time != (struct tm *) NULL)
- (void) memcpy(&gm_time,my_time,sizeof(gm_time));
- }
-#endif
+ GetUTCTime(&time,&gm_time);
count=FormatLocaleString(timestamp,length,
"%04d-%02d-%02dT%02d:%02d:%02d%+03d:00",gm_time.tm_year+1900,
gm_time.tm_mon+1,gm_time.tm_mday,gm_time.tm_hour,gm_time.tm_min,
offset+=WriteBlob(image,sizeof(cin.file.filename),(unsigned char *)
cin.file.filename);
seconds=GetMagickTime();
-#if defined(MAGICKCORE_HAVE_LOCALTIME_R)
- (void) localtime_r(&seconds,&local_time);
-#else
- (void) memcpy(&local_time,localtime(&seconds),sizeof(local_time));
-#endif
+ GetUTCTime(&seconds,&local_time);
(void) memset(timestamp,0,sizeof(timestamp));
- (void) strftime(timestamp,MagickPathExtent,"%Y:%m:%d:%H:%M:%S%Z",&local_time);
+ (void) strftime(timestamp,MaxTextExtent,"%Y:%m:%d:%H:%M:%SUTC",&local_time);
(void) memset(cin.file.create_date,0,sizeof(cin.file.create_date));
(void) CopyMagickString(cin.file.create_date,timestamp,11);
offset+=WriteBlob(image,sizeof(cin.file.create_date),(unsigned char *)
image->depth=8;
current_time=GetMagickTime();
-#if defined(MAGICKCORE_HAVE_LOCALTIME_R)
- (void) localtime_r(¤t_time,&local_time);
-#else
- (void) memcpy(&local_time,localtime(¤t_time),sizeof(local_time));
-#endif
+ GetUTCTime(¤t_time,&local_time);
(void) memset(MATLAB_HDR,' ',MagickMin(sizeof(MATLAB_HDR),124));
FormatLocaleString(MATLAB_HDR,sizeof(MATLAB_HDR),
"MATLAB 5.0 MAT-file, Platform: %s, Created on: %s %s %2d %2d:%2d:%2d %d",
}
(void) WriteBlobString(image,buffer);
seconds=GetMagickTime();
-#if defined(MAGICKCORE_HAVE_LOCALTIME_R)
- (void) localtime_r(&seconds,&local_time);
-#else
- (void) memcpy(&local_time,localtime(&seconds),sizeof(local_time));
-#endif
+ GetUTCTime(&seconds,&local_time);
(void) FormatLocaleString(date,MagickPathExtent,"D:%04d%02d%02d%02d%02d%02d",
local_time.tm_year+1900,local_time.tm_mon+1,local_time.tm_mday,
local_time.tm_hour,local_time.tm_min,local_time.tm_sec);
#include "MagickCore/statistic.h"
#include "MagickCore/string_.h"
#include "MagickCore/string-private.h"
+#include "MagickCore/timer-private.h"
#include "MagickCore/transform.h"
#include "MagickCore/utility.h"
#if defined(MAGICKCORE_PNG_DELEGATE)
ptime.hour = hour;
ptime.minute = minute;
ptime.second = second;
-
+ png_convert_from_time_t(&ptime,GetMagickTime());
LogMagickEvent(CoderEvent,GetMagickModule(),
" png_set_tIME: y=%d, m=%d, d=%d, h=%d, m=%d, s=%d, ah=%d, am=%d",
ptime.year, ptime.month, ptime.day, ptime.hour, ptime.minute,